Skip to main content

Start and control a Don't Starve Together server process.

Project description

Don't Starve Together Dedicated Server Image

Steam Discord

English | 简体中文

Steam store header

Container image: quay.io/wh2099/dst-server

The image runs every shard in one DST cluster and keeps the familiar console FIFO. It can also export validated game events through OpenTelemetry.

Quick Start

  1. Install a container runtime such as Podman.

  2. Create and download a dedicated-server configuration from Klei's server management page.

  3. Extract the archive on the host.

    The directory mounted at /cluster must directly contain cluster.ini, cluster_token.txt, and the shard directories:

    Cluster_1/
    ├── cluster.ini
    ├── cluster_token.txt
    ├── Master/
    │   └── server.ini
    └── Caves/
        └── server.ini
    
  4. Start the container, replacing the host path with the extracted cluster directory:

    sudo podman run \
      --name dst \
      --detach \
      --network host \
      --volume "${HOME}/Cluster_1:/cluster" \
      quay.io/wh2099/dst-server:latest
    

Operations

podman logs dst
podman stop dst
podman start dst
podman restart dst

Stopping the container terminates every shard gracefully, and DST saves during shutdown.

The entrypoint creates a named console pipe for the master shard at the cluster root. Each secondary shard receives one in its own directory:

echo 'c_announce("Server maintenance is coming.")' > "${HOME}/Cluster_1/console"
echo 'c_save()' > "${HOME}/Cluster_1/Caves/console"

Common lifecycle commands include c_reset(), c_regenerateworld(), c_save(), and c_shutdown(false). Use c_announce("...") to send a message and c_listallplayers() to inspect players.

What the Entrypoint Does

On startup, entrypoint.py validates the cluster and prepares permission and Mod files. It updates Workshop content once, discovers every shard, and starts one Server per shard in -cloudserver mode.

DST_SKIP_MOD_UPDATE=1 skips the one-shot Workshop update.

DST_INSTALL_PATH and DST_CLUSTER_PATH override /install and /cluster for development and tests.

An OTEL_EXPORTER_OTLP_*_ENDPOINT variable enables the official OpenTelemetry pipeline. The entrypoint then exports validated game events.

Python SDK

The dst-server package starts and controls one Linux DST shard process.

import asyncio

from dst_server import Server, ServerArgs


async def main() -> None:
    async with Server(ServerArgs(shard="Master")) as server:
        world = await server.game.world.state()
        players = await server.game.players.list()
        await server.game.world.announce(
            f"Day {world.day}: {len(players)} player(s) online"
        )
        await server.save()


asyncio.run(main())

The typed API covers world and player queries, inventory, administration, confirmed saves, and raw Lua. It also exposes lifecycle and game events.

Install dst-server[otel] for OTLP export or dst-server[klei] for Klei build and lobby services.

Lua Annotations

The dst-annotations command generates LSP-compatible Lua definitions from DST components or modutil.lua.

dst-annotations dst-scripts/scripts/components --output components_def.lua
dst-annotations dst-scripts/scripts/modutil.lua --output modutil_def.lua

Documentation

Game server reference:

Technical design:

Source reference:

The detailed documentation is maintained in Simplified Chinese.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dst_server-0.1.0.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dst_server-0.1.0-py3-none-any.whl (65.7 kB view details)

Uploaded Python 3

File details

Details for the file dst_server-0.1.0.tar.gz.

File metadata

  • Download URL: dst_server-0.1.0.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dst_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab5064b48d2ac2e460d9cdeb773b9336871629b245b48878e0aa135c2b6411b8
MD5 f3ff3e80858c8e701d0b441918f9c792
BLAKE2b-256 038850ae78bdcfd4b53ab96a6f7bd81decce5877d9224194d2d582476be9a488

See more details on using hashes here.

Provenance

The following attestation bundles were made for dst_server-0.1.0.tar.gz:

Publisher: release.yml on LetsStarveTogether/dst-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dst_server-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dst_server-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 65.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for dst_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5cf0fe63c115057ea66b9dd1361b60bafde9b786c9c36d86da702688d51b595
MD5 c221825a1da5c570773c1417e1f158f9
BLAKE2b-256 a22afd83ffa18093e36762a8098f105462405a5d77872c19503418930b06360f

See more details on using hashes here.

Provenance

The following attestation bundles were made for dst_server-0.1.0-py3-none-any.whl:

Publisher: release.yml on LetsStarveTogether/dst-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page