Factorio Server Guide

📋 Quick Info

Server Specifications

🔌 Ports & Firewall Configuration

Factorio servers require specific ports for proper operation:

Port Protocol Purpose Required
34197 (configurable) UDP Game port Yes
27015 TCP RCON (if enabled) Optional

Firewall Examples

UFW (Ubuntu/Debian):

sudo ufw allow 34197/udp comment 'Factorio Game Port' sudo ufw allow 27015/tcp comment 'Factorio RCON'

FirewallD (CentOS/RHEL):

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

iptables:

iptables -A INPUT -p udp --dport 34197 -j ACCEPT iptables -A INPUT -p tcp --dport 27015 -j ACCEPT

⚙️ Installation & Setup

System Requirements

Installation (Linux - Manual Download)

  1. Download Factorio headless server:
    cd /home/factorio wget -O factorio.tar.xz https://www.factorio.com/get-download/latest/headless/linux64 tar -xf factorio.tar.xz
  2. Create data directory:
    mkdir -p ~/.factorio cd factorio
  3. Generate new map (optional):
    ./bin/x64/factorio --create my-save

Installation (Windows)

  1. Download headless server from factorio.com/download
  2. Extract to C:\factorio\
  3. Run factorio.exe --create my-save to generate map

📝 Configuration

Directory Structure

~/.factorio/ # Config directory (Linux) %APPDATA%\Factorio\ # Config directory (Windows) ├── saves/ # Save games ├── mods/ # Installed mods ├── config/ │ ├── server-settings.json │ ├── server-whitelist.json │ ├── server-banlist.json │ └── server-adminlist.json └── script-output/ # Script output files

server-settings.json Example

{ "name": "My Factorio Server", "description": "Vanilla cooperative factory building", "tags": ["game", "tags"], "_comment_max_players": "Maximum number of players allowed", "max_players": 0, "_comment_visibility": "public: Game will be published on the official Factorio matching server", "visibility": { "public": true, "lan": true }, "username": "", "password": "", "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, "only_admins_can_pause_the_game": true, "autosave_only_on_server": true, "non_blocking_saving": false, "_comment_admins": "List of case insensitive usernames, that will be admins on the server", "admins": [] }

server-whitelist.json Example

[ "player1", "player2", "player3" ]

server-adminlist.json Example

[ "admin1", "admin2" ]

Map Generation Settings (map-gen-settings.json)

{ "terrain_segmentation": "normal", "water": "normal", "width": 0, "height": 0, "starting_area": "normal", "peaceful_mode": false, "autoplace_controls": { "coal": { "frequency": "normal", "size": "normal", "richness": "normal" }, "iron-ore": { "frequency": "normal", "size": "normal", "richness": "normal" }, "copper-ore": { "frequency": "normal", "size": "normal", "richness": "normal" }, "stone": { "frequency": "normal", "size": "normal", "richness": "normal" }, "crude-oil": { "frequency": "normal", "size": "normal", "richness": "normal" }, "uranium-ore": { "frequency": "normal", "size": "normal", "richness": "normal" }, "trees": { "frequency": "normal", "size": "normal", "richness": "normal" }, "enemy-base": { "frequency": "normal", "size": "normal", "richness": "normal" } }, "cliff_settings": { "name": "cliff", "cliff_elevation_0": 10, "cliff_elevation_interval": 40, "richness": "normal" }, "property_expression_names": {}, "starting_points": [ { "x": 0, "y": 0 } ], "seed": null }

🚀 Startup Parameters

Parameter Description Example
--start-server Start multiplayer server with save file --start-server my-save
--create Create new map/save --create my-save
--port Network port to use --port 34197
--bind IP address to bind to --bind 0.0.0.0
--server-settings Path to server settings JSON --server-settings settings.json
--server-whitelist Path to whitelist JSON --server-whitelist whitelist.json
--server-adminlist Path to admin list JSON --server-adminlist adminlist.json
--rcon-port RCON port (requires password) --rcon-port 27015
--rcon-password RCON password --rcon-password secret
--map-gen-settings Map generation settings JSON --map-gen-settings mapgen.json
--console-log Path to write console log --console-log server.log

Example Startup Command (Linux)

./bin/x64/factorio --start-server my-save --port 34197 --server-settings server-settings.json

Example Startup Command (Windows)

factorio.exe --start-server my-save --port 34197 --server-settings server-settings.json

Example Startup Script (Linux with RCON)

#!/bin/bash cd /home/factorio/factorio ./bin/x64/factorio \ --start-server saves/my-save.zip \ --port 34197 \ --server-settings config/server-settings.json \ --server-adminlist config/server-adminlist.json \ --rcon-port 27015 \ --rcon-password "your_secure_password" \ --console-log /var/log/factorio/server.log

🔧 Troubleshooting

Server Not Appearing in Browser

Issue: Server not visible in public game list.

Solutions:

Connection Issues

Issue: Players cannot connect or timeout.

Solutions:

High Latency/Desync Issues

Issue: Players experiencing lag or desyncs.

Solutions:

Save File Corruption

Issue: Save file won't load or crashes.

Solutions:

Mod Loading Issues

Issue: Mods not loading or causing crashes.

Solutions:

Server Performance Issues

Issue: Server running slowly with many players.

Solutions:

🎮 Game Modes & Features

Multiplayer Modes

Core Features

Map Settings

🔌 Mods & Mod Portal

Factorio has extensive mod support via the official Mod Portal:

Popular Mods

Mod Installation

  1. Download mods from mods.factorio.com
  2. Place .zip files in ~/.factorio/mods/
  3. Edit mod-list.json to enable/disable mods
  4. Restart server with --mod-directory parameter if needed

Mod Synchronization

👤 Admin Commands

In-Game Commands

/admin # Open admin menu /ban [player] # Ban a player /unban [player] # Unban a player /kick [player] [reason] # Kick a player /promote [player] # Promote player to admin /demote [player] # Demote player from admin /mute [player] # Mute player's chat /unmute [player] # Unmute player /whitelist add [player] # Add to whitelist /whitelist remove [player]# Remove from whitelist /save # Manually save game

RCON Commands (via External Tools)

Use RCON to send console commands remotely when --rcon-port and --rcon-password are configured.

📚 Resources

Important Notes