Yes, you can automate Project Zomboid server restarts with timed in-game warnings, but the game ships no built-in scheduler. The standard approach is to run the dedicated server inside a terminal multiplexer such as tmux or screen (Linux) and have a cron job send servermsg warnings to the console, then stop and relaunch the server gracefully. On Windows, the equivalent uses Task Scheduler plus a PowerShell script. The whole setup takes about 30 minutes and needs command-line access to the machine hosting your server. Exact labels and file names can differ slightly between server versions and hosting providers, so check paths against your own install.

What You'll Need

  • Admin or SSH/RDP access to the machine running your Project Zomboid dedicated server
  • The server installed via SteamCMD or your host's own installer
  • On Linux: tmux or screen, and cron installed (both standard on most distros)
  • On Windows: Task Scheduler and PowerShell (built in)
  • Your existing server start script or batch file
  • A recent backup of your save folder (the Saves directory) before you test anything

Step-by-Step

These steps cover the Linux method first, since that is the most common setup for hosted Zomboid servers. The Windows variant follows.

Linux: cron + tmux

  1. Back up your server. Copy the Saves/Multiplayer/servertest folder (name varies by server) somewhere safe.
  2. If your server is not already running inside tmux, change your start script to launch it in a named session, e.g. tmux new -d -s pzserver './startserver.sh'. All commands below assume the session is named pzserver.
  3. Create a warning script, e.g. /home/pz/restart-warn.sh, that sends messages to the server console:
    #!/bin/bash
    tmux send-keys -t pzserver 'servermsg "Server restarts in 15 minutes"' Enter
    Mark it executable with chmod +x.
  4. Create a second script, restart.sh, that sends the final warning, then cleanly stops and relaunches the server. To stop gracefully, send quit to the console (this saves the world), wait for the process to exit, then re-run your start script in a fresh tmux session. A short sleep between stop and start lets file locks release.
  5. Add cron entries with crontab -e. For a 4 a.m. restart with warnings at 15, 10, 5 and 1 minute:
    3 45 4 * * * /home/pz/restart-warn.sh
    (adjust the message and minutes in the warning script, or create one script per countdown step), and 0 4 * * * /home/pz/restart.sh for the actual restart.
  6. Test without waiting for 4 a.m.: run restart-warn.sh manually while connected in game and confirm the message appears in chat.
  7. Then run restart.sh manually. Confirm the world saves (players see a save on disconnect), the process restarts, and you can reconnect with your character intact.

Windows: Task Scheduler

  1. Back up the save folder as above.
  2. Because a detached server process has no easy console input on Windows, the practical route is a PowerShell restart script and Task Scheduler rather than console warnings. The script should run Stop-Process -Name "ProjectZomboid64" -Force only as a last resort; prefer stopping gracefully. The dedicated server saves periodically (default autosave interval is defined in the server config), and also saves on player disconnects.
  3. If in-game warnings matter to you on Windows, the reliable option is to run the server through a wrapper that exposes the console, or host on Linux instead. Some hosts also provide a scheduled-restart feature in their control panel with an announcement option, which is the easiest path if yours offers one; check your host's panel or docs.
  4. Create the restart action in Task Scheduler: set the program to your StartServer.bat, tick a daily trigger at your chosen time, and set the task to stop the existing server instance first if your wrapper supports it.
  5. Run the task once manually from Task Scheduler and verify the server comes back up.

Common Mistakes

  • Killing the process without a graceful stop. Force-killing right after player activity can lose recent progress. Always try a clean stop first.
  • Forgetting that cron runs in a minimal environment. Use absolute paths to tmux, scripts and the server files, and test by running the script exactly as cron would.
  • Restarting too frequently. Restarts interrupt players; once per day at a low-population hour is typical. Some hosts recommend regular restarts to keep performance smooth, but don't overdo it.
  • Overlapping schedules. If a restart takes longer than expected, a second cron job can fire mid-restart. Leave generous gaps and have the restart script check whether the server is already starting.
  • Not testing the warning messages. A typo in the session name means silent failures, so verify each message in game once.
  • Skipping the backup before the first automated run. The first unattended restart is the most likely one to misbehave.

Tips

  • Schedule restarts for your server's quietest hour, not necessarily midnight, if your player base spans time zones.
  • Chain multiple short warning scripts (15, 10, 5, 1 minute) rather than one script with sleeps, so a crashed warning script never blocks the actual restart.
  • Log everything: append output with >> /home/pz/restart.log 2>&1 so you can see what happened overnight.
  • If your host provides a control panel with scheduled restarts and announcements, use that instead of rolling your own; it is maintained for you and survives game updates.
  • After a major game update, re-test your scripts, since startup file names occasionally change between versions.

Troubleshooting

  • No warning appears in chat. Check the tmux session name matches exactly (tmux ls), and run the send-keys command by hand to see any error. Confirm the message shows in the server console log even if chat delivery failed.
  • Script works manually but not from cron. Almost always a path or environment issue. Use absolute paths everywhere, and test with env -i /bin/sh -c '/home/pz/restart.sh' to mimic cron's bare environment.
  • Server doesn't come back up after restart. Check the log file your restart script writes, then the server's own console log in the install directory. Common causes: the old process hadn't fully exited (add a longer wait or a loop that waits for the port to free), or the start script depends on a variable cron doesn't set.
  • Players lose progress on restart. The stop wasn't graceful. Send quit or save before anything else and confirm in the console log that a save completed before the process ends.
  • Server runs but nobody can connect. Give it a minute or two after launch, verify the port is listening, and check whether a second server instance started by mistake and grabbed the save lock.
  • If all else fails, revert to a manual restart (stop, back up, start), confirm the server is healthy, then reintroduce automation one piece at a time: warning first, restart second.

Frequently Asked Questions

Does Project Zomboid have a built-in scheduled restart option?

No. The dedicated server has no restart scheduler in its config files. Restarts must be automated externally with cron or Task Scheduler, or through your host's control panel if it offers one.

How often should I restart my server?

Once per day during quiet hours is a common choice. Very long sessions can gradually degrade performance, and a daily restart also guarantees a fresh save cycle. Anything more frequent mostly just inconveniences players.

Will an automatic restart wipe or corrupt my save?

No, provided the stop is graceful so the world saves before shutdown. That is exactly why the script should send a quit command and wait, rather than force-killing the process.

Can I warn players without tmux or a control panel?

Not reliably. Warnings need console input, which tmux or screen provides on Linux. On Windows without a wrapper, consider your host's panel, or a server-management tool that exposes the console.

Do I need to restart after changing server settings?

Yes, most changes in the server config files only take effect after a restart, which is another reason a reliable automated restart routine is worth having.