Dont starve together dedicated server failed to start

  • overview
  • issues

DST dedicated server failed to start

open

Hi. I have an issue whenewer i start the server as a host (no matter which instance) with caves enabled, i recieve this message: dedicated server failed to start

Dont starve together dedicated server failed to start
It all beginned when i open DST via steam and apparently it is changed something. I was played 360+ days before this with caves enabled and never encounter such issue. Steam version is run dedicated server with caves without a trouble, though i tryd all troubleshooting guides dedicated to the steam version such as: firewall settings, antivirus, folder properties etc. with no results. So, any help? I cannot waste my save 360+days file, my gf who play with me is gonna kill me.

13 Jun 2021

Reading time ~3 minutes

This post is a memo for the problems I encountered during setting up a dedicated server for Don’t Starve Together.

What is my setup for the dedicated server?

I used Amazon AWS services. It is a cloud service and a pay-as-you-use service. Specifically, I chose the t3.xlarge instance running the latest version of Ubuntu. I have tried the free tier instance but that seems not to have enough RAM.

You should also choose the physical location of your server, preferably closest to your physical location. This will affect your connection lag.

How to set up the dedicated server?

There is a detailed tutorial on how to set up dedicated servers on Linux here. You can also find related tutorials here, for example, setting up servers for other operating systems.

What is my username on the AWS server?

Before you try to do anything on the server, you need to connect to the server and you need a username. Where to find this username? It is usually just a default username based on your selected distribution, for example, ubuntu for Ubuntu. See details here.

What is admin on the dedicated server?

At certain point in the tutorial, you will see the steps to add admin. This is to enable you to act like the owner of the world when playing games, so that you can do things like stop the servers, revert days, and spawn items with c_spawn.

You can definitely location your ID as it is mentioned in the tutorial. Or you can go here. Under USER INFO and Klei User ID, you will a string of characters like KU_***. That is your ID to use when adding an admin. You might need to login first.

How to avoid world reset after server restart?

The problem is I don’t want to leave the server running all the time because it is pay-as-you-use. I want to only run the server when I play the game and stop the server when I’m done. The way to stop the server mentioned in the tutorial does not quite work because I lose my world! So I need a way to make the world persistent after server reboot.

