DayZ
GamesHow long can you survive a post-apocalyptic world? A land overrun with an infected "zombie" population, where you compete with other survivors for limited resources. Will you team up with strangers and stay strong together? Or play as a lone wolf to avoid betrayal? This is DayZ – this is your story.
README
DayZ
[!NOTE] This Egg is for the standalone version of DayZ only. It is not for the DayZ mod on Arma 2 or Arma 3.
Authors / Contributors
Game Description
From Bohemia Interactive's Website:
How long can you survive a post-apocalyptic world? A land overrun with an infected "zombie" population, where you compete with other survivors for limited resources. Will you team up with strangers and stay strong together? Or play as a lone wolf to avoid betrayal? This is DayZ – this is your story.
Egg Capabilities
- Able to download server updates on startup
- Able to download, update, and load Steam Workshop mods on startup (*see Installation/System Requirements: Game Ownership)
- Also accepts server-side only mods.
- Checks for mod updates against their Steam Workshop page's last update for quick and efficient update checks.
- Automatically moves mod
.bikey's to the/keys/directory. - Note: These features only work with mods in the
@workshopID#format. Manually uploaded mods are not automatically updated.
- Multiple basic settings found within the
serverDZ.cfgfile can be easily set from the server's Startup tab- Server name, passwords, disable third person, persistent time, and more...
- Max Players is configurable and able to be host enforced (*see Recommended Egg Modifications)
- Additional DayZ startup parameters can be added to fine-tune performance
- WHMCS compatible (*see Recommended Egg Modifications)
Server Ports
Default server ports are listed below, but all ports can be changed freely.
| Port | Default | Protocol | Required | Notes |
|---|---|---|---|---|
| Game | 2302 | UDP | Yes | Primary port in Panel |
| Steam Query | 27016 | UDP | Partially | Required for server listing |
| RCON | 2305 | UDP | No | Required to be defined, but not required to be assigned to the server |
Installation/System Requirements
[!IMPORTANT] A real, valid Steam account is required to install this game server.
[!WARNING] Steam Guard must be completely turned off for the server and mods to download efficiently. See Running With Steam Guard Enabled for an unofficial workaround.
| Bare Minimum | Recommended | |
|---|---|---|
| Processor | Recent x86/64 (AMD/Intel) processor. No 32-bit or ARM support. | Avoid CPU Pinning; may cause issues. |
| RAM | 4096-5120 MiB | 8192 MiB |
| Storage | 3072 MiB | 7168+ MiB (depends on how many mods are installed) |
| Network | 0.512 Mbit/s/player | 1-5 Mbit/s/player |
| Host OS | Most stable Linux OS branches should work | Using the latest kernel version for your installed OS can prevent some edge-case installation/boot issues. |
Game Ownership:
While not required, it is highly recommended that the Steam account used to install this server owns the DayZ game for the following reasons:
- Vanilla mission files will only update automatically with the server if the game is owned.
- They can still be manually updated by deleting the
mpmissions/directory and reinstalling the server (this will not erase other files).
- They can still be manually updated by deleting the
- Automatic Steam Workshop mod downloading requires ownership.
- This is optional functionality, and mods can be manually uploaded to the server if desired.
- Hosts may feel free to change the "[Host] Disable Mod Downloads/Updates" variable to
1if they would not like to offer this functionality to clients.
Recommended Egg Modifications
The following are highly recommended variable modifications you can make to the egg after importing it to your panel. While viewing this egg, simply go to the "Variables" tab of the egg editor to make these changes.
Default Steam Username & Password
- To make deploying servers easy (or if you are using WHMCS), it is recommended to edit the default values of "Steam Username" and "Steam Password" to your Steam account dedicated for hosting. This will make all newly installed servers use these credentials. DO NOT make these fields visible to the end user so that they can use their own Steam accounts; the panel will save their Steam credentials in plain text, which is a BIG NO NO for security and privacy.
Restrict Max Players
- If you would like to restrict the maximum number of players that can join your client's server, you can change the permissions of the "Max Players" variable so that clients can only view this value (and not edit it). It's default value can also be changed, or the value can be changed on a server-by-server basis as desired.
Running With Steam Guard Enabled
[!CAUTION] The following is highly discouraged for production environments or even private use. It should only be used if you really don't want to disable Steam Guard and don't plan on updating your server/mods often. Support will not be given to those with Steam Guard enabled. Additionally, using this method, you are at risk of rate limiting your account if something goes wrong.
- When creating your server, set the variables "[Host] Skip Game Server Install" and "[Repair] Validate Server Files" to
1. - Proceed with installation as normal.
- If the server has not automatically started after installation, start it.
- The console will eventually appear to freeze on the line:
Loading Steam API...OK. You will likely receive a Steam Guard request for login at this time. Approve this request just to be safe, but this will not log you in. Next, obtain a valid Steam Guard code, enter it into the console, and press Enter to submit it. This should log you in. It is successful if you see:Two-factor code:OK. The server will then download for the first time. Note: It may glitch and not display installation progress; be patient while it downloads and verifies.- If you have mods to install, you will have to repeat this process of obtaining and entering in a new Steam Guard code for every mod.
- The server should properly start at this time.
- Go to the Startup tab and disable "[Repair] Validate Server Files". Also, it is recommended you disable the "Automatic Updates" Startup Variable until you need to update again. Otherwise, you will have to go through the process of entering in Steam Guard codes again every boot.
Docker Images (1)
| Name | Image |
|---|---|
ghcr.io/ptero-eggs/games:dayz | ghcr.io/ptero-eggs/games:dayz |
Startup Command
./{{SERVER_BINARY}} -port={{SERVER_PORT}} -profiles=profiles -bepath=./ -config=serverDZ.cfg -mod={{CLIENT_MODS}} -serverMod={{SERVERMODS}} {{STARTUP_PARAMS}} Variables (32)
[Host] Steam Query Port
UDP port for Steam server list features. Helps the server be visible in the client server browser.
- Environment:
QUERY_PORT- Default:
27016- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|between:1024,65536
[Host] Steam Username
Used for installation and updates. Account does not need to own DayZ, but MUST BE a VALID Steam account (anonymous login cannot be used). For security reasons it is recommended that you create a new Steam account just for your dedicated servers. *This info is not visible to the server owner.*
- Environment:
STEAM_USER- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|not_in:anonymous
[Host] Steam Password
Used for installation and updates. Steam Guard MUST be completely TURNED OFF for the server and mods to download efficiently. *This info is not visible to the server owner, BUT IS stored in PLAIN TEXT. It is NOT advised to use a personal account; best to use a dummy account.*
- Environment:
STEAM_PASS- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string
[Host] Disable Mod Downloads/Updates
If the Steam account does not own the base DayZ game, Steam Workshop mod downloads/updates will not work. If so, this setting allows disabling of this feature to avoid errors. (1 ON | 0 OFF)
- Environment:
DISABLE_MOD_UPDATES- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
[Host] Number of SteamCMD Retry Attempts
How many times SteamCMD should retry downloading a server or mod after a recoverable error. (ie. A particularly large mod download times out)
- Environment:
STEAMCMD_ATTEMPTS- Default:
3- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer
[Host] Skip Game Server Install
Skips the installation of game server files via SteamCMD during the installation script. Should only be enabled if you are trying to install the server with a Steam account that has Steam Guard enabled (not recommended).
- Environment:
SKIP_INSTALL- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
Automatic Updates
Quickly checks for any server or mod updates on startup, and updates if necessary.
- Environment:
UPDATE_SERVER- Default:
1- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
Server Name
Name of the server that will appear in the server list.
- Environment:
SERVER_HOSTNAME- Default:
DayZ Server- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string
Max Players
Maximum number of players allowed to join the server.
- Environment:
MAX_PLAYERS- Default:
64- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|gt:0
Server Password
Password required to join the server. Leave blank to have no password.
- Environment:
SERVER_PASSWORD- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string
Admin Password
Password to log in as an admin on the server.
- Environment:
ADMIN_PASSWORD- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string
RCON Port
Used by Tools or Battlemetrics to manage servers from outside. RCON Port is recommended to be at Game Port +3. For example, If the Game Port is 2302, then RCON Port should be 2305.
- Environment:
RCON_PORT- Default:
2305- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|between:1024,65536
RCON Password
This password is used to authenticate third parties to access server controls via RCON.
- Environment:
RCON_PASSWORD- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|max:20
Modlist File (Exported from DayZ Launcher)
Filename for an exported modlist. This file will be parsed for mod installation and loading. Upload your HTML file to the root directory (eg. /home/container/modlist.html). Leave blank to disable loading mods from a modlist.
- Environment:
MOD_FILE- Default:
modlist.html- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string
Additional Mods
A semicolon-separated list of mod folders to load from the root directory. Useful for loading manually uploaded mods. Any mods in this list that are in "@workshopID" form will also be included in Automatic Updates (if enabled). NO capital letters, spaces, or folders starting with a number! (ex. myMod;@123456789;@987654321;etc;)
- Environment:
MODIFICATIONS- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string
Verify Signatures
Ensures all clients have exactly the same version of mods or addons that the server is running. Otherwise, they will be kicked upon connection. (2 ON | 0 OFF)
- Environment:
VERIFY_SIGNATURES- Default:
2- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:0,2
Enforce Game Version
When ON, the server will allow the connection only to clients with same the version as the server.
- Environment:
ENFORCE_BUILD- Default:
1- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
Disable VoN
When ON, will disable Voice over Network (voice chat) in the server.
- Environment:
DISABLE_VON- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
VoN Quality
Voice over Network codec quality; the higher the better. (Values 0-30)
- Environment:
VON_QUALITY- Default:
20- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|between:0,30
Disable Third Person
When ON, will disable third person view while on the server.
- Environment:
DISABLE_THIRD- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
Disable Crosshair
When ON, will disable the crosshair from being visible while on the server.
- Environment:
DISABLE_CROSSHAIR- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
Disable Personal Light
When ON, will disable a personal light positioned above all clients during the night time while on the server.
- Environment:
DISABLE_PERSONAL_LIGHT- Default:
1- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
Darker Nights
When ON, will make nights darker (more accurate nights, but hard to see without a light).
- Environment:
LIGHTING_CONFIG- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
Persistent Time
The actual server time is saved to storage, so when ON, the next server start will use the saved time value.
- Environment:
PERSISTENT_TIME- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
Time Multiplier
This is a time multiplier for in-game time (ie. 12 would move a full 24-hour day in-game 12 times faster, making it last 2 hours "in real life"). (Values: 0-24)
- Environment:
TIME_MULT- Default:
12- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|between:0,24
Night Multiplier
This is an additional multiplier to either speed up or slow down nights in-game. It is multiplied with the "Time Multiplier" variable to get it's final multiplier for night time speed. (Values: 0.1-64.0)
- Environment:
NIGHT_MULT- Default:
1- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|numeric|between:0.1,64
[Repair] Make Mod Files Lowercase
Every mod that is set to be loaded will have its folder and files changed to lowercase (to prevent errors). It is recommended to enable this for one server boot after copying a mod from a Windows machine to the server, or if mods seem to not be loading.
- Environment:
MODS_LOWERCASE- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
[Repair] Validate Server Files
Validates all server files when Automatic Updates is ON. Note: This will significantly increase server startup times, so it is recommended to only enable this when needed.
- Environment:
VALIDATE_SERVER- Default:
0- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
boolean
[Advanced] Server-Side Only Mods
Mod folders to be used with the "-serverMods" startup option. They only run server-side and are not required by clients if "Verify Signatures" is ON. Any mods in this list that are in "@workshopID" form will also be included in Automatic Updates (if enabled). NO capital letters, spaces, or folders starting with a number! Each folder must be followed with a semicolon (ex. @123456789;@987654321;etc;)
- Environment:
SERVERMODS- Default:
None- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string
[Advanced] Extra Startup Parameters
See https://community.bistudio.com/wiki/DayZ:Server_Configuration#Launch_Parameters for more info on valid flags for this field.
- Environment:
STARTUP_PARAMS- Default:
-dologs -adminlog -netlog -freezecheck- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
nullable|string
[Advanced] Server Binary
Cannot currently be changed. Left in case other branches with different executable names are introduced at a later date.
- Environment:
SERVER_BINARY- Default:
DayZServer- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|string|in:DayZServer
[Advanced] DayZ Dedicated Server App ID
Used for installation and updates. Rarely needs to be changed. 223350 is for Stable branch and 1042420 is for experimental branch. Changing branches may require deleting all server files and reinstalling.
- Environment:
STEAMCMD_APPID- Default:
223350- User Viewable:
- ❌
- User Editable:
- ❌
- Rules:
required|integer|in:223350,1042420
Installation Script
ghcr.io/ptero-eggs/installers:debian/bin/bash#!/bin/bash
## File: Pterodactyl DayZ Egg - egg-pterodactyl-day-z.json
## Author: David Wolfe (Red-Thirten)
## Date: 2024/07/04
## License: MIT License
## Image to install with is 'ghcr.io/ptero-eggs/installers:debian'
export HOME=/mnt/server
CONFIG_URL="https://raw.githubusercontent.com/ptero-eggs/game-eggs/main/dayz/config/serverDZ.cfg"
MISSIONS_GITHUB_PACKAGE="BohemiaInteractive/DayZ-Central-Economy"
## Download and install SteamCMD
cd /tmp
mkdir -p $HOME/steamcmd $HOME/steamapps
curl -sSL -o steamcmd.tar.gz https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzvf steamcmd.tar.gz -C $HOME/steamcmd
cd $HOME/steamcmd
# SteamCMD fails otherwise for some reason, even running as root.
# This is changed at the end of the install process anyways.
chown -R root:root /mnt
if [ "$SKIP_INSTALL" -eq 1 ]; then
# This is for the minority of hosts who want to install this server with Steam Guard enabled.
# Please read the README for instructions on how to do this properly!
echo -e '"Skip Game Server Install" variable is set to enabled!'
echo -e "\tOnly SteamCMD will be installed..."
./steamcmd.sh +quit
else
# Install/Verify game server using SteamCMD
./steamcmd.sh +force_install_dir $HOME "+login \"${STEAM_USER}\" \"${STEAM_PASS}\"" +app_update ${STEAMCMD_APPID} $( [[ -z ${STEAMCMD_BETAID} ]] || printf %s "-beta ${STEAMCMD_BETAID}" ) $( [[ -z ${STEAMCMD_BETAPASS} ]] || printf %s "-betapassword ${STEAMCMD_BETAPASS}" ) ${INSTALL_FLAGS} validate +quit
fi
echo -e ""
# Set up 32 and 64 bit libraries
mkdir -p $HOME/.steam/sdk{32,64}
cp -v linux32/steamclient.so $HOME/.steam/sdk32/steamclient.so
cp -v linux64/steamclient.so $HOME/.steam/sdk64/steamclient.so
## DayZ Setup
cd $HOME
# Check for successful server binary installation
if [ ! -f DayZServer ] && [ "$SKIP_INSTALL" -ne 1 ]; then
echo -e "\n\n[ERROR] SteamCMD failed to install the DayZ Dedicated Server!"
echo -e "\tTry reinstalling the server again.\n"
exit 1
fi
# Download default serverDZ.cfg if it is missing or empty (occurs when Steam account *owns* the DayZ game)
if [ ! -f serverDZ.cfg ] || [ ! -s serverDZ.cfg ]; then
echo -e "'serverDZ.cfg' is missing or empty. Downloading default config file..."
curl -LO ${CONFIG_URL}
if [ ! -f serverDZ.cfg ]; then
echo -e "\n\n[ERROR] Failed to download default server config file!"
exit 1
fi
chmod 644 serverDZ.cfg
fi
# Add required 'steamQueryPort' parameter to the end of serverDZ.cfg (if it's missing)
if ! grep -q "steamQueryPort" serverDZ.cfg; then
echo -e "Adding additional required parameters to the end of 'serverDZ.cfg'..."
cat >> serverDZ.cfg << EOL
steamQueryPort = ${QUERY_PORT};
EOL
fi
# Download vanilla mission files if they are missing (occurs when Steam account *does not own* the DayZ game)
if { [ ! -d "mpmissions" ] || [ -z "$(ls -A mpmissions 2>/dev/null)" ]; } && [ "$SKIP_INSTALL" -ne 1 ]; then
echo -e "[WARNING] The Steam account used to install this server does not own the DayZ game!"
echo -e "\tVanilla mission files will have to be MANUALLY updated in the future if they update! (See Egg's README for instructions)"
echo -e "\tDownloading and installing vanilla mission files..."
mkdir -p $HOME/mpmissions
cd $HOME/mpmissions
LATEST_JSON=$(curl --silent "https://api.github.com/repos/${MISSIONS_GITHUB_PACKAGE}/releases/latest")
DOWNLOAD_URL=$(echo ${LATEST_JSON} | jq -r .tarball_url)
curl -Lo mpmissions.tar.gz ${DOWNLOAD_URL}
if [ ! -f mpmissions.tar.gz ]; then
echo -e "\n\n[ERROR] Failed to download vanilla mission files!"
exit 1
fi
tar -xzvf mpmissions.tar.gz --strip-components=1 --wildcards '*/dayzOffline.chernarusplus/*' '*/dayzOffline.enoch/*'
rm -f mpmissions.tar.gz
fi
# Check for BattlEye RCon configuration
mkdir -p $HOME/battleye
cd $HOME/battleye
if [ ! -f beserver_x64.cfg ]; then
echo -e "Creating BattlEye RCon Configuration..."
cat > beserver_x64.cfg << EOF
RConPort ${RCON_PORT}
RConPassword ${RCON_PASSWORD}
RestrictRCon 0
EOF
fi
echo -e "\nDayZ Dedicated Server successfully installed!\n"