This tool aims to simplify the process of setting up a DayZ Standalone Server on a Windows Server.
The goal was to break down the initial effort to a minimum while providing configuration to nearly all aspects of the server administration process.
Also supports linux server (See Linux Server Usage)
server-manager.json
config to fit your needs
!IMPORTANT! Change the admin and rcon password
This app was written with backwards compatibility in mind.
Sometimes, however, some breaking changes to the server manager config will occur.
The best strategy to update, is to take the config template of the new version and modify it to match your old values.
This way you can not miss out on new properties which might be required.
The configuration of the manager is all done in a single config file.
When installing the manager the first time, you will find a configuration template which needs to be renamed to server-manager.json
.
You can then go ahead and change the settings inside of this file.
If you do not need anything special (you would probably know by now), then the default values will work out well.
You can also configure serverDZ.cfg manually, but you will have to set the serverCfg to null
:
{
...
"serverCfg": null
...
}
Otherwise it will be overriden by the settings inside the server-manager.json
.
Some important values you probably want to change: |
||
---|---|---|
instanceId | some unique name of this server instance | |
admins | the admins / moderators who can access the web ui and the discord commands | |
discordBotToken | the token the server manager will use to send messages to your discord server | |
discordChannels | the channels of your discord server to send messages to (make sure the bot has access to them) | |
rconPassword | the server's rcon password !IMPORTANT! change this or others might be able to take control over your server |
|
localMods | list of manually install mods which are not auto updated via steam cmd | |
steamUsername / steamPassword | the credentials to use to download the server files and workshop mods | |
steamWsMods | the steam workshop mods to download | |
events | scheduled events for stuff like server restarts, global messages and so on | |
serverCfg.hostname | the name of the server in the server browser | |
serverCfg.password | the password of the game server | |
serverCfg.passwordAdmin | the admin password of the game server !IMPORTANT! change this or others might be able to take control over your server |
Below you will find a list of guides on how to edit these values.
For later compatibility between multiple installations and identification of different configs a instance id was introduced (currently it is not used)
Set this to some id you like :)
Example:
"instanceId": "main-server"
To add/remove admins or moderators, edit the admins list in the config.
Read the description in the template to find out more about the roles.
The example snippet shows how to add an admin, a manager and a moderator.
...
"admins": [
{
"userId": "FunkyDude",
"userLevel": "admin",
"password": "admin"
},
{
"userId": "the-discord-dude",
"userLevel": "manage",
"password": "somecoolpassword"
},
{
"userId": "InternDude",
"userLevel": "moderate",
"password": "somoderatormuchwow"
}
],
...
To obtain a discord bot token, follow the steps at: https://www.writebots.com/discord-bot-token/#Generating_Your_Token_Step-by-Step
In a nutshell:
"discordBotToken": "your-token.goes.here",
To add/remove discord channels, edit the discordChannels list in the config.
Read the description in the template to find out more about the channel types.
The following example adds a channel for commands and one for rcon messages
...
"discordChannels": [
{
"channel": "main-server-commands",
"mode": "admin"
},
{
"channel": "main-server-rcon",
"mode": "rcon"
}
],
...
Local mods are mods which you manually install and update. The server manager will only add them to the server startup parameters.
Example:
"localMods": [
"@MyAwesomeMod",
"path/to/my/@OtherAwesomeMod",
],
Workshop mods will be downloaded and updated everytime the server restarts (if not configured otherwise).
The steamWsMods property specifies a list of workshop mods to download.
There are two possible syntaxes:
"steamWsMods": [
"1559212036",
"1565871491"
],
or
"steamWsMods": [
{
"workshopId": "1559212036",
"name": "CF"
},
{
"workshopId": "1565871491",
"name": "BuilderItems"
}
],
Hint: The name of the mod is only there to make the config more readable. You can enter whatever you want.
Hint: You can mix the syntaxes
server-manager.json
serverCfg
entryhostname
property to change the server namepassword
property to change the server's passwordpasswordAdmin
property to change the server's admin passwordYou might need to host your server on another port, because you want to host multiple servers on the same machine
or whatever the reason might be.
HowTo:
server-manager.json
serverPort
property and change it to the desired portserverCfg
entrysteamQueryPort
property to the value of: serverPort
+ 3Events are used to do tasks that are occurring at specific points in time.
Typical examples would be regular server restarts and global messages to promote the server's discord.
The following example shows exactly this.
It is scheduling:
The scheduling pattern is the CRON pattern.
There are free websites to generate these peatterns pretty easily:
For more details see the description in the server-manager.json
itself.
Example:
...
"events": [
{
"name": "Restart every 4 hours",
"type": "restart",
"cron": "0 0/4 * * *"
},
{
"name": "Some Message",
"type": "message",
"cron": "0/15 * * * *",
"params": [
"Hello world"
]
}
],
...
Hooks can be used to trigger external scripts or programs on certain events.
This can be useful to so manual configuration or other custom stuff.
Possible hook types are:
In the server manager config add a hook object to the hooks array like so:
...
"hooks": [
{
"type": "beforeStart",
"program": "path/to/your/script.bat"
}
],
...
The manager was tested on Ubuntu 22 (latest).
Other up2date debian variants should work as well.
The DayZServer only works on x86 platforms, ARM is NOT supported!
The manager can be run via the binary (recommended) or docker.
The main downside when run with docker:
If the manager crashes or shuts down, your dayz server will also be shut down.
(the commands below might be needed to be run as root/with sudo)
Install the required libs for dayz and steamcmd
apt-get install libcap-dev lib32gcc-s1 libcurl4 libcurl4-openssl-dev
Create a user for the server (highly recommended for security reasons)
The user should have the home directory set to where the server files will reside
Replace /dayz
with the directory you want your server to be in, but make sure its already created
useradd --system -m -d /dayz -s /bin/bash dayz
chown dayz:dayz /dayz
Download and extract the latest linux release from the releases page
Setup the manager files
4.1. Copy the dayz-server-manager
binary to your /dayz
directory
4.2. Copy the server-manager-template.json
to the /dayz
4.3. Rename the server-manager-template.json
to the server-manager.json
4.4. Edit the server-manager.json
with a text editor to fit your needs
(Make sure its valid json. Its recommended to use VSCode for editing and set the file type to jsonc / json with comments)
Switch to the /dayz
dir
cd /dayz
Make the binary executable and owned by the dayz user
chown dayz:dayz dayz-server-manager
chmod +x dayz-server-manager
Switch to the dayz user
su dayz
Run the manager
./dayz-server-manager
Create the service file /etc/systemd/system/dayz-server-manager.service
[Unit]
Description=DayZ Server Manager
Wants=network-online.target
After=syslog.target network.target nss-lookup.target network-online.target
[Service]
ExecStart=/dayz/dayz-server-manager
WorkingDirectory=/dayz/
LimitNOFILE=100000
KillMode=process
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s INT $MAINPID
User=dayz
Group=users
Restart=on-failure
RestartSec=5s
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
service dayz-server-manager enable
service dayz-server-manager start
service dayz-server-manager status
The manager is also published as a docker image:
ghcr.io/mr-guard/dayz-server-manager:latest
If you run the manager inside docker, the dayz server will also start in the same container.
If you stop the manager, the dayz server will stop as well.
How-To:
Create a directory for your server and make sure its accessible
mkdir /dayz
chmod 777 /dayz
Copy your server-manager.json
inside that dir
Copy the docker-compose.yml
from the repository to that dir.
Start the server manager:
docker compose up -d
You can run the image without compose, but you will need to figure that out on your own...
The server manager tries to automate every required installation step of the server.
However, the DayZ Server and the DayZ Workshop Mods cannot be installed without an account which owns (only for workshop mods) DayZ (the full game).
In order to login to your account, you have to provide your steam credentials in the configuration file.
This is only needed ONCE, since SteamCMD caches your session. (If the cache is invalidated, you will need to provide it again)
Your password will not be used for anything else. In fact, it is even hidden in the logs.
Still, it is recommended that you create an account which owns only DayZ.
If you are really paranoid about pasting your password somewhere, or you use steam guard:
-- server-manager.json
-- DayZServer // contains the server installation
----- profiles // contains the server logs (rpt, ADM, ...) and battleye folder
----- serverDZ.cfg // server name, password, player count, ...
----- .. // other files, workshop mods will also be linked to this folder
-- SteamCMD
----- steamcmd.exe
----- ..
-- Workshop // contains the actual workshop mods
-- STEAM_GUARD_CODE // Optional text file. Containing only your steam guard code. will be deleted after usage. See Known Issues / Limitations for more details.
-- SERVER_LOCK // Optional file. If exists server restarts will be skipped
You can, however, change these paths to fit your needs
The server manager is a self contained NodeJS-App written in TypeScript and packaged with pkg.
You DON'T need to install NodeJS or anything else.
Everything you need is contained in the single executable (exe).
However, due to that the exe is around 90MB in size.
This tool makes use of the windows commandline tools (namely netsh and wmic) or the linux cli tools and procfs to determine installation requirements and the state of the server.
It is recommended NOT to use an elevated user for running it.
The security model of the discord bot is based on the fact that discord gamer tags (name#number) ARE unique.
We do not need to know/check actual account ids.
If a user is able to post messages with a authorized gamer tag,
it means that the user is actually logged in to the authorized account.
The UI and API are secured by basic auth.
This should be "good enough" for this use case.
However, be advised that if the UI or API are served to the (public) internet,
the login info is not encrypted because the manager is served via HTTP.
To protect the UI and API from being intercepted/tampered with,
you should consider using a reverse proxy (such as nginx) with a valid SSL Certificate on the same server
(this might already be the case if you host a website).
This way the traffic is handled securely until terminated at the reverse proxy.
dayzOffline.ChernarusPlus
when validating the isntallation..dayzOffline.chernarusplus
and rename it to dayz.chernarusplus
(or something else)server-manager.json
- serverCfg
- Missions
- DayZ
- template
to dayz.chernarusplus
Process State:
since the dayz server is immediately detached after starting, we cannot determine the processid (PID) of it
because of this the manager queries all running processes via wmic and determines the server process by executable path
wmic can be a very CPU demanding tool and because of this the check interval should be a bit longer
a small sidenote: if server crashes with a popup, it is still detected as running. To prevent this windows error reporting must be disabled
To work on the server manager, the nodejs runtime (v14) must be installed and the node extensions must be compiled locally.
To do this, you will need a C++ compiler:
Windows:
choco install python python2 -y
choco install visualstudio2019buildtools -y
choco install visualstudio2019-workload-vctools -y
Linux:
apt-get install -y make python3 python2 build-essential
When the tools are installed, clone the repository and run npm ci
.
When everything is installed, you can start the manager by running:
CLI mode:
npm run start
Packed mode:
npm run startPacked
By using the software and/or thw source code you agree that the authors CAN NOT be held responsible for any damages caused by the software and/or the source code.