Don't Starve Together Server

This repository provides a CLI to build and manage a Don't Starve Together server based on docker-dontstarvetogether container.

💻 Project

CLI

CLI

🚀 Technologies

This project was developed with the following technologies:

Python Python3.7+

Docker Docker

Docker-compose Docker Compose

🏃 Usage

Before installing you need to configure your world

Setting World

First thing you need to get is your server TOKEN, just follow the steps below:

Open DST, and click Account on the initial menu Klei page

A klei page will open, then click on games Klei account

Click on Game Servers Klei game servers

This page will show all your servers, to add a new one just click on ADD NEW SERVER Klei add new server

A text input field will appear, put any name you want to identify your server, in this case I choose NAME OF MY CLUSTER, then click on ADD NEW SERVER Klei adding new

Your server will be added and now you get access to your TOKEN Klei new server added

Clone this repository with:

$ git clone https://github.com/douglasJovenil/dst-server

Open the files underworld and overworld, and paste your TOKEN on both files, as follows:

Saving token on overworld

Saving token on underworld

Besides that you can change other fields, like:

  • NAME: this is the name that will appear on the server list inside the DST
  • DESCRIPTION: your server's description
  • GAME_MODE: can be survival, wilderness or endless
  • PAUSE_WHEN_EMPTY: when set to true the world will stop if there's no one on server. You can set it to false if you like to let days running.
  • INTENTION: can be social, cooperative, competitive or madness

Leave the rest of the fields with the default values. To add more configurations check out this documentation page for the available options.

Now you have to configure the options of your world, the easiest wat to do it is create a local world as you like:

Setup world

Then open the data files of this world:

Open data

Navigate to WOLRD_ID/Cluster_1/Master and find leveldataoverride.lua, this file contain all configuration of your overworld, just open it, copy all content and past it on docker-compose.yml, just have shore to put it on field LEVELDATA_OVERRIDES relative to overworld.

Setup overworld

You have to do the same thing to underworld, so navigate to WOLRD_ID/Cluster_1/Caves and do the same process:

Setup underworld

With all done, you can jump to Installing CLI and Building Server if you want a vanilla server.

Adding mods

First you have to find your mod on the Don't Starve Together workshop, just open the link and choose a mod, in this case i will install Simple Health Bar. Put the mod name on the search box and once the mod appears just click it:

Search mod

We will need the mod id, you can find it at URL of your browser

Find mod id

With the mod id copied open the file modoverrides.lua and paste it as follows:

return {
	['workshop-MOD_ID_THAT_YOU_COPIED'] = { enabled=true },
}

Add mod

Open the file docker-compose.yml and put all mods that you have installed on the field MODS, you need to set this field to both overworld and underworld sections

Add mod docker compose overworld

Add mod docker compose underworld

You can have as many mods you want.

Setting up a mod

If you want to tweak some configuration on your mod, follow this simple guide:

Open DST on Steam and click on button workshop Open workshop on Steam

Serach the mod that yout want to configure and open it Search and open mod on Steam

Click on Subscribe Subscribe to mod

Right click and then Copy Page URL Copy page URL

Open any text editor and paste the URL and identify the mod id Paste URL and get ID

Now you will have to find this mod on your computer, normally they are installed on STEAM_FOLDER/steamapps/common/Don't Starve Together/mods, just open the folder with the ID that you identified on previous step Find folder

Open the file modinfo.lua Open modinfo

This file have all mod options, just search for what you want to modify and put your modifications on the file modoverrides.lua Modinfo

Installing CLI and Building Server

$ sudo add-apt-repository ppa:deadsnakes/ppa -y
$ sudo apt-get update -y
$ sudo apt-get install python3.8 -y
$ cd dst-server/src
$ sudo python3.8 main.py --install
$ exec bash

Running Server

$ dst --start

CLI Options

  • install: installs all dependencias and configure the server
  • start: starts the container
  • stop: stops the container
  • delete: deletes the server (tip: make a backup before using this option)
  • overworld: opens a bash shell on overworld container
  • underworld: opens a bash shell on underworld container
  • containers: shows a list of all running containers
  • images: shows a list of all images installed