You would want to shut down your world when you are in the game. Press ` (backtick) on your keyboard to bring up a prompt and then you enter c_shutdown(). You wait for a while and you will receive a message of connection loss.

At this point, you are safe to stop your server and the world is properly saved.

How to add mods?

Follow this tutorial to install mods on servers. There is a lot information and tutorials. Make sure you are reading the correct one for dedicated servers.

There is one caveat: this file ~/server_dst/mods/dedicated_server_mods_setup.lua will be reset every time you update the server using the update.sh created during this tutorial. So I back up my .lua file and added the following line after sleep 10:

cp ~/dedicated_server_mods_setup_backup.lua ~/server_dst/mods/dedicated_server_mods_setup.lua

~/dedicated_server_mods_setup_backup.lua is basically just a backup. The update process won’t affect your modoverrides.lua under ~/.klei/DoNotStarveTogether/MyDediServer/Master and ~/.klei/DoNotStarveTogether/MyDediServer/Caves.

How to move the AWS server to a different location?

[To be continued]

How to move the world to a different device?

[To be continued]

Still have questions?

Please leave a comment. Thank you!

Don't Starve Together Dedicated Server Docker Image

They write their server setup instructions like sh*t, so we made this Docker image to simplify things.

Please read the whole document before putting your hands on your server.


Versioning

The DST server code changes a lot. We offer multiple variants (tags) on Docker Hub:

  • latest or vanilla are less frequently updated images, recommended for day-to-day use
  • nightly is a nightly built image, so it (hopefully) comes with the latest server code
  • steamcmd-rebase works the same way as latest but is based on cm2network/steamcmd:root

All variants except nightly also have a -slim tagged version which does not come with DST server pre-installed; required files will be downloaded every time the container is launched. The -slim versions cannot be launched offline.

Running

Prerequisites

  • Linux x86_64 and runs Docker (18.05.0-ce or later).
  • You may need a public IP to make your server accessable from Internet.
  • You need 4 UDP ports exposed to the public network. (See FAQ for details.)
  • CPU: 1 core is somewhat enough for a small-scale server (but don't try 60 ticks, start from 15 or 30).
  • Memory: We recommend reserving 1GiB Memory for the server, plus 60MiB per active user.
  • Disk size: the Docker image takes 1.5GiB, and you need at least another 5MiB for maps, configs and logs. 4GiB available disk space is recommended.

Start server

Let's assume you are saving your server config and status to ${HOME}/.klei/DoNotStarveTogether. (This is the default location when it is running outside Docker, so we'll use this as an example. If you want to save it to other location, just mount that directory read-write to the /data folder of the container.)

Start server:

docker run -v ${HOME}/.klei/DoNotStarveTogether:/data -p 10999-11000:10999-11000/udp -p 12346-12347:12346-12347/udp -e "DST_SERVER_ARCH=amd64" -it jamesits/dst-server:latest

If you use docker-compose, an example config is provided.

Stop server

Just press Ctrl+C and wait a little while to let itself spin down. (If the server is saving data, don't press ^C twice to force kill the server.)

To programmatically shut down the server, send a SIGINT to the supervisord process.

Note: the server may take up to ~5min to save map and fully shut down.

Server Configuration

If you don't already have a set of server config in your data directory, we will generate one for you. Start server once using the command above, and you will see:

Creating default server config...
Please fill in `DoNotStarveTogether/Cluster_1/cluster_token.txt` with your cluster token and restart server!

To generate a cluster token (as of 2019-11-02):

  1. Open a genuine copy of Don't Starve Together client and log in
  2. Click "Play" to go to the main menu
  3. click "account" button on the bottom left of the main menu
  4. In the popup browser, click "GAMES" on the top nav bar
  5. Click "Don't Starve Toegther Servers" button on the top right
  6. Scroll down to "ADD NEW SERVER" section, fill in a server name (it is not important), and copy the generated token

The token looks like pds-g^aaaaaaaaa-q^jaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=. Then either set DST_CLUSTER_TOKEN environment variable during docker run, or paste the token into your_data_directory/DoNotStarveTogether/Cluster_1/cluster_token.txt.

If you need to add mods, change world generation config, etc., please do it now. Don't forget to edit your_data_directory/DoNotStarveTogether/Cluster_1/cluster.ini and get your server an unique name!

After you finish this, re-run start server command, and the server should be running.

Build Docker image locally

(In most cases you don't need this; just pull the prebuilt image from Docker Hub.)

git clone https://github.com/Jamesits/docker-dst-server.git docker-dst-server
cd docker-dst-server
docker build . -t dst-server:latest

There are some arguments you can set via --build-arg:

  • BASE_IMAGE: the FROM image (recent Debian or Ubuntu based images are supported)
  • STEAMCMD_PATH: where is steamcmd.sh in the base image
  • DST_DOWNLOAD: set to 1 to embed DST server into the image
  • DST_USER: the user to run server as (inside container)
  • DST_GROUP: the group to run server as (inside container)

Known Issues

  • On Docker environment which doesn't support UDP port forwarding, LAN only server cannot be used. (Still you can enable Steam punchthrough and search for your server in Online catalog. )
  • Docker IPv6 support is another sh*t and we currently don't have any idea on it. Help and advices are always welcomed. (see #7.)

FAQ

How to update server or mods?

Restart the server. Updates will be downloaded automatically.

How to connect to a LAN only server?

Run c_connect("IP address", port) or c_connect("IP address", port, "password") in client console.

How to check if the server is online?

You can try the 3rd party website Don't Starve Together Server List.

What port does this server require?

You need to expose UDP 10999 (master) and 11000 (caves) for client to connect; udp 12346 and 12347 for steam connection. Don't NAT these ports to different port numbers.

The server use another 2 high UDP ports for unknown communication, and UDP 10998 (listen on localhost) for communication between cluster servers.

Here is a netstat -tulpn output on our test server:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
udp        0      0 0.0.0.0:12346           0.0.0.0:*                           54/./dontstarve_ded 
udp        0      0 0.0.0.0:12347           0.0.0.0:*                           53/./dontstarve_ded 
udp        0      0 0.0.0.0:38223           0.0.0.0:*                           53/./dontstarve_ded 
udp        0      0 0.0.0.0:36517           0.0.0.0:*                           54/./dontstarve_ded 
udp        0      0 127.0.0.1:10998         0.0.0.0:*                           54/./dontstarve_ded 
udp        0      0 0.0.0.0:10999           0.0.0.0:*                           54/./dontstarve_ded 
udp        0      0 0.0.0.0:11000           0.0.0.0:*                           53/./dontstarve_ded 

Error! App '343050' state is 0x202 after update job.

Your disk is full.

Error! App '343050' state is 0x602 after update job.

Usually there is a file system permission issue preventing steamcmd from writing to your game installation directory.

Client high latency or lagging

Possible causes:

  • High packet drop rate
  • High server tick rate with low-performance clients (e.g. notebook users with tick rate 60)

How can I copy local data to server?

Local data is stored in <User Documents>\Klei\DoNotStarveTogether\<Random Number>.

There are two situations:

  1. Local data has cave enabled.
    Just copy the Cluster_X to server and rename to Cluster_1, then it should work.
  2. Local data has no cave.
    Copy everything in client_save except session and Cluster_X/save/session to server Cluster_1/save.
    If your local data is not in slot 1, you also have to modify saveindex because the server recognize only the first slot.
    The server will create a cave for you. If you don't want the cave, you have to modify supervisor.conf to disable cave server.

How can I enable mods after copy local data to server?

Open Cluster_X/Master/modoverrides.lua and you will see something like workshop-XXXXX where XXXXX is a number.
Open Cluster_1/mods/dedicated_server_mods_setup.lua on server and write ServerModSetup("XXXXX").

Maintainer

  • James Swineson

Thanks

  • Mingye Wang
  • @MephistoMMM
  • @m13253
  • @wph95
  • DaoCloud
  • CodeVS
  • I Choose Death Too

License

Don't Starve Together Dedicated Server Docker Image
Copyright (C) 2015-2018 James Swineson (Jamesits) and Mingye Wang (Arthur2e5)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

References

  • How to setup dedicated server with cave on Linux
  • How to install,configure and update mods on Dedicated Server
  • SteamCMD

Does don't starve together have dedicated servers?

Don't Starve Together - Dedicated Server Client Now Available - Steam News.

How do you join a don't starve server on PC?

Joining Via Server List.
Open Don't Starve Together..
Click Browse Games..
Enter your Server Name into the search field. You can find our article on how to find your Server Name here..
Select the server then click the Join button..
(Optional) Enter your server password if you have set one..

How do I join a local server on don't starve together?

How to join a multiplayer server in Don't Starve Together.
Play Online..
Choose any server..
Click Join Game..
Choose a character..