heyer.systems Open Source

Factorio

Dedicated headless server for Factorio – with Space Age, mods from the mod portal and your own save games.

Install

On the Proxmox node as root:

bash -c "$(curl -fsSL https://iac.heyer.systems/factorio/ct.sh)"

Container from the Debian 13 template · default: 2 CPU, 2048 MiB RAM, 8 GiB disk

Customise the commandYour own values for CPU, RAM, network and modules – no dialog

Then: Game: <IP>:34197 (Multiplayer → Connect to address) – RCON from private networks: <IP>:27015, password in the guest: grep factorio_rcon_password /etc/iac/settings.env

More steps are needed outside the guest – see the setup guide.

Settings per instance

SettingMeaning
factorio_server_nameServer name – Name in the server browser (default: the host name)
factorio_game_password secretGame password – Players need it to join (empty: no password)
factorio_adminsAdmins – factorio.com user names with admin rights, comma separated
factorio_space_ageSpace Age – false: without the expansion, so players without Space Age can join (default: true)
factorio_modsMods – Mods from mods.factorio.com, comma separated – their dependencies come with them. Needs user name and token
factorio_usernamefactorio.com user name – For mods and the public server list
factorio_token secretfactorio.com token – From https://factorio.com/profile – for mods and the public server list
factorio_publicPublic – true: listed in the public server browser (needs user name and token)

When creating a container, as var_<setting>:

var_factorio_server_name="<value>" bash -c "$(curl -fsSL https://iac.heyer.systems/factorio/ct.sh)"

Set or change later, in the guest (for VMs the only way so far): a line factorio_server_name=<value> in /etc/iac/settings.env – no quotes, the last line of a setting wins – then:

update

With NetBox: the same line factorio_server_name=<value> in the field Settings of the VM – it takes effect at the next update. Secrets stay in the guest.

Missing or empty = the app's default. Do not edit the configuration files iac writes – update overwrites them; their first lines name the file for local changes.

Setup guide

Reach the server from the internet

Players connect over UDP 34197 – nothing else. On your router forward UDP 34197 to the guest’s IP. RCON (TCP 27015) stays inside your network; the guest’s firewall only lets private networks reach it.

Behind a reverse proxy? Not needed and not possible: Traefik and nginx forward HTTP, Factorio speaks its own UDP protocol.

Connect

In Factorio: Multiplayer → Connect to address, enter <address>:34197 (or only the address – 34197 is the default) and the game password if you set factorio_game_password.

Players need the same Factorio version as the server. Steam and the standalone game update themselves to the newest stable release, and so does the server (update, every night with the module auto-update). Players without Space Age can only join when the server runs without it: factorio_space_age=false.

To appear in the public server browser, set in /etc/iac/settings.env and run update:

factorio_public=true
factorio_username=<your factorio.com name>
factorio_token=<token from https://factorio.com/profile>

Without them the server is only listed in your LAN.

Maps and saves

All maps of the server are save files in /var/lib/factorio/saves/ in the guest. The server always plays the newest file there – autosaves included. iac-factorio-map changes which one that is: it stops the server (which saves the running game first), puts the map in place and starts the server again. Existing saves are never deleted.

WhatCommand in the guest
Which map is running?iac-factorio-map list – the first line
Start a new mapiac-factorio-map new mybase – creates /var/lib/factorio/saves/mybase.zip
Back to an earlier mapiac-factorio-map load world – a name from list, without .zip
Play a save from your computersee below

Without a name, new calls the map world-<date>-<time>. The map of the first start is world. Autosaves (_autosave1.zip …) belong to whichever map is running and overwrite each other – the map you want to come back to is the file with its own name.

Map settings for new and the first start (seed, resources, enemies, …) are in /etc/factorio/map-gen-settings.json. iac manages it with Factorio’s defaults and update overwrites it – change them in files/map-gen-settings.json of iac-factorio; the keys are explained in /opt/factorio/current/data/map-gen-settings.example.json.

A save from your computer: in Factorio it lies in %APPDATA%\Factorio\saves (Windows), ~/.factorio/saves (Linux) or ~/Library/Application Support/factorio/saves (macOS). Copy it to the guest and load it:

scp MyWorld.zip root@<guest>:/root/
ssh root@<guest> iac-factorio-map load /root/MyWorld.zip

load copies it to /var/lib/factorio/saves/MyWorld.zip; a save of the same name there is kept as MyWorld.zip.<date>-<time>.bak. A save from a newer Factorio version than the server’s cannot be loaded.

Mods

List the mods by their name on mods.factorio.com (the last part of the URL, e.g. https://mods.factorio.com/mod/even-distribution → even-distribution):

factorio_mods=Krastorio2,even-distribution
factorio_username=<your factorio.com name>
factorio_token=<token from https://factorio.com/profile>

Then update: iac downloads the newest release of each mod for the server’s Factorio version with all required dependencies, checks it against the mod portal and restarts the server. Every update brings them up to date. Players are offered the same mods when they join.

With factorio_mods, iac owns /var/lib/factorio/mods and removes other mods there. Without it, put mod zips into that folder yourself. Edit mods/mod-list.json only while the server is stopped (systemctl stop factorio) – Factorio writes it when it quits.

Admins and commands

Admins can use server commands in the game chat (/kick, /ban, /promote, …). factorio_admins=alice,bob makes them admins; /promote and /demote in the game work as usual.

Commands from the guest’s shell go over RCON:

iac-factorio-rcon /players
iac-factorio-rcon /save

From another machine in your network any RCON client works – address <guest>:27015, password: grep factorio_rcon_password /etc/iac/settings.env.

Source: docs/GUIDE.md of iac-factorio – corrections welcome.

Update

In the guest (LXC/VM):

update

Debian packages, Factorio, modules and the iac configuration. Major versions never change automatically.

Add modules – any time, in containers and VMs alike:

update --list-modules
update --add-modules node-exporter

All modules · More about update

With Docker, in the directory of the docker-compose.yml:

docker compose pull && docker compose up -d