Learn

Mods and dedicated server

How to install mods and put a Don't Starve Together server online.

Installing mods

Mods are downloaded from the Steam Workshop. Subscribe to the ones you want, then enable them in the Mods menu before creating the world.

  • Client mods: only change the interface for whoever uses them
  • Server mods: change the game and apply to every player
  • Check for updates after every game patch

Dedicated server: what you need

  • An always-on computer or VPS with a good connection
  • SteamCMD to download the server files
  • A server token from your Klei account

Main steps

  1. Install SteamCMD and download the server (app 343050)
  2. Create a folder for your cluster and put the token in cluster_token.txt
  3. Set name, mode and password in cluster.ini
  4. Create the world folders (Master and, optionally, Caves) with their server.ini
  5. Start each world with the server command, specifying cluster and shard
./dontstarve_dedicated_server_nullrenderer_x64 -console -cluster MioCluster -shard Master

Mods on the server

Add mods to dedicated_server_mods_setup.lua with ServerModSetup (the number only), then enable them in modoverrides.lua for each world, using the workshop- prefix.

ServerModSetup("MOD_ID")   -- dedicated_server_mods_setup.lua: the number only
["workshop-MOD_ID"] = { enabled = true },   -- modoverrides.lua: with the workshop- prefix

With Docker, ready to use

If you don't want to install anything by hand, the package below starts the server with a single command: it downloads the game with SteamCMD, creates the forest and the caves and keeps the world in a volume. It works on any Linux machine with Docker, including a VPS.

dst-server-en.zip Dockerfile, entrypoint.sh, docker-compose.yml and .env.example

  1. Unzip the package and enter the dst-server folder
  2. Copy .env.example to .env and paste the server token (from your Klei account, Game Servers section)
  3. Start with docker compose up -d --build
  4. Follow the logs with docker compose logs -f: the first start downloads the game (a few GB)
  5. Open UDP ports 10999 and 10998 in your firewall or router, then search for the server by name in the Don't Starve Together list

The docker-compose.yml file

The compose file is ready: you don't need to change it for a first server.

# Ready-to-use Don't Starve Together dedicated server.
#   1) copy .env.example to .env and enter your token
#   2) docker compose up -d --build
#   3) docker compose logs -f
services:
  dst:
    build: .
    platform: linux/amd64   # the server only exists for x86_64 (on Apple Silicon Macs it runs emulated, slower)
    image: dst-server:latest
    container_name: dst-server
    restart: unless-stopped
    env_file: .env
    ports:
      - "10999:10999/udp"   # main world (Forest)
      - "10998:10998/udp"   # caves
    volumes:
      - dst-game:/game      # server files (they update themselves on start)
      - dst-data:/data      # saves and configuration: your world lives here
    stop_grace_period: 90s  # time to save the world before shutting down
    stdin_open: true
    tty: true

volumes:
  dst-game:
  dst-data:

The .env file

This is where you choose name, mode, password and mods. After any change run docker compose up -d to apply it.

# Required: server token from your Klei account ("Game Servers" section)
CLUSTER_TOKEN=

CLUSTER_NAME=Don't Starve Italia - test server
CLUSTER_DESCRIPTION=Welcome, survivors!
# Leave empty for a server without a password
CLUSTER_PASSWORD=
# survival, endless or wilderness
GAME_MODE=survival
MAX_PLAYERS=6
PVP=false
# true = forest + caves (two worlds), false = forest only
ENABLE_CAVES=true
# Workshop mod IDs, comma-separated (optional). Example: 350811795,378160973
MODS=

Mods, updates and backups with Docker

  • Mods: put the Workshop IDs in MODS, separated by commas; the server downloads them on start
  • Updates: docker compose restart restarts the server and updates the game
  • Stop: docker compose down. The world stays in the dst-data volume and resumes where you left off
  • Backup: docker run --rm -v dst-server_dst-data:/data -v "$PWD":/backup ubuntu tar czf /backup/dst-backup.tgz /data
  • On a Mac with an Apple chip the server runs emulated and more slowly: use an x86_64 Linux machine to actually play

Worth remembering

Each world on the same machine uses a different port, and ports must be opened in your router or firewall. File and command names can change with updates: always check Klei's official guide before proceeding.