Use case · Game server

Running a DayZ dedicated server on Linux bare metal

A DayZ dedicated server is the free server package Bohemia ships as Steam app 223350 (1042420 for the experimental branch), fetched with SteamCMD under a real Steam login and run on Linux as the DayZServer binary under an ordinary user account. It will not start without a config file named by -config=, and its world state lives in a persistence folder you should back up with the server stopped.

See the game servers

The package and the platform

Bohemia's announcement for stable update 1.24 (February 2024) lists the official release of the Linux server for the stable branch among that update's changes; before that, the 1.21 experimental notes invited owners to try the Linux build on the experimental branch. The Windows build is DayZServer_x64.exe; on Linux the binary is DayZServer. Bohemia's community wiki page on hosting a Linux server is the install reference used here, and its server configuration page lists every option in the config and on the start line.

ItemValueWhere it comes from
Stable server app223350Wiki, Linux hosting page
Experimental server app1042420Wiki, Linux hosting page
Workshop app for mods221100Wiki, workshop_download_item examples
SteamCMD loginA Steam account, not anonymousWiki, Linux hosting page
Linux prerequisitelib32gcc-s1 (Debian family)Wiki and Valve's SteamCMD page
Signature checkverifySignatures = 2, the only value supportedWiki, server configuration

Sizing: one fast thread, then cores for the job system

Bohemia publishes no CPU or RAM figure for the server in the pages cited here, so size by the knobs it does document. dayzsettings.xml carries a jobsystem block whose example sets maxcores="4" and reservedcores="1"; the wiki says the worker thread count is maxcores - reservedcores, with at least one. multithreadedReplication = 1 in the config takes its worker threads from those same two settings. On the start line, -cpuCount= sets how many logical cores parallel tasks may use (no more than the machine has), and -limitFPS= caps server frames (the wiki gives 200 as the current maximum) to save CPU on a quiet server.

Our reading of that, not Bohemia's: the main simulation still wants the fastest single thread you can buy, and spare cores go to the job system and to a second instance if you run one. Memory and disk depend on the map, the mod list and the age of the persistence files; watch them for a week before you resize.

Install: service account, SteamCMD, firewall first

The wiki's guide opens with a warning not to run the server as root, so that a compromised server finds the rest of the system harder to reach; Valve says the same of SteamCMD. On Ubuntu 24.04, as your own sudo user, this creates the dayz account, installs SteamCMD by Valve's manual method and turns the firewall on before anything listens:

sudo apt update && sudo apt install -y lib32gcc-s1 curl ufw
sudo useradd -m -s /bin/bash dayz
sudo -u dayz bash -c 'mkdir -p /home/dayz/steamcmd /home/dayz/storage && cd /home/dayz/steamcmd && curl -sqL "https://client-update.steamstatic.com/installer/steamcmd_linux.tar.gz" | tar zxf -'

# firewall: IPv6 on before any rule, SSH, enable, then the game range
sudo sed -i 's/^IPV6=.*/IPV6=yes/' /etc/default/ufw
sudo ufw default deny incoming
sudo ufw allow OpenSSH
sudo ufw --force enable
sudo ufw allow 2302:2305/udp
sudo ufw status verbose

The UDP range is our choice, not a port table from Bohemia: it spans the values the wiki uses for -port= (2302 in its parameter list), clientPort (2304) and steamQueryPort (2305), and this page sets the game and query ports to match. The wiki's Linux example starts on 2301 instead; if you keep that, widen the rule.

Then fetch the server. SteamCMD needs the account's password, and a password typed as a +login user pass argument shows in ps and in shell history, so use its prompt. Type these one at a time:

  1. sudo -iu dayz, then /home/dayz/steamcmd/steamcmd.sh. It updates itself and leaves you at Steam>.
  2. force_install_dir /home/dayz/server (Valve sets the directory before the login).
  3. login yoursteamuser, then the password at its prompt, and the Steam Guard code if Steam emails one. Valve says the code is only needed the first time, while the cached login files stay in place, and that an account cannot hold two sessions at once; it advises a dedicated account used only for servers.
  4. app_update 223350 validate, wait for the success line, then quit.

The config file and BattlEye

