Launch sale20% off everything — celebrating the launch of GHosting!
← All guides

How to Host a Factorio Dedicated Server on Linux

Factorio has an official lightweight headless server for Linux. It creates and hosts the same kind of persistent factory players expect, without a desktop client or SteamCMD. This guide uses the stable official package and keeps replaceable binaries separate from saves and mods.

A sprawling original industrial rail factory at dusk Use managed Factorio hosting with automatic saves, files and a live console

What you need

Use an x86_64 Linux host that can remain online, one public UDP port and enough CPU for the intended factory. Factorio defaults to UDP 34197. Player count alone is not a sizing guide: bots, trains, entities and mods determine simulation pressure.

1. Download the stable headless package

sudo adduser --disabled-password --gecos "" factorio
sudo apt-get update
sudo apt-get install -y curl xz-utils
sudo install -d -o factorio -g factorio /srv/factorio
sudo -u factorio mkdir -p /srv/factorio/data/{saves,mods,config}
cd /tmp
curl -fL https://factorio.com/get-download/stable/headless/linux64 -o factorio.tar.xz
tar -xJf factorio.tar.xz
sudo mv factorio /srv/factorio/runtime
sudo chown -R factorio:factorio /srv/factorio

The official FAQ describes the Linux headless build as a free dedicated-server option. Keep runtime replaceable. Do not unpack a future version over the directory where Factorio writes saves and mods.

2. Choose Base or Space Age before making a map

The headless package contains data for both. Before the first --create, put the intended DLC state in data/mods/mod-list.json. A Base world disables elevated-rails, quality and space-age:

{"mods":[
  {"name":"base","enabled":true},
  {"name":"elevated-rails","enabled":false},
  {"name":"quality","enabled":false},
  {"name":"space-age","enabled":false}
]}

For a Space Age world, set those three entries to true. Create exactly once, then always load the newest save:

sudo -u factorio /srv/factorio/runtime/bin/x64/factorio   --config /srv/factorio/data/config/config.ini   --create /srv/factorio/data/saves/first.zip

Do not toggle this list on an established world. Back up and test a copy first. See our Base versus Space Age server guide for the reasoning.

3. Configure paths and server settings

; version=13
[path]
read-data=/srv/factorio/runtime/data
write-data=/srv/factorio/data

Save that as data/config/config.ini. Factorio requires the format-version marker on the first line; without it the server ignores the path section. Then create data/config/server-settings.json:

{
  "name": "Copper Crew",
  "description": "Private co-op factory",
  "max_players": 12,
  "visibility": {"public": false, "lan": false},
  "game_password": "",
  "require_user_verification": true,
  "auto_pause": true,
  "autosave_interval": 10,
  "autosave_slots": 5,
  "allow_commands": "admins-only"
}

Public listing additionally needs a Factorio account username and auth token. Direct IP connection does not. The upstream multiplayer documentation lists the server-settings fields and startup modes.

4. Open UDP 34197 and make it a service

sudo ufw allow 34197/udp
sudo -u factorio /srv/factorio/runtime/bin/x64/factorio   --config /srv/factorio/data/config/config.ini   --server-settings /srv/factorio/data/config/server-settings.json   --port 34197 --start-server-load-latest

For systemd, run the same command from a unit with User=factorio, WorkingDirectory=/srv/factorio, Restart=on-failure and KillSignal=SIGINT. SIGINT gives Factorio a chance to save cleanly during a managed stop. Keep a FIFO or another open stdin mechanism if you want to send console commands from an external panel.

Mods, backups and versions

Upload mod ZIP files to data/mods, update mod-list.json, then restart. Every joining client needs the matching Factorio version and mod set. Copy the complete data/saves directory before changing versions or mods. When updating, stop the service, unpack the new archive to a staging directory, swap only runtime, then start and verify the newest save.

If players cannot connect, work through UDP reachability, client/server build parity and mod parity first. Our Factorio connection troubleshooting guide covers each of those checks.