# How to Add Mods to a Don't Starve Together Server

Add Workshop mods to a Don't Starve Together dedicated server: ServerModSetup in dedicated_server_mods_setup.lua, then modoverrides.lua in Master and Caves.

Updated 2026-10-03. https://gamezservers.com/guides/how-to-add-mods-to-a-dont-starve-together-server

To add mods to a Don't Starve Together server, edit two files. Add `ServerModSetup("378160973")` for each Workshop ID to `mods/dedicated_server_mods_setup.lua` in the server install, which downloads the mod. Then enable it with `["workshop-378160973"] = { enabled = true }` in `modoverrides.lua` in **both** the `Master` and `Caves` shard folders of your cluster, and restart. Players download the mods automatically when they join. Game updates can reset the setup file, so check it after patches.

## What you are working with

| File | Job | Where it lives |
| --- | --- | --- |
| `dedicated_server_mods_setup.lua` | Downloads and updates Workshop mods on start | The server install's `mods` folder, next to `bin64` |
| `modoverrides.lua` | Turns mods on and holds their settings | Each shard folder: `Master/` and `Caves/` in your cluster |
| `cluster.ini` | Cluster settings, game mode, password | The cluster folder |
| Workshop ID | The mod's number | The end of its Steam Workshop address, after `?id=` |

Downloading a mod does not enable it, and enabling a mod that was never downloaded does nothing. A mod works only when it is in both files.

![A Don't Starve Together character in a horned helmet facing the giant Toadstool boss in a misty mushroom forest](https://gamezservers.com/games/dont-starve-together/shot-2.webp)

## Where the cluster folder is

| Setup | Cluster folder |
| --- | --- |
| Hosted from the game on Windows | `Documents\Klei\DoNotStarveTogether\<number>\Cluster_1\` |
| Self hosted dedicated server on Linux | `~/.klei/DoNotStarveTogether/<cluster name>/` |
| GamezServers | `DoNotStarveTogether/config/server/` |

Each cluster folder holds `cluster.ini` and the two shard folders, `Master` (the surface) and `Caves`.

## Before you start

- **Back up the cluster folder.** Some mods change the world permanently.
- **Check mods are marked for servers.** On the Workshop, server mods say "all clients require mod" or "server only". Client only mods (like minimaps or UI) are installed by each player and do not go on the server.
- **Stop the server** before editing the files.

## Step 1: Download the mods with dedicated_server_mods_setup.lua

Open `mods/dedicated_server_mods_setup.lua` in the server install folder. Add one line per mod, with the Workshop ID in quotes:

```
ServerModSetup("378160973")
ServerModSetup("375859599")
```

To add a whole Workshop collection, use its collection ID instead:

```
ServerModCollectionSetup("379114180")
```

Lines starting with `--` are comments and do nothing. The server downloads and updates everything listed here each time it starts.

## Step 2: Enable the mods in modoverrides.lua

Open (or create) `Master/modoverrides.lua` in your cluster folder:

```
return {
  ["workshop-378160973"] = { enabled = true },
  ["workshop-375859599"] = {
    enabled = true,
    configuration_options = {
      language = "english",
    },
  },
}
```

The key is `workshop-` followed by the ID. Each entry ends with a comma. One missing bracket or comma stops the server starting entirely, it does not just skip the mod.

## Step 3: Copy it to Caves

Copy the same `modoverrides.lua` into `Caves/`. Each shard reads its own copy, so a mod enabled only in `Master` does not run in the caves. That shows up as items that vanish or crash the shard when someone carries them underground. Keep the two files identical unless a mod's page says otherwise.

## Step 4: Restart and join

Start the server and watch both shards' logs for the mods downloading and loading. In **Browse Games**, tick the filter for modded servers if you cannot see yours. Players download the mods when they join.

## The easy way to get modoverrides.lua right

Mod settings are easy to get wrong by hand, because option names must match the mod's own `modinfo.lua` exactly, and a mistyped option fails silently. The game can write the file for you:

1. In the game, click **Host Game**, create a new world, and enable and configure the mods on the **Mods** tab.
2. Start the world once, then quit.
3. Open the new cluster folder in `Documents\Klei\DoNotStarveTogether\<number>\` and copy `Master/modoverrides.lua`.
4. Upload it to both `Master/` and `Caves/` on the server, and add the matching `ServerModSetup` lines.

## Game updates can wipe your mod list

This is the one that confuses server owners for days. `dedicated_server_mods_setup.lua` sits inside the game's install folder, so when the server updates or validates its files, the update can put back the original, empty file, as described on the [Klei forums](https://kleiforums.com/forums/topic/64464-dedicated_server_mods_setuplua-gets-overwritten-after-starting-dedicated-server/). The server starts without downloading anything. Mods that were already downloaded may keep working until they need an update, then players get "Disconnected due to missing mods" when the Workshop version moves on.

`modoverrides.lua` lives in your cluster folder and is never touched by updates, which is why it all looks correct.

- Keep a copy of your `dedicated_server_mods_setup.lua` somewhere outside the install folder.
- After every game update, open it and check your `ServerModSetup` lines are still there.
- Restart regularly, because mods only update when the server starts.

## Common problems

- **Mod not loading at all:** it is in only one of the two files. It needs a `ServerModSetup` line and an `enabled = true` entry.
- **Works on the surface, breaks in caves:** the mod is enabled in `Master/modoverrides.lua` but not in `Caves/`.
- **Server will not start after editing:** a syntax error in `modoverrides.lua`, usually a missing comma or bracket.
- **Mod settings ignored:** an option name does not match the mod's `modinfo.lua`. Use the in game method above.
- **"Disconnected due to missing mods":** the server has an old version or lost its setup file. Check the file and restart so mods update.

## Mods on GamezServers

On a [GamezServers Don't Starve Together server](https://gamezservers.com/games/dont-starve-together), the surface and caves run together, so you edit `mods/dedicated_server_mods_setup.lua` and the two `modoverrides.lua` files in `DoNotStarveTogether/config/server/Master` and `Caves` right in the **Files** tab, or over the SFTP login in **Settings**. Press **Backup** before adding mods, then restart. For the cave setup itself, see [how to set up a Don't Starve Together server with caves](https://gamezservers.com/guides/how-to-set-up-a-dont-starve-together-server-with-caves).

## FAQ

### Where does dedicated_server_mods_setup.lua go?

In the `mods` folder of the server install, next to `bin64`. It is part of the game files, not your cluster folder.

### Do I need modoverrides.lua in both Master and Caves?

Yes. Each shard reads its own copy, so copy the same file into both folders.

### Do players need to download the mods?

They download automatically when players join. Client only mods are the exception, which players install themselves.

### Why did my Don't Starve Together mods stop working after an update?

The update likely reset `dedicated_server_mods_setup.lua` to the empty default. Add your `ServerModSetup` lines back and restart.