The wiki is blunt about it: the config name means nothing, it is set by -config=, and with none given the server will not launch. Valve warns that validate overwrites changed files that belong to the install but leaves other files alone, so copy the shipped example under a new name instead of editing it in place: as dayz, run cd /home/dayz/server && [ ! -e live.cfg ] && install -m 600 /dev/null live.cfg && cat serverDZ.cfg > live.cfg && echo ok, and only edit when it prints ok. The settings that matter first:

  • hostname, description (255 characters at most) and maxPlayers (the wiki example uses 60).
  • password to join and passwordAdmin to become admin. They sit in this file in clear text, which is why it is mode 600.
  • verifySignatures = 2 and forceSameBuild = 1.
  • steamQueryPort = 2305. The wiki says setting it should fix a server missing from the in-game browser.
  • instanceId = 1 and storageAutoFix = 1. The instance id separates storage folders when one box runs several servers; the auto-fix replaces a corrupted persistence file with an empty one, so keep backups.
  • class Missions { class DayZ { template = "dayzOffline.chernarusplus"; }; }; picks the mission. Bohemia publishes its mission folders (dayzOffline.chernarusplus, dayzOffline.enoch, dayzOffline.sakhal, dayzOffline.nasdara and seasonal event variants) in its DayZ-Central-Economy repository.

BattlEye reads its config from the folder -BEpath= points at. The wiki names the file BEServer_x64.cfg, next to the Windows BEServer_x64.dll; on Linux, match the case of the file you find in that folder. RConPassword sets the remote admin password and RestrictRCon 1 limits what RCon may do. Keep that file at mode 600 too. Bohemia's pages don't say which port RCon listens on, so use a long random RConPassword and don't count on the firewall alone.

systemd unit with an update before each start

The wiki's daemon example runs an update script before each start, then the server with SIGINT as its stop signal. This is that unit, simplified from the wiki's, saved as /etc/systemd/system/dayz-server.service. Replace yoursteamuser with the account you logged in with above:

[Unit]
Description=DayZ Dedicated Server
Wants=network-online.target
After=network-online.target

[Service]
User=dayz
WorkingDirectory=/home/dayz/server
ExecStartPre=-/home/dayz/steamcmd/steamcmd.sh +force_install_dir /home/dayz/server +login yoursteamuser +app_update 223350 +quit
ExecStart=/home/dayz/server/DayZServer -config=live.cfg -port=2302 -storage=/home/dayz/storage -BEpath=battleye -profiles=profiles -dologs -adminlog -netlog -freezecheck
ExecStop=/bin/kill -s INT $MAINPID
LimitNOFILE=100000
TimeoutStartSec=1800
TimeoutStopSec=300
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

Our changes to the wiki's unit, in full: the SteamCMD line sits in ExecStartPre= instead of a separate update.sh, with a leading - so an update that exits with an error does not block the start; TimeoutStartSec=1800 because the default would cut a long download short, and the - does not cover a hang; After= names only network-online.target; Group=users and the ExecReload= HUP line are dropped; -config=live.cfg and -port=2302 replace the wiki's values and -storage= is added; the wiki's -mod= list is left out (add your own as shown below), and so are the mod-folder and key re-links its update.sh runs before each start; TimeoutStopSec=300 gives the shutdown time to save before systemd kills it; and Restart=always replaces on-failure, because the wiki doesn't say what exit code -freezecheck leaves when it stops a frozen server. The update only works while SteamCMD's cached login is valid; if it lapses, the step fails and the server starts on the files it has, until you log in again by hand.

Run sudo systemctl daemon-reload && sudo systemctl enable --now dayz-server, follow it with journalctl -u dayz-server -f, and read the RPT and admin logs in /home/dayz/server/profiles.

Workshop mods and their keys

The wiki's pattern, adapted to the paths above. Download each item at the Steam> prompt with workshop_download_item 221100 ITEMID after the same force_install_dir and login. Link the item into the server folder with ln -s /home/dayz/server/steamapps/workshop/content/221100/ITEMID /home/dayz/server/ITEMID, and link its keys with ln -s /home/dayz/server/steamapps/workshop/content/221100/ITEMID/keys/* /home/dayz/server/keys/. Then add the list to ExecStart= in quotes, as the wiki does: "-mod=ITEMID1;ITEMID2;". Server-only mods go in -serverMod=, which the server does not broadcast to clients.

