# Running a Factorio server with Factorio Server Manager and Docker

> One container, one compose file, and a web UI for mods, saves, and restarts. No SSH required to feed the factory.

- date: 2026-08-30
- tags: factorio, docker, compose

The Factorio server at `factorio.wihan.dev` is one container and one
compose file. Factorio Server Manager runs inside it: a web UI that
downloads the headless server, manages saves and mods, and starts and
stops the game process. Server administration is a browser tab.

Credit where it is due:
[Factorio Server Manager is Tricade's work](https://github.com/Tricade/factorio-server-manager),
carrying on the
[OpenFactorioServerManager](https://github.com/OpenFactorioServerManager/factorio-server-manager)
project. Everything pleasant about running this server - the mod
portal login, the save management, the graceful shutdown - is their
code. Star the repo if you run a factory.

```yaml
services:
  manager:
    image: ghcr.io/tricade/factorio-server-manager:0.17.5
    restart: unless-stopped
    stop_grace_period: 3m
    environment:
      FACTORIO_VERSION: stable
      FSM_COOKIE_SECURE: "true"
    ports:
      - "34197:34197/udp"
    volumes:
      - fsm-data:/opt/fsm-data
      - factorio-data:/opt/factorio
```

The details that took a moment to get right:

- **`stop_grace_period: 3m`.** On SIGTERM the manager asks Factorio
  for a clean save-and-stop and needs up to 165 seconds. The Docker
  default of 10 seconds kills the game mid-save, which is how maps
  die.
- **UDP bypasses the proxy.** The UI rides Traefik over HTTPS, but
  game traffic is UDP on 34197 and Traefik cannot route it. Docker
  publishes the port straight on the host, and the DNS record must be
  a DNS-only A record. A CNAME to a proxied hostname resolves to the
  Cloudflare edge, which accepts your packets and tells no one.
- **Named volumes.** `factorio-data` holds the game and saves,
  `fsm-data` holds the manager state. Explicit names keep the compose
  project prefix out, so a backup job can address them directly.
- **The first login.** The manager generates an admin credential on
  first start and writes it to
  `/opt/fsm-data/initial-admin-password.txt` inside the volume. Log
  in, change the password, and the file deletes itself. Until you do,
  the bootstrap credential is lying around; do it first.

Version pinning matters twice here. The manager image is pinned to an
exact release tag, and the Factorio version is pinned by the UI after
install, because the server version must match the players' clients.
`stable` is only the first-install default.

Mods, save uploads, and restarts all happen in the UI afterwards. The
compose file changes only when the manager itself gets an upgrade,
which is exactly how often I want to think about it.