Setting up a Dedicated Server in Linux :: Core Keeper General Discussions

Thank you to the Core Keeper team for making the Dedicated Server available! So excited to see where this game goes, and looking forward to the June update!

I’m assuming there will be a more official tutorial at some point. I found bits and pieces on this community forum as well as discord to get a server up and running, but there were a few issues (as expected with linux. lol)

I recommend that you have some experience with linux before trying to set up a vps server, but if you understand some of the basics, it isn’t too bad. There are also some docker tutorials if you are familiar with that.

I went with a VPS that lists a Ryzen 9 5959x, an SSD, and 4GB ram. I will assume that the single dedicated core and 4gb of ram won’t be enough with many players, but it can be upgraded. I’ll post again after some testing, but assume this would allow 5-10 players.

I did try CentOS and Debian, but found Ubuntu 20.04 worked without some of the issues on the other distros.

Here are some of the tutorials I used. I don’t take credit for all of these commands and will link to pages I referenced. I’m sure there is more that could be done, and every detail I used step by step isn’t included, so feel free to reply if you have questions or come across other issues.

Setting up SSH keys is always a good idea and creating a sudo user. IP Tables are also a good idea. Secure your server whatever methods you find best.

There’s a guide from Steam https://developer.valvesoftware.com/wiki/SteamCMD but I found this guide to be quite useful: https://www.linode.com/docs/guides/install-steamcmd-for-a-steam-game-server/ (I don’t use their service and am not affiliated with them, but what a great tutorial!)

If “sudo add-apt-repository multiverse” fails, you can install add-apt-repository using:
sudo apt update
sudo apt install software-properties-common

I looked up the steam ID, but after installing found they provided this info. in the README.txt as well:

“…You can use SteamCMD to download the server files without requiring a login:
steamcmd +login anonymous +app_update 1007 +app_update 1963720 +quit
…”

After my setup, there was a hidden .steam directory created in the home folder. This is where you will find ~/.steam/steamcmd/corekeeper (maybe only if you force named the install directory?). This is where the _launch.sh script, log file, readme, etc. are.

The README.txt was very useful and includes information for the ServerConfig.json:

“…-world 0 Which world index to use.
-worldname “Core Keeper Server” The name to use for the server.
-worldseed 0 The seed to use for a new world. Set to 0 to generate random seed.
-gameid “” Game ID to use for the server. Need to be at least 23 characters and alphanumeric, excluding Y,y,x,0,O. Empty or not valid means a new ID will be generated at start.
-datapath “” Save file location. If not set it defaults to a subfolder named “DedicatedServer” at the default Core Keeper save location.
-maxplayers 100 Maximum number of players that will be allowed to connect to server.
…”

The ServerConfig.json file was in ~/.config/unity3d/Pugstorm/Core Keeper/DedicatedServer

_launch.sh is the script provided by Core Keeper and once you run it, the “CoreKeeperServerLog.txt” file will show any issues.

One error I had was “steamclient.so: wrong ELF class: ELFCLASS32” in the CoreKeeperServerLog.txt file

Someone thankfully also had this issue with a different steam game and resolved it by creating a directory and copying the steamclient.so file over. There is probably a better solution and could be related to how I installed the 32bit files as in the tutorial:

“…Howdy, just ran into this issue tonight.
I took a wild guess that it was looking for this file: /.steam/steamcmd/linux64/steamclient.so
Made the /.steam/sdk64 directory and copied that file to it.
It worked. 👍🏻…” -https://github.com/SmartlyDressedGames/Unturned-3.x-Community/issues/2305

Once the server is running properly, I installed screen and used it to keep the server running. I may set up an easy script and control panel for other players to help restart the server if needed, but so far, the server seems stable.

There are backup files and some info. about this on Discord. Not sure how often they are created, and there was some indication that backups don’t always happen. I’m sure that the Dedicated Server will receive updates and more features later on.

Enjoy!

Update:

Because Core Keeper seems to crash somewhat regularly (every day or two it seems), I set the dedicated server up as a service rather than using screen. This method may not be ideal, as you can also create service files in the user directory, and if the server has issues starting it could keep trying to restart, but so far it has been working great for us. If the server crashes, it starts right back up.

In /etc/systemd/system create a file for your service. In my case, I created “corekeeper.service” as the file name and the contents are below. I used “steam” as the user and group in this example, but replace those with whatever user/group you run the server as…and don’t use root. Make sure that user has sudoers permissions.

You also need to specify the directories for your install, so check the path to where your _launch.sh file is. I also added an output file just to see what it outputs. It will list when the server starts up the server name, and could be useful if your server is crashing on startup.

[Unit]
Description=Core Keeper Service
After=network.target

[Service]
Type=simple
# Another Type: forking
User=steam
# Omit user/group if creating user service file
Group=steam
WorkingDirectory=/home/steam/corekeeper
StandardOutput=file:/home/steam/corekeeper/servicelog.txt
ExecStart=/bin/bash /home/steam/corekeeper/_launch.sh
Restart=always
# Other restart options: always, on-abort, etc

# The install section is needed to use
# `systemctl enable` to start on boot
# For a user service that you want to enable
# and start automatically, use `default.target`
# For system level services, use `multi-user.target`
[Install]
WantedBy=default.target

Then, run: systemctl daemon-reload

This reloads the configurations of the service files.

To have the service run at startup (if the linux server reboots): systemctl enable corekeeper.service

Next, start the service: systemctl start corekeeper.service

I used Restart=Always because it didn’t seem to restart otherwise. You could let it crash a few times and get exit codes perhaps to specify them, but this will just restart for pretty much any reason…which is why it also could just keep trying to restart and cause issues if the core keeper server isn’t starting correctly. That’s where some of the options below can help.

You can also look at adding these options to the Unit section, but read up on what they do:

RestartSec=1
StartLimitBurst=5
StartLimitIntervalSec=10

More documentation: https://www.freedesktop.org/software/systemd/man/systemd.unit.html

https://steamcommunity.com/app/1621690/discussions/0/3275817873363439916/

Related Posts