⚙️ Setup Factorio Server — Factory Building Multiplayer
Dedicated Factorio server for cooperative factory building and automation with friends
📦 Resources & Setup Scripts
Grab the automated bash script from GitHub to follow along with the video.
Quick Install:
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/gaming/factorio/factorio-ubuntu.sh
chmod +x factorio-ubuntu.sh
sudo bash factorio-ubuntu.sh
Tutorial Steps
1 Download & Run the Installer
The script installs Docker, pulls the official Factorio headless server image, and starts the container. The server generates a new map on first run and listens on port 34197 UDP.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/gaming/factorio/factorio-ubuntu.sh
chmod +x factorio-ubuntu.sh
sudo bash factorio-ubuntu.sh
2 Configure the Server
Edit server-settings.json to set server name, description, max players, and password. Configure map generation settings in map-gen-settings.json for custom starting conditions.
# Edit server settings
nano /opt/factorio/config/server-settings.json
# Key fields:
# "name": "My Factorio Server"
# "description": "A cooperative factory server"
# "max_players": 10
# "game_password": "yourpassword"
# "visibility": { "public": false, "lan": true }
3 Connect with the Game Client
Open Factorio, go to Multiplayer, then Browse Public Games to find your server, or use Connect to Address to enter the server IP and port directly.
# Direct connect address
<your-server-ip>:34197
4 Admin Management
Manage admins, ban players, and run console commands via the server console or in-game chat. Admin players can use /command for Lua scripting and game manipulation.
# View live server console
docker attach factorio-server
# Common server console commands:
# /admins - list admins
# /ban <player> <reason> - ban a player
# /kick <player> - kick a player
# /save <savename> - save the game
# /promote <player> - promote to admin
# View logs
docker logs -f factorio-server
Ports Used
| Port | Purpose |
|---|---|
| 34197 UDP | Game traffic (all connections) |
Overview
Factorio is an engineering and factory automation game where players build increasingly complex production lines on an alien planet. A dedicated server allows persistent collaborative gameplay where friends can join and contribute to the shared factory at any time without the host staying online.
Why Use It
A dedicated Factorio server keeps the factory running 24/7, allows friends in different time zones to contribute asynchronously, and enables mods to be installed server-side for all players. Factorio's dedicated server is lightweight and well-supported compared to many other games.
When You Need It
Who Should Use It
Real Use Cases
Main Features
How to Use After Installation
Security Best Practices
Ports and Firewall Notes
Factorio uses UDP port 34197 for game connections. Open UDP 34197 in your firewall. RCON uses a TCP port configurable in server-settings.json — keep RCON firewalled from the public internet.
Backup and Maintenance
Common Mistakes
Troubleshooting
Alternatives
Alternatives include playing via Steam Remote Play Together (host stays online), the Factorio.com public server browser, and peer-to-peer LAN play. Self-hosting provides 24/7 uptime without ongoing hosting fees.
When Not to Use It
Avoid self-hosting Factorio if you only play occasionally with one other person — the built-in host and Steam Remote Play work fine. Self-hosting shines for groups with different schedules who want the factory to run continuously.
PrismaTechWork Professional Help
PrismaTechWork provides end-to-end infrastructure services — from initial deployment and security hardening to ongoing monitoring, automated backups, and dedicated support. Whether you need a single-server setup or a multi-site network, our team ensures your infrastructure is built right, secured properly, and maintained reliably.
Frequently Asked Questions
Does the factory keep running when no one is online?
Yes — this is the primary advantage of a dedicated server. When playing on a dedicated server, the game simulation continues even when all players are disconnected. Your factory keeps producing, belts keep moving, and rockets may even launch while you sleep. This enables true collaborative asynchronous factory building.
How do I sync mods between the server and players?
Factorio has a built-in mod sync system. When a player connects to a server with mods installed, the client automatically downloads any missing mods from the Factorio Mod Portal. Ensure all mods on the server are published to the Mod Portal. Private or local mods must be distributed manually.
Can I use an existing save file on the dedicated server?
Yes. Copy your .zip save file from the Factorio saves directory on your local machine to the server's saves directory. Configure the server to load that specific save file by name in server-settings.json or pass it as the --start-server argument.
What is a Factorio.com token and why is it needed?
Factorio uses your Factorio.com account for game authentication. The server needs your account username and an authentication token to verify players. Generate the token from your Factorio.com account page under Profile then Account. This prevents authentication issues without requiring your password on the server.
How many players can a Factorio server support?
Factorio performs well with 4 to 16 players on most servers. Theoretically more players can join, but the UPS (Updates Per Second) drops as more players and more complex factories demand more simulation. For large factories late-game, the factory complexity becomes the bottleneck more than player count.
How do I use RCON to manage my Factorio server?
Enable RCON in server-settings.json by setting rcon-port and rcon-password. Connect with any RCON client using those credentials. Factorio RCON accepts Lua commands — for example: /c game.print('Hello') broadcasts a message and /c game.server_save('backup') saves the game from RCON.
How do I run the server headlessly without a display?
The Factorio dedicated server binary (factorio --start-server) runs headlessly without any graphical display by default. No display or GPU is needed. The Docker setup runs it this way automatically, making it suitable for any Linux VPS or headless server.
Can I run multiple Factorio servers on one machine?
Yes. Each server instance needs a different UDP port. Run multiple Docker containers with different port mappings and different save files. Share resources appropriately — each Factorio server instance uses approximately 1 to 2 GB RAM for a typical mid-game factory.