7 Days to Die dedicated servers — through the V2.5 "Survival Revival" and current V2.6 Stable releases — gradually accumulate RAM and CPU overhead the longer they stay up. The voxel world, chunk cache, entity tracker, and any installed overhaul mods all contribute. A scheduled restart on a predictable cadence is the simplest fix and the lowest-effort uptime policy. This guide covers the pre-shutdown commands you must run, three implementation patterns (in-game scripted, OS-level scheduler, third-party tool), and the warnings that bite people who skip the save step.
mem/memcl calls help, but a full process restart is the only way to fully release allocator overhead.Both commands are real, server-supported, and safe to script.
| Command | Shortcut | What it does |
|---|---|---|
saveworld | sa | Manually flushes the world to disk. The game also auto-saves periodically, but a forced save right before shutdown closes the gap between the last auto-save and the shutdown moment. |
shutdown | — | Saves and exits the server cleanly. Always preferred over killing the OS process — a kill mid-tick can corrupt the chunk file currently being written. |
Best-practice sequence (whatever scheduler you use):
say "Server restarts in 5 minutes — finish your run."say "Restart in 60 seconds."saveworld, wait ~10 seconds for it to complete.shutdown.Most Linux dedicated-server installs use a systemd service unit, which means you can drive the restart sequence with two extra units: a wrapper script that talks to the server's telnet socket, and a timer that fires it on schedule.
Telnet is built into the dedicated server (configured in serverconfig.xml via TelnetEnabled, TelnetPort default 8081, and TelnetPassword). Any client that can speak plain TCP — ncat, expect, your own script — can issue admin commands.
Sketch of a wrapper script (/usr/local/bin/7dtd-graceful-restart.sh):
# Replace TELNET_PASS with the value from serverconfig.xml.
# This relies on `expect` being installed.
expect <<'EXPECT'
spawn nc localhost 8081
expect "password:"
send "TELNET_PASS\r"
send "say \"Server restarts in 5 minutes.\"\r"
sleep 240
send "say \"Restart in 60 seconds.\"\r"
sleep 50
send "saveworld\r"
sleep 10
send "shutdown\r"
EXPECT
sleep 5
systemctl restart your-7dtd-service-name
Then a systemd timer runs that script daily at 04:00:
# /etc/systemd/system/7dtd-restart.service
[Unit]
Description=Graceful nightly 7DTD restart
[Service]
Type=oneshot
ExecStart=/usr/local/bin/7dtd-graceful-restart.sh
# /etc/systemd/system/7dtd-restart.timer
[Unit]
Description=Run 7DTD nightly restart at 04:00
[Timer]
OnCalendar=*-*-* 04:00:00
Persistent=true
[Install]
WantedBy=timers.target
Enable with systemctl enable --now 7dtd-restart.timer. The actual service-name in systemctl restart depends on how your install was set up (7dtd, 7d2d, sdtdserver, etc.) — adjust to match yours.
Same principle, simpler runtime. Use cron if your host doesn't run systemd or you prefer crontabs.
# crontab -e
0 4 * * * /usr/local/bin/7dtd-graceful-restart.sh >> /var/log/7dtd-restart.log 2>&1
The wrapper script is identical to the systemd version above. Cron's downside vs. systemd timers: less helpful failure logging, no Persistent=true equivalent (a missed window because the host was down stays missed).
If you already run a server-management layer, use its scheduler instead of rolling your own. Common options:
saveworld then shutdown on the cadence you want.Whichever path you pick, the underlying sequence is identical: warn, save, shutdown, supervisor restarts.
There's no universal answer — it depends on player load, mod set, and hardware. Reasonable starting points:
If players are reporting rubber-banding or chunk-load stalls midway through a session, your cadence is too long. Shorten it before adding hardware.
kill -9 the server. Always go through shutdown (or systemctl stop on systemd, which sends SIGTERM and lets the server exit cleanly). Killing mid-write corrupts the chunk file.saveworld can cost up to one auto-save interval of progress. The auto-save runs periodically; if shutdown happens right before the next one, players lose recent progress they thought was banked.127.0.0.1 only and SSH-tunnel for remote access.saveworld, shutdown, say, telnet basicsTelnetEnabled, TelnetPort, TelnetPassword