# Factorio Server + Manager

> Factorio dedicated server with web-based management interface.

- Category: Home Lab & Self-Hosting
- Difficulty: intermediate
- Components: factorio-server, factorio-server-manager
- Tags: factorio, gaming, dedicated-server, management
- Source: https://docker.recipes/homelab/factorio-server-manager

## Overview

Factorio is a factory-building and automation game that has captivated players worldwide with its complex production chains and logistics challenges. The factoriotools/factorio container provides a dedicated server implementation that allows multiple players to collaborate on massive factory builds in persistent multiplayer worlds. Unlike the standard game client, this server container runs headlessly and supports advanced features like automatic mod updates, save file management, and remote administration capabilities. The factorio-server-manager by mroote adds a comprehensive web-based control panel that transforms server administration from command-line complexity into an intuitive graphical interface. This manager provides real-time server monitoring, automated backup scheduling, mod installation and updates, player management, and detailed configuration controls without requiring direct server access. Gaming communities and server administrators choose this combination because it eliminates the technical barriers of running a Factorio server while providing enterprise-grade management features. The stack is particularly valuable for groups wanting to maintain long-running factory projects, modded gameplay experiences, or multiple save files with different configurations and player groups.

## Features

- Automatic mod synchronization and updates on server startup
- Web-based save file management with backup and restore capabilities
- Real-time server console access through the manager interface
- Player whitelist and ban management with admin controls
- Mod installation and configuration through web UI without server downtime
- Server performance monitoring with CPU, memory, and network statistics
- Scheduled automatic saves and backup rotation policies
- Multi-save support for different game scenarios and player groups

## Use cases

- Gaming communities hosting persistent multiplayer Factorio worlds
- Modded Factorio servers requiring frequent mod updates and configuration changes
- Educational institutions teaching automation and logistics concepts
- Friend groups maintaining long-term collaborative factory building projects
- Gaming cafes and LAN centers providing managed Factorio experiences
- Content creators running subscriber servers with custom scenarios
- Corporate team building exercises using factory simulation games

## Prerequisites

- Minimum 2GB RAM (4GB recommended for modded servers)
- UDP port 34197 and TCP port 27015 accessible for game connections
- Port 8080 available for the web management interface
- Basic understanding of Factorio game mechanics and server concepts
- Admin credentials configured for manager authentication
- Sufficient disk space for save files, mods, and backup retention

## docker-compose.yml

```yaml
services:
  factorio:
    image: factoriotools/factorio:stable
    environment:
      - UPDATE_MODS_ON_START=true
      - SAVE_NAME=${SAVE_NAME:-default}
    volumes:
      - factorio-data:/factorio
    ports:
      - "34197:34197/udp"
      - "27015:27015"
    networks:
      - factorio-network
    restart: unless-stopped

  manager:
    image: mroote/factorio-server-manager:latest
    environment:
      - FACTORIO_DIR=/factorio
      - ADMIN_USER=${ADMIN_USER:-admin}
      - ADMIN_PASS=${ADMIN_PASS}
    volumes:
      - factorio-data:/factorio
      - manager-data:/opt/factorio-server-manager/app
    ports:
      - "8080:80"
    depends_on:
      - factorio
    networks:
      - factorio-network
    restart: unless-stopped

volumes:
  factorio-data:
  manager-data:

networks:
  factorio-network:
    driver: bridge
```

## .env

```bash
# Factorio Server
SAVE_NAME=default
ADMIN_USER=admin
ADMIN_PASS=secure_password
```

## Usage notes

- Game server on UDP 34197
- Manager UI at http://localhost:8080
- Mod management via UI
- Save game management
- Server configuration via web UI

## Troubleshooting

- Connection failed on port 34197: Verify UDP port forwarding is configured correctly on your router and firewall
- Manager shows 'Factorio not found': Ensure factorio-data volume is properly shared between containers and factorio service started first
- Mods failing to download: Check internet connectivity and verify mod portal is accessible, may require restart after network issues
- Save file corruption after container restart: Enable proper volume mounting and ensure graceful shutdown with SIGTERM handling
- High memory usage with large factories: Increase container memory limits and consider save file optimization or player count limits
- Manager UI returns 500 errors: Check manager-data volume permissions and verify ADMIN_PASS environment variable is properly set

