Factorio multiplayer has a particular dynamic: the factory never stops. Trains keep running, belts keep moving, and the pollution cloud keeps expanding even when no one is logged in. That only makes sense on a dedicated server that stays online.
I've been in a Factorio multiplayer playthrough that ran for months, with people joining and leaving as schedules allowed. That kind of long-running campaign only works reliably with a cloud server hosting the world.
Factorio's dedicated server is officially supported and well-documented by the developer. This guide deploys it on Ubuntu 22.04, including the headless download that doesn't require Steam to install.
I run Factorio servers on Tencent Cloud Lighthouse. The 2 vCPU / 4 GB RAM plan handles early-to-mid game sessions with 4-8 players well; larger factories benefit from 4 vCPU. The spec upgrade path is useful for Factorio specifically — you can start with a smaller plan and upgrade as the factory grows and demands more CPU, without re-provisioning the server or losing your world. The snapshot feature is essential before major factory expansions or when installing mods that modify existing blueprints.
- Key Takeaways
| Factory Stage | RAM | CPU |
|---|---|---|
| Early game (up to first rocket) | 2 GB | 2 vCPU |
| Mid-megabase | 4 GB | 2–4 vCPU |
| Large megabase | 8 GB | 4+ vCPU |
Factorio's server is single-threaded for the game simulation — more cores don't help the factory calculation speed. What matters is CPU clock speed.
| Requirement | Notes |
|---|---|
| Cloud server | Tencent Cloud Lighthouse Ubuntu 22.04 |
| 4 GB RAM | Recommended even for small servers |
| A Factorio account | For downloading the headless server binary |
ssh ubuntu@YOUR_SERVER_IP
sudo apt update && sudo apt upgrade -y
sudo adduser --disabled-password --gecos "" factorio
sudo su - factorio
The Factorio headless server is free to download — you don't need to own the game on the server. Players connecting do need to own Factorio.
# As factorio user
# Check https://factorio.com/download for latest version
FACTORIO_VERSION="2.0.28"
wget "https://factorio.com/get-download/${FACTORIO_VERSION}/headless/linux64" \
-O factorio-headless.tar.xz
tar -xJf factorio-headless.tar.xz
ls factorio/
# bin/, config/, data/, mods/, saves/, etc.
exit # Back to ubuntu user
sudo -u factorio /home/factorio/factorio/bin/x64/factorio \
--create /home/factorio/factorio/saves/myworld.zip
Copy your save file to the server:
scp myworld.zip ubuntu@YOUR_SERVER_IP:/tmp/
sudo cp /tmp/myworld.zip /home/factorio/factorio/saves/
sudo chown factorio:factorio /home/factorio/factorio/saves/myworld.zip
# First, generate a map-gen-settings template
sudo -u factorio /home/factorio/factorio/bin/x64/factorio \
--create /home/factorio/factorio/saves/myworld.zip \
--map-gen-settings /home/factorio/factorio/data/map-gen-settings.example.json
# Copy example config files
sudo -u factorio cp /home/factorio/factorio/data/server-settings.example.json \
/home/factorio/factorio/config/server-settings.json
sudo -u factorio nano /home/factorio/factorio/config/server-settings.json
Key settings:
{
"name": "My Factorio Server",
"description": "Private server for friends",
"tags": ["game", "tags"],
"max_players": 10,
"visibility": {
"public": false,
"lan": true
},
"username": "",
"password": "",
"token": "",
"game_password": "optionalpassword",
"require_user_verification": true,
"autosave_interval": 10,
"autosave_slots": 5,
"afk_autokick_interval": 0,
"allow_commands": "admins-only",
"admins": ["YourFactorioUsername"]
}
For a private server, set "public": false. For a public server, provide your Factorio account username/token for server listing.
sudo nano /etc/systemd/system/factorio.service
[Unit]
Description=Factorio Dedicated Server
After=network.target
[Service]
Type=simple
User=factorio
WorkingDirectory=/home/factorio/factorio
ExecStart=/home/factorio/factorio/bin/x64/factorio \
--start-server /home/factorio/factorio/saves/myworld.zip \
--server-settings /home/factorio/factorio/config/server-settings.json \
--port 34197
Restart=on-failure
RestartSec=15s
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable factorio
sudo systemctl start factorio
sudo journalctl -u factorio -f
# Watch for: Factorio initialised
sudo ufw allow 34197/udp # Factorio default port
sudo ufw allow ssh
sudo ufw enable
Open the same in the Lighthouse console firewall.
In Factorio:
YOUR_SERVER_IP:34197Factorio auto-saves to saves/ every 10 minutes (configurable). For off-server backups:
sudo nano ~/backup_factorio.sh
#!/bin/bash
BACKUP_DIR=/home/ubuntu/backups/factorio
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
# Copy all saves (Factorio auto-saves while running, so no stop needed)
sudo tar czf $BACKUP_DIR/factorio_saves_$DATE.tar.gz \
/home/factorio/factorio/saves/
find $BACKUP_DIR -mtime +7 -delete
echo "Factorio backup: $DATE"
chmod +x ~/backup_factorio.sh
(crontab -l; echo "0 * * * * ~/backup_factorio.sh") | crontab -
Factorio runs at 60 updates per second (UPS). When the server can't keep up, UPS drops below 60 — the game slows down for all players.
Symptoms: the game feels like it's in slow motion, or players report the game "running at 0.5x speed."
This is purely CPU load from the factory simulation. Solutions:
Monitor UPS in-game: press F5 to show debug info including UPS.
Connect to the server console (in-game as admin, or via stdin):
/admins - List admins
/promote PlayerName - Promote to admin
/demote PlayerName - Remove admin
/ban PlayerName reason - Ban player
/unban PlayerName - Unban player
/kick PlayerName reason - Kick player
/players - List online players
/c game.speed = 0.5 - Slow down time (cheats)
/c game.speed = 2 - Speed up time
/c game.player.print(...) - Custom Lua commands
/save filename - Save to specific file
| Issue | Likely Cause | Fix |
|---|---|---|
| Connection refused | Service not running or wrong port | Check systemctl status SERVICE and verify firewall rules |
| Permission denied | Wrong file ownership or permissions | Check file ownership with ls -la and use chown/chmod to fix |
| 502 Bad Gateway | Backend service not running | Restart the backend service; check logs with journalctl -u SERVICE |
| SSL certificate error | Certificate expired or domain mismatch | Run sudo certbot renew and verify domain DNS points to server IP |
| Service not starting | Config error or missing dependency | Check logs with journalctl -u SERVICE -n 50 for specific error |
| Out of disk space | Logs or data accumulation | Run df -h to identify usage; clean logs or attach CBS storage |
| High memory usage | Too many processes or memory leak | Check with htop; consider upgrading instance plan if consistently high |
| Firewall blocking traffic | Port not open in UFW or Lighthouse console | Open port in Lighthouse console firewall AND sudo ufw allow PORT |
What server size do I need for a Factorio server?
Check the requirements section in this guide. Generally: more RAM = more players. Start with the recommended specs and monitor actual usage with htop before scaling up.
How do I keep the Factorio server running when I close my SSH session?
Use screen, tmux, or systemd to run the server as a background process. The guide covers setting up a systemd service for automatic startup and crash recovery.
How do I update the Factorio server software?
Stop the server, download the new version, replace the old binary or files, and restart. Always back up your world/save data first. Check the game's official documentation for version-specific migration notes.
How do I protect my server from unwanted players?
Use password protection and/or whitelist mode (if supported). Restrict the server port in UFW to known IP addresses if it's a private server for a small group.
Run your factory server:
👉 Tencent Cloud Lighthouse — CPU-optimized VPS for Factorio
👉 View current pricing and promotions
👉 Explore all active deals and offers