Menu
 

Server Setup - Factorio Wiki

Server Setup

Setting up a Factorio dedicated server allows you to create a persistent multiplayer world where you and your friends can build factories together. This comprehensive guide covers everything from initial setup to advanced configuration and troubleshooting.

Prerequisites

Before starting, ensure you have:

  • Factorio server files installed (headless version recommended for dedicated servers)
  • At least 2-8 GB of RAM available (scales with player count and factory size)
  • Port 34197 (UDP) accessible through your firewall
  • A save file or ability to generate a new world

Server Requirements

RAM and CPU requirements scale with the number of players and factory complexity:

RAM Requirements

  • 2 GB RAM - 1-4 players, small to medium factories
  • 4 GB RAM - 5-12 players, medium to large factories
  • 8 GB RAM - 12+ players or megabase builds
  • 16+ GB RAM - Very large multiplayer megabases

CPU Considerations

Factorio is single-threaded for game updates. A high clock speed CPU (3.5+ GHz) performs better than multi-core processors with lower speeds. UPS (Updates Per Second) should remain at 60 for smooth gameplay.

Installing the Server

Downloading Server Files

  1. Download the headless server from Factorio.com
  2. Extract the archive to your desired directory
  3. The headless version has no graphics and is optimized for dedicated servers

Creating Your First World

A dedicated server requires a save file. You can create one several ways:

Method 1: Generate via Command Line

./factorio --create my-save

This generates a new world with default settings.

Method 2: Custom Map Generation

./factorio --create my-save --map-gen-settings map-gen-settings.json --map-settings map-settings.json

Use JSON configuration files to customize terrain, ore placement, enemy settings, and more.

Method 3: Upload Existing Save

Copy a save file from your local game to the server's saves directory: ./saves/

Basic Server Configuration

Server Settings File

The server-settings.json file (located in ./data/) controls all server behavior:

{
  "name": "My Factorio Server",
  "description": "Welcome to my factory",
  "tags": ["game", "tags"],
  "max_players": 10,
  "visibility": {
    "public": true,
    "lan": true
  },
  "username": "your-factorio-username",
  "token": "your-auth-token",
  "game_password": "",
  "require_user_verification": true,
  "max_upload_in_kilobytes_per_second": 0,
  "max_upload_slots": 5,
  "minimum_latency_in_ticks": 0,
  "ignore_player_limit_for_returning_players": false,
  "allow_commands": "admins-only",
  "autosave_interval": 10,
  "autosave_slots": 5,
  "afk_autokick_interval": 0,
  "auto_pause": true
}

Important Settings Explained

  • name - Server name shown in public browser
  • max_players - Maximum concurrent players (0 = unlimited)
  • visibility.public - List on public server browser
  • username/token - Required for public servers (get token from factorio.com)
  • game_password - Password protect your server
  • require_user_verification - Players must have Factorio accounts
  • auto_pause - Pause when all players disconnect (saves UPS)
  • autosave_interval - Minutes between autosaves
  • allow_commands - Control who can use console commands

Starting Your Server

Basic Start Command

./factorio --start-server my-save --server-settings server-settings.json

Advanced Start Options

./factorio --start-server my-save \
  --server-settings data/server-settings.json \
  --port 34197 \
  --bind 0.0.0.0:34197 \
  --rcon-port 27015 \
  --rcon-password admin123

Running as Background Process (Linux)

Use screen or systemd to run the server in the background:

screen -S factorio
./factorio --start-server my-save --server-settings data/server-settings.json
# Press Ctrl+A then D to detach
# Reattach with: screen -r factorio

Port Forwarding and Firewall

Required Ports

  • 34197 UDP - Game port (configurable with --port)
  • 27015 TCP - RCON port (optional, for remote administration)

Linux Firewall (UFW)

sudo ufw allow 34197/udp
sudo ufw allow 27015/tcp  # If using RCON
sudo ufw reload

Router Configuration

  1. Access your router admin panel (usually 192.168.1.1 or 192.168.0.1)
  2. Find Port Forwarding settings
  3. Forward UDP port 34197 to your server's local IP
  4. Save and restart router if required

Managing Mods

Installing Server Mods

  1. Place mod zip files in ./mods/ directory
  2. Create or edit ./mods/mod-list.json to enable/disable mods
  3. Restart server to load new mods
  4. Clients will auto-download enabled mods when connecting

Mod Sync

Factorio handles mod synchronization automatically:

  • Server sends mod list to connecting clients
  • Missing mods download from mod portal
  • Clients must restart after downloading
  • All players must have identical mod versions

Admin Management

Admin List

Create ./server-adminlist.json to grant admin privileges:

[
  "PlayerUsername1",
  "PlayerUsername2"
]

Whitelist (Optional)

Create ./server-whitelist.json to restrict access:

[
  "AllowedPlayer1",
  "AllowedPlayer2"
]

Common Issues and Troubleshooting

Network Communication Error

Error: "Couldn't establish network communication with server"

Solutions:

  • Verify server is actually running
  • Check UDP port 34197 is open in firewall
  • Confirm router port forwarding is configured
  • Test with direct IP connection instead of server browser
  • Ensure server isn't binding to localhost only (use 0.0.0.0)

Desynchronization Issues

Symptoms: Players getting kicked with "desync" messages

Causes and Solutions:

  • Mod mismatch - Ensure all players have identical mod versions
  • Determinism issues - Some mods cause desyncs; disable suspect mods
  • Network instability - Check player ping and packet loss
  • Save corruption - Restore from earlier backup

Low UPS (Updates Per Second)

Symptoms: Game running in slow motion, UPS below 60

Solutions:

  • Upgrade to faster CPU (higher clock speed)
  • Optimize factory design (reduce active entities)
  • Use mods like "Performance Tweaks" or "Bottleneck"
  • Reduce autosave frequency
  • Limit max players during peak factory activity

Server Won't Appear in Browser

Checklist:

  • Set "public": true in visibility settings
  • Provide valid username and token in server-settings.json
  • Verify port forwarding is working (use online port checker)
  • Check server logs for authentication errors
  • Wait 5-10 minutes for server list to update

Backup and Save Management

Automatic Backups

Configure autosaves in server-settings.json:

  • "autosave_interval" - Minutes between saves (default: 10)
  • "autosave_slots" - Number of autosave files to keep (default: 5)

Manual Backups

  1. Stop server gracefully (type /quit in server console)
  2. Copy entire ./saves/ directory
  3. Store backups in a safe location (consider off-server storage)
  4. Restart server

Save Location

Saves are stored in: ./saves/[save-name].zip

Autosaves format: ./saves/_autosave1.zip, _autosave2.zip, etc.

Performance Optimization

Server-Side Tips

  • Use SSD for faster save/load times
  • Reduce chunk render distance (affects performance minimally on headless)
  • Limit max upload slots if bandwidth constrained
  • Enable auto-pause to save CPU when server is empty
  • Monitor server CPU and RAM usage

Factory Design Tips

  • Minimize active entities (inserters, assemblers)
  • Use beacons efficiently (they're expensive UPS-wise)
  • Limit fluid calculations (pipes are CPU intensive)
  • Use train limits to prevent pathfinding issues
  • Turn off unnecessary parts of factory when not needed

Advanced: RCON Remote Administration

Enable RCON for remote server management without joining the game:

./factorio --start-server my-save \
  --rcon-port 27015 \
  --rcon-password yourpassword

Connect using RCON clients to execute commands, view logs, and manage the server remotely.

Top