News
Public API for VMware is now available in Serverspace
MW
October 5 2026
Updated October 5 2026

How to Create a Factorio Server on a VPS and Set Up Auto-Start

Web server

Multiplayer Factorio really shines when the factory never sleeps: friends hop on whenever it suits them, build their own sections, and the map doesn't depend on whether the host's PC is turned on. That takes a dedicated server that runs around the clock and comes back up on its own after a reboot or crash.

In this article, we'll install the official Factorio headless server on Linux, create a map with or without the Space Age expansion, configure server settings and admins, open the firewall port, and set up a systemd service with auto-start. Finally, we'll cover server updates and save backups. A VPS in the Serverspace cloud running Ubuntu 22.04 or 24.04 works well for hosting; we'll note the commands for other distributions along the way.

Key Terms

  • Headless server is a version of Factorio with no graphics or sound, built solely to host multiplayer games. The developers distribute it for free, so you don't need to buy the game for the server.
  • Save is a ZIP archive containing the map and the state of the world. The server loads a save on startup and periodically writes autosaves.
  • UPS (updates per second) is how many times per second the game world updates. The normal value is 60. If the CPU can't keep up, UPS drops and the game slows down for everyone.
  • Deterministic lockstep is Factorio's networking model: the server and every client simulate the same world, and only player actions travel over the network.
  • systemd is the service manager in most modern Linux distributions. A service is described by a unit file that defines how to start, stop, and restart a program.
  • UDP is a connectionless network protocol. Factorio uses UDP only, and the default port is 34197.

How a Factorio Server Works

Synchronization and Load

Factorio doesn't send the position of every item on every belt over the network. The server and clients run an identical deterministic simulation and exchange only player input: "placed a building," "rotated an inserter," "started research." As a result, Factorio uses little bandwidth even on huge factories, but every participant, including the server, needs enough CPU power.

Factorio's main world update loop runs on a single thread, so a high clock speed matters more for a server than a high core count. RAM goes to the map: the larger the explored area and the factory itself, the more memory the world takes up.

How Players Connect

When a client connects, it downloads the current save from the server, loads it, and catches up with the simulation. On a large map this takes noticeable time, and the server's upload speed matters here. Once a player is in the game, only player commands go over the network.

Client and server versions must match. Steam and the standalone launcher automatically update the game to the latest stable version, so you need to update the server after each release, or players won't be able to connect.

Space Age on the Server

Starting with version 2.0, the Space Age expansion is implemented as three official mods: space-age, quality, and elevated-rails. They ship with the headless server, and a new map is created with the expansion enabled by default. Only players who own Space Age can join such a server. If some of your friends don't have the expansion, create a map without it — we'll show you how below.

VPS Requirements

Server requirements depend on the factory size, mods, and number of players. Here are some starting points:

Scenario vCPU RAM Disk
2–4 players, vanilla game 2 2 GB 10 GB
Up to 10 players, large base or Space Age 2–4 with high clock speed 4 GB 20 GB
Megabases and large modpacks 4 8 GB or more 30 GB or more

Disk space mostly goes to autosaves and backups. The server package is built for 64-bit x86_64 processors. Pick a data center close to your players: if everyone plays from the US, a US location will give you lower ping.

When You Need a Dedicated Server

  • An always-on co-op game. A group of friends builds one factory for weeks, logging in at different times. The world stays available even when the "host" is on vacation.
  • Long-term projects and megabases. A server with autosaves and backups is more reliable than a home PC: a power outage or a Windows update won't corrupt your save.
  • Modpacks. The server defines a single set of mods, and clients are offered to sync their mods with the server's when they connect.
  • Communities. A public server protected by a password or whitelist for a streamer, a clan, or a Discord community.

Installing and Configuring the Server

Run all commands on the VPS as a user with sudo privileges. In the examples, the server is installed in /opt/factorio, and the VPS IP address is 203.0.113.10; replace it with your own.

Step 1. Prepare the System

Update the package list and install the tools for downloading and extracting the archive:

sudo apt update
sudo apt install -y wget xz-utils

On AlmaLinux and Rocky Linux, use sudo dnf install -y wget xz.

Create a system user named factorio to run the server. Running game servers as root is an unnecessary risk: a vulnerability in the game or a mod shouldn't give anyone access to the whole system. A user without a login shell can't sign in over SSH:

sudo useradd --system --user-group --home-dir /opt/factorio --shell /usr/sbin/nologin factorio

Step 2. Download and Extract the Server

The link below always points to the latest stable headless server for Linux. The -O option sets the name of the downloaded file:

cd /tmp
wget -O factorio_headless.tar.xz https://factorio.com/get-download/stable/headless/linux64

Extract the archive to /opt: it already contains a factorio directory. Then hand the files over to the factorio user and create directories for saves and mods:

sudo tar -xJf factorio_headless.tar.xz -C /opt
sudo chown -R factorio:factorio /opt/factorio
sudo -u factorio mkdir -p /opt/factorio/saves /opt/factorio/mods

