Log inSign up

Keep a Factorio multiplayer factory running around the clock

Download the headless Linux build from factorio.com, unpack it into /opt/factorio, create a map with bin/x64/factorio --create saves/world.zip, then start it with --start-server-load-latest --server-settings data/server-settings.json as a dedicated factorio user. Allow UDP 34197 and friends join by IP.

Topic: Game and voice servers · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

Why run Factorio on a VPS?

A dedicated server keeps the factory online when the host player logs off, so everyone can play on their own schedule and the map is always the latest version. Factorio is deterministic and single threaded in its main update, so fast cores keep the update rate at 60 UPS as the base grows. Early and mid game factories run well on F2-2 (2 vCPU, 2 GB RAM, 80 GB NVMe); megabases with thousands of machines and trains do better on F2-4 or larger. The game servers overview explains why the High Frequency line fits this kind of load.

Network traffic is light, since only player inputs travel over the wire, not the whole world state.

How do I set up the factorio user and download the server?

Create a system account first, then download the headless archive. The headless build is free to download and needs no game login. It comes as a tar.xz file, so install the xz tools as well.

sudo apt update && sudo apt install -y wget xz-utils
sudo useradd --system --home-dir /opt/factorio --shell /usr/sbin/nologin factorio
cd /tmp
wget -O factorio_headless.tar.xz https://factorio.com/get-download/stable/headless/linux64
sudo tar -xJf factorio_headless.tar.xz -C /opt
sudo chown -R factorio: /opt/factorio
sudo -u factorio /opt/factorio/bin/x64/factorio --version

The tarball unpacks into a folder named factorio, which becomes the home of the user. The version command confirms the binary runs; it prints the build number and the platform.

How do I create the first map?

Generate a save with default settings, or copy the example map generation file and adjust resources, cliffs and enemies first:

cd /opt/factorio
sudo -u factorio cp data/map-gen-settings.example.json data/map-gen-settings.json
sudo -u factorio nano data/map-gen-settings.json
sudo -u factorio mkdir -p saves
sudo -u factorio bin/x64/factorio --create saves/world.zip --map-gen-settings data/map-gen-settings.json

To continue an existing single player game, upload its save from your computer instead. On Windows the saves live in %APPDATA%\Factorio\saves; copy one up with scp world.zip deploy@198.51.100.24:/tmp/ and move it into /opt/factorio/saves with the right owner.

Which server settings should I change?

Copy the example settings file and edit the fields that control who can join and how often the game saves:

sudo -u factorio cp data/server-settings.example.json data/server-settings.json
sudo -u factorio nano data/server-settings.json
  • name and description: shown in the server browser.
  • visibility: set public to list the game online (needs username and token from your factorio.com profile) or keep it private and share the IP.
  • game_password: required for a private group.
  • require_user_verification: keep it true so only real accounts join.
  • autosave_interval and autosave_slots: minutes between saves and how many rotating saves to keep.
  • auto_pause: pauses when nobody is online, which saves CPU.

Admins go in server-adminlist.json as a JSON list of player names, for example ["deploy_player"]. Store the factorio.com token only in this file and keep it readable by the factorio user alone with chmod 600.

How do I run it as a systemd service?

A unit file keeps the server running after logout and restarts it on failure. The --start-server-load-latest flag picks the newest save, including autosaves, so a crash never rolls back more than one autosave interval.

sudo tee /etc/systemd/system/factorio.service <<EOF
[Unit]
Description=Factorio headless 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 --server-adminlist /opt/factorio/server-adminlist.json
Restart=on-failure
KillSignal=SIGINT
TimeoutStopSec=60

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now factorio
sudo journalctl -u factorio -n 30 --no-pager

Factorio treats SIGINT like Ctrl+C at the console and saves before quitting, which is why the unit sets it as the stop signal. A healthy log ends with lines saying the server is in game and listening.

Which firewall port does Factorio use?

Factorio uses a single UDP port, 34197 by default. Allow it and confirm the listener:

sudo ufw allow 34197/udp
sudo ss -ulnp | grep 34197

Players open Multiplayer, Connect to address, and type 198.51.100.24 (or 198.51.100.24:34197). If you run two servers on one box, start the second with --port 34198 and open that port too. RCON is optional; when enabled with --rcon-port and --rcon-password, keep its TCP port closed to the internet and reach it through an SSH tunnel. The firewall tutorial describes the default deny setup.

How do mods work on a headless server?

Put the mod zip files in /opt/factorio/mods, owned by the factorio user, and restart. Players joining with mismatched mods get an offer to sync them automatically when the mods come from the official portal. Factorio writes mods/mod-list.json, where each mod can be switched on or off. Keep a copy of the mod folder with every backup, because a save made with mods may not load without them.

How do I update the server and keep backups?

Updating means unpacking a newer archive over the old program files; saves, mods and settings stay in place.

sudo systemctl stop factorio
sudo tar -czf /root/factorio-saves-$(date +%F).tar.gz -C /opt/factorio saves mods data/server-settings.json
cd /tmp && wget -O factorio_headless.tar.xz https://factorio.com/get-download/stable/headless/linux64
sudo tar -xJf factorio_headless.tar.xz -C /opt
sudo chown -R factorio: /opt/factorio
sudo systemctl start factorio

Players need the same game version as the server, so announce updates to your group. Off-server copies of the saves folder plus the optional daily backups add-on from the console protect the factory if something goes wrong; see daily backups.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
F2-2early and mid game factories2 vCPU, 2 GB RAM, 80 GB NVMe$10.80/mo$64.80 for 6 months
F2-4megabases and modded runs2 vCPU, 4 GB RAM, 128 GB NVMe$14.40/mo$43.20 for 3 months

Questions about Factorio headless server

Do I need to buy the game to run the server?

The headless server downloads without a login. Every player needs their own copy of the game to join.

Can the server pause when nobody plays?

Yes, auto_pause in server-settings.json stops the simulation when no players are connected.

What does low UPS mean?

The server cannot keep 60 updates per second, so the game runs in slow motion for everyone. Large belts of entities, many biters and heavy mods are the usual causes.

Can I load a save from my own computer?

Yes. Copy the zip into /opt/factorio/saves, set ownership to the factorio user, and restart; the latest file is loaded.

How do I talk to players from the server side?

Enable RCON and use a client through an SSH tunnel, or join as an admin and use the in-game console.