With verifySignatures = 2, every key in keys/ is a signer you trust, so link only mods from authors you trust. Add one +workshop_download_item 221100 ITEMID per mod to the ExecStartPre= line, before +quit, if you want them updated with the server; the symlinks follow the updated folders, but a mod that ships a key under a new name needs its key linked again. Bohemia's mission files are released under the Arma and DayZ Public License Share Alike, which in our general reading (not legal advice) lets you adapt and share them with attribution, but not for commercial use and not in games other than Arma and DayZ, and adapted versions you distribute must carry the same licence.

Backups and restore

The wiki warns that an ungraceful shutdown can damage player characters and storage saves, so take backups with the service stopped. This archives the persistence root and everything under server except the re-downloadable steamapps (so the config, profiles, keys and BattlEye folder come along), checks the archive, and starts the server again either way:

sudo install -d -m 700 /root/dayz-backups
sudo systemctl stop dayz-server
f=/root/dayz-backups/dayz-$(date +%F-%H%M).tar.gz
sudo bash -o pipefail -c "tar -C /home/dayz --exclude=server/steamapps -czf $f storage server && tar -tzf $f >/dev/null" && echo archive ok
sudo systemctl start dayz-server

Copy the archives off the machine with plain rsync -a to a host you control, never with --delete. To restore: stop the service; test the archive with sudo tar -tzf FILE >/dev/null && echo ok and go on only on ok; set the current world and config aside with [ ! -e /home/dayz/storage.previous ] && [ ! -e /home/dayz/server/live.cfg.previous ] && sudo mv /home/dayz/storage /home/dayz/storage.previous && sudo cp -p /home/dayz/server/live.cfg /home/dayz/server/live.cfg.previous && echo set aside and go on only on set aside (it refuses while an old copy is still there: move that one first); extract with sudo tar -C /home/dayz -xzf FILE storage server/live.cfg; run sudo chown -R dayz:dayz /home/dayz/storage /home/dayz/server/live.cfg; start and join. Once the world looks right, delete storage.previous and live.cfg.previous. To undo, stop the service, move the restored storage aside, move storage.previous back and run sudo cp -p /home/dayz/server/live.cfg.previous /home/dayz/server/live.cfg.

Which of our machines fit

The game server machines are whole single-tenant servers listed by PassMark single-thread rating, every processor rated 2,000 or more, in New York, Miami, San Francisco, Amsterdam and Bucharest on our own network, AS19624. Each server includes an IPv4 address, and its port is unmetered: nothing counts the traffic. Ask your players to ping each city's test IP on the data center page before you choose. Ubuntu is among the one-click images on the Linux server page, and the root login is yours.

Delivery of a racked machine: about 30 minutes from order approval; a build to order takes 4 to 24 hours. Ready units can also be rented by the hour, which suits a test of a mod list before you commit. Rack servers and blades carry an out-of-band controller with a browser console (among Moonshot cartridges, only the m510 and m710x), which gets you back in if a firewall rule shuts out SSH. The Arma 3 notes cover Bohemia's other server family.

Wrong fit: the server itself, its mods, missions, BattlEye filters and backups stay your job; installing and patching the game is not included with the machine. Copy backups off the machine yourself.

Questions

Does the DayZ server run on Linux?

Yes. Bohemia's 1.24 stable update announcement lists the official Linux server release for the stable branch, and the wiki's Linux guide runs the DayZServer binary from app 223350. Run it under its own non-root account, as the wiki asks.

Can SteamCMD fetch it anonymously?

Not in Bohemia's guide: every install and update command there uses +login with a Steam account name. Type the password at SteamCMD's prompt, not as an argument, which would expose it in ps and in shell history.

Why will my server not start with no config given?

The wiki says there is no default config name, and without -config= the server will not launch because the mandatory settings are missing. Point -config= at your own copy of the shipped serverDZ.cfg.

Why is my server missing from the browser?

Check that steamQueryPort is set in the config (the wiki says this should fix the problem) and that the firewall passes it over UDP. This page sets it to 2305 and opens 2302 to 2305.

Can one machine run two DayZ servers?

The wiki's instanceId exists to identify several instances on one box and their storage folders. In our setup, give the second one its own -port=, steamQueryPort, instanceId, -storage=, -profiles=, config file, unit and firewall rule.

Put DayZ on its own machine

Pick a processor by single-thread rating and the city nearest your players, log in as root, and run the server under its own account.

See the game servers

Related on Server Room

Other use cases