Make sure the server runs and check its version:

sudo -u factorio /opt/factorio/bin/x64/factorio --version

The command prints the version number and build details, which should include the word headless.

Step 3. Choose a Mode: With or Without Space Age

If every player owns the expansion, skip this step: the map will be created with Space Age. To play without the expansion, create a mod list file:

sudo -u factorio nano /opt/factorio/mods/mod-list.json

Paste the following content and save the file (in nano, press Ctrl+O, Enter, then Ctrl+X):

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

The server reads this file on every startup and enables or disables the listed mods. Don't switch modes on an existing map: a Space Age save won't load without the expansion.

Step 4. Create a Map

The simplest option is a map with the default generation settings:

sudo -u factorio /opt/factorio/bin/x64/factorio --create /opt/factorio/saves/world.zip

To customize generation (resource richness, enemy frequency, map seed), copy the example settings, edit them, and pass the file when creating the map:

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

In the same way, --map-settings and the map-settings.example.json file control enemy evolution, pollution, and expansion. You can also create a map in the game on your own PC and upload the ZIP file to /opt/factorio/saves over SFTP. After uploading, don't forget to run sudo chown factorio:factorio on that file.

Step 5. Configure Server Settings

Server settings live in a JSON file. Copy the example and open it in an editor:

sudo -u factorio cp /opt/factorio/data/server-settings.example.json /opt/factorio/data/server-settings.json
sudo -u factorio nano /opt/factorio/data/server-settings.json

The file has many settings, and most can stay as they are. Here are the key values for a private server for friends:

"name": "Factorio on a VPS",
"description": "Co-op factory",
"max_players": 8,
"visibility": {
"public": false,
"lan": false
},
"game_password": "choose-a-password",
"require_user_verification": true,
"autosave_interval": 10,
"autosave_slots": 5,
"auto_pause": true,
"only_admins_can_pause_the_game": true,
"allow_commands": "admins-only"

What these settings do:

Setting Purpose
name, description Server name and description in the game browser.
max_players Maximum number of players; 0 means no limit.
visibility.public Lists the server in the public server browser. Requires your factorio.com username and token in the username and token fields.
visibility.lan Visibility on the local network; not needed on a VPS.
game_password Password required to join the server.
require_user_verification Only lets in players with a verified factorio.com account. Prevents impersonation.
autosave_interval, autosave_slots Autosave interval in minutes and the number of rotating autosave files.
auto_pause Pauses the game when no players are online.
allow_commands Who can run console commands: true, false, or admins-only.

You'll find the token for a public server in your profile on factorio.com. A private game with friends doesn't need to be listed publicly: players will connect by IP address.

Step 6. Add Admins

Admins can kick and ban players, save the game with a command, and run console commands. The list is stored in the server-adminlist.json file in the server's root directory, next to the factorio-current.log file:

sudo -u factorio nano /opt/factorio/server-adminlist.json

List the players' factorio.com usernames:

["your_factorio_name", "friend_name"]

To allow only selected players regardless of the password, use a whitelist: a server-whitelist.json file in the same format, enabled with the --use-server-whitelist launch option. To see all launch options, run /opt/factorio/bin/x64/factorio --help.

Step 7. Open the Port in the Firewall

On Ubuntu with ufw, allow SSH first so you don't lock yourself out, then allow the game port and enable the firewall:

sudo ufw allow OpenSSH
sudo ufw allow 34197/udp
sudo ufw enable
sudo ufw status

On AlmaLinux and Rocky Linux with firewalld, the commands are:

sudo firewall-cmd --permanent --add-port=34197/udp
sudo firewall-cmd --reload

If you use a network firewall in your cloud control panel, allow inbound UDP traffic on port 34197 there as well.

Step 8. Test a Manual Launch

Before setting up the service, let's make sure the server starts with our settings. The --start-server-load-latest option loads the most recent save from the saves directory, including autosaves:

sudo -u factorio /opt/factorio/bin/x64/factorio --start-server-load-latest --server-settings /opt/factorio/data/server-settings.json

The log printed to the terminal should include a line saying the server is accepting connections on port 34197, with no error messages. In a second SSH window, you can confirm that the port is open:

sudo ss -ulnp | grep 34197

Try connecting from the game: Multiplayer → Connect to address, then enter 203.0.113.10. You don't need to specify the default port. If everything works, stop the server with Ctrl+C: it will save the game and exit.

Setting Up Auto-Start with systemd

A server launched in the terminal stops when your SSH session ends. To keep it running, start it at boot, and restart it after crashes, we'll set it up as a systemd service.

Step 9. Create the Unit File

sudo nano /etc/systemd/system/factorio.service

File contents:

[Unit]
Description=Factorio headless server
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=factorio
Group=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
RestartSec=10
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ProtectHome=true
[Install]
WantedBy=multi-user.target

What the Directives Do

  • After=network-online.target starts the server after the network is up.
  • User and Group run the service as the unprivileged factorio user.
  • KillSignal=SIGINT sends the server the same signal as Ctrl+C when the service stops, so it saves the game and shuts down cleanly.
  • TimeoutStopSec=120 gives the server up to two minutes to save a large map before systemd kills the process.
  • Restart=on-failure and RestartSec=10 restart the service 10 seconds after a crash.
  • NoNewPrivileges, PrivateTmp, ProtectSystem, and ProtectHome are security restrictions: the process can't escalate privileges, gets its own /tmp, can't modify system directories such as /usr and /etc, and can't see users' home directories. The /opt/factorio directory stays writable.

Step 10. Enable and Start the Service

Reload the systemd configuration, enable auto-start, and start the server right away:

sudo systemctl daemon-reload
sudo systemctl enable --now factorio

Check the status:

systemctl status factorio

The Active line should say active (running). To follow the server log in real time, run:

journalctl -u factorio -f

Test auto-start by rebooting the VPS with sudo reboot. After a minute, reconnect over SSH, run systemctl status factorio again, and then join the game.

Managing the Server

Action Command
Stop and save sudo systemctl stop factorio
Start sudo systemctl start factorio
Restart sudo systemctl restart factorio
Disable auto-start sudo systemctl disable factorio
Show the last 100 log lines journalctl -u factorio -n 100

In the game itself, admins can use chat commands: /server-save saves the game, /kick and /ban remove a player, /promote grants admin rights, and /players lists the players.

Updating the Server

When a new stable version comes out, update the server so players can keep connecting. Stop the service, make a backup, and extract the new archive over the old one. Your saves, mods, and settings files aren't affected because the archive doesn't contain them:

sudo systemctl stop factorio
sudo tar -czf /root/factorio-before-update.tar.gz -C /opt/factorio saves mods data/server-settings.json server-adminlist.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:factorio /opt/factorio
sudo systemctl start factorio

If you don't have one of the listed files (for example, you didn't create server-adminlist.json), remove it from the tar command. After the server starts, check the version in the log with journalctl -u factorio -n 50.

Backing Up Saves

Autosaves protect you from server crashes but not from player mistakes: if someone tears down half the base, an hour later every autosave slot will hold the damaged world. That's why daily backups are worth keeping. Create a script:

sudo nano /usr/local/bin/factorio-backup.sh

#!/bin/bash
set -euo pipefail
BACKUP_DIR=/var/backups/factorio
mkdir -p "$BACKUP_DIR"
tar -czf "$BACKUP_DIR/saves-$(date +%F-%H%M).tar.gz" -C /opt/factorio saves
find "$BACKUP_DIR" -name 'saves-*.tar.gz' -mtime +7 -delete

The script packs the saves directory into a date-stamped archive and deletes backups older than seven days. Make it executable and add it to root's crontab:

sudo chmod +x /usr/local/bin/factorio-backup.sh
sudo crontab -e

Add this line to create a backup every day at 4:00 a.m. server time:

0 4 * * * /usr/local/bin/factorio-backup.sh

For extra safety, periodically copy the archives off the VPS, for example to your home PC over SFTP or to object storage.

Mods on the Server

To add mods, copy their ZIP files to /opt/factorio/mods (the easiest source is your own game's mods folder, where the set is already tested), give ownership to the factorio user, and restart the service. Mods are enabled and disabled through the same mod-list.json file. Mod settings are stored in the mod-settings.dat file in the same directory.

When players connect, the game offers to sync their mods with the server and downloads any missing ones from the mod portal. Mod versions must match between the server and clients, so update them at the same time.

Common Issues

Symptom Cause and fix
The game can't connect and times out UDP port 34197 is closed. Check ufw status, the firewall in your cloud control panel, and ss -ulnp.
Version mismatch error The client and server run different versions. Update the server or switch the game to the same version.
A player without Space Age can't join The map was created with the expansion. That group needs a new map without Space Age (step 3).
The service exits immediately There's no save in saves, or the settings JSON has an error. Check journalctl -u factorio -n 50.
The game stutters periodically for everyone The CPU can't sustain 60 UPS, or a large map is autosaving. Move to a more powerful plan or autosave less often.
Permission denied in the log Files were uploaded by a different user. Run sudo chown -R factorio:factorio /opt/factorio.

Conclusion

We installed the Factorio headless server under a dedicated user, created a map with or without Space Age, set up a password, admins, and autosaves, opened UDP port 34197, and turned the server into a systemd service. It now starts with the VPS, restarts after crashes, and saves the game on a clean shutdown. The backup script protects your factory from player mistakes, and an update takes just a couple of minutes.

From here, you can take the setup further: add mods, make the server public, or enable a whitelist. If your factory grows and UPS starts to drop, you can scale your VPS in the Serverspace cloud to more cores and memory without reinstalling the server.

Vote:
5 out of 5
Аverage rating : 5
Rated by: 1
33401 West Palm Beach, FL 700 S Rosemary Ave, Suite 204
+1 302 425-97-76
700 300
ITGLOBAL.COM CORP | All rights reserved
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.