JoinGG

Running a Factorio headless server

The headless build, server-settings.json, admins and whitelists, UDP 34197, mod sync and Space Age, a systemd unit, and updating without losing the map.

SweetMask · 4 min read
./bin/x64/factorio --start-server ./saves/colony.zip --server-settings ./data/server-settings.json

That line, run from the folder the headless package unpacks into, is a Factorio server: the same game without its graphics, hosting one save and reading its settings from a JSON file. It listens on UDP port 34197. Everything else is looking after the save and the settings file, and keeping every player on exactly the version and mods the server runs.

The headless build and a first save

Wube offers a free headless package for Linux, without graphics or sound, and the stable build is one download away:

curl -L -o factorio-headless.tar.xz https://factorio.com/get-download/stable/headless/linux64
tar -xJf factorio-headless.tar.xz -C /opt

On Windows, the normal game package runs headless with the same flags. At the end of September 2026 the stable branch is 2.0.77 and 2.1 is still experimental. A public server belongs on stable, which is what players have unless they opt in. The Factorio wiki also asks that the server run as its own user rather than root, one of the Linux basics worth settling before anything else.

The server will not start without a save. Create one with --create ./saves/colony.zip, adding --map-gen-settings and --map-settings files if you want something other than the defaults; examples of both ship in data/. To host a map you already play, copy its zip into saves/. If that map uses mods, --sync-mods ./saves/colony.zip sets the server's mods to match the save, provided service-username and service-token are set in the server's player-data.json so it can download them.

server-settings.json

Copy data/server-settings.example.json and edit the copy. The keys worth reading closely:

  • visibility: public lists the game on Factorio's public server list and lan announces it on the local network. Public needs a factorio.com username plus a token (or password). Use the token, from your factorio.com profile or player-data.json, because the file is stored as plain text.
  • game_password for a private server, and require_user_verification, true by default, which admits only players with a valid factorio.com account.
  • autosave_interval in minutes (10 by default) and autosave_slots (5), which the server cycles through. Leave non_blocking_saving off; the example file calls it highly experimental.
  • afk_autokick_interval in minutes, with 0 meaning never.
  • auto_pause, on by default, which stops the map while nobody is connected.
  • max_upload_in_kilobytes_per_second (0 is unlimited) and max_upload_slots (5). Joining players download the whole map from the server, and on a home connection these stop that from swamping it.

Admins, the whitelist and the port

Admins are listed by name in server-adminlist.json, a plain JSON list such as ["alice", "bob"], which the wiki's multiplayer page puts in the same folder as factorio-current.log. Promoting someone with /promote in game writes the file for you. The whitelist works on names too: start with --use-server-whitelist=true --server-whitelist ./server-whitelist.json, or manage it in game with /whitelist add. An empty whitelist lets everyone in. Choosing who goes on it is the harder part, and running a whitelist people actually apply to deals with that.

Factorio uses UDP only, on 34197 unless you pass --port. Forward that port and open it in the firewall, as for any port-forwarded game server. The wiki flags a less obvious trap as well: some routers rewrite the source port on packets leaving 34197, and connections fail until that is turned off.

Mods and Space Age

Mods are zip files dropped, still zipped, into the mods folder, with mod-list.json beside them recording which are enabled. Players do not have to hunt for them. When someone joins a modded server, the game offers to sync and downloads the exact mod versions the server runs, and it can sync the mods' startup settings as well; installing Factorio and joining a server walks a new player through it.

Space Age is the exception. The expansion, released on 21 October 2024, arrives as built-in mods (space-age, quality and elevated-rails, plus a separate recycler mod from 2.1), switched on or off in mod-list.json like any other. A player joining a server with them enabled needs to own the expansion, and so does anyone joining a server whose third-party mods turn on expansion features, which the modding API documents as requiring ownership of Space Age. A server meant for everyone runs with all of them off. Keeping versions pinned on a modded server is its own discipline, covered in modpacks and version pinning.

Under systemd

[Unit]
Description=Factorio server
After=network-online.target
Wants=network-online.target

[Service]
User=factorio
WorkingDirectory=/opt/factorio
ExecStart=/opt/factorio/bin/x64/factorio --start-server-load-latest --server-settings /opt/factorio/data/server-settings.json
KillSignal=SIGINT
TimeoutStopSec=120
Restart=on-failure

[Install]
WantedBy=multi-user.target

--start-server-load-latest picks up the newest save, autosaves included, so a restart resumes where the map was. The headless server saves when it exits; KillSignal=SIGINT has systemd stop it the way Ctrl+C would, and TimeoutStopSec gives a large map time to finish writing before systemd kills it outright. A systemd unit that restarts correctly goes further into the restart settings.

Updating the game under a running map

Every player needs exactly the server's version, so an update is a planned event. Save with /server-save, stop the service and copy the whole install directory somewhere safe, as the wiki recommends before any new version. Then unpack the new headless build and start it on the same saves, mods and settings.

A save only moves forward. A newer build loads an older map, but once it has saved, the older build will not open it, so keep the pre-update copy until players have been on for a while. Mods are the other half. Each mod declares one major version of the game, so within 2.0.x they carry on, but a move to 2.1 needs a 2.1 release of every mod on the server, and one missing mod means waiting or taking it out of the map. Check the mod portal before you move; players will sync to whatever you end up running.

Tags
factorioheadless servermods
Share

SweetMask

Published · 4 min read

All articles

Keep reading

Guides · Factorio

How to Install Factorio and Join a Server

Nobody has ever joined a Factorio server for twenty minutes. You come to see what a friend built, notice the iron smelting is short, and start fixing it.

· 9 min read