factorio is a free and open-source Factorio dedicated server. Dedicated server for Factorio factory building game
1. Prerequisites
2. Supported Operating Systems
This guide supports installation on:
3. Installation
RHEL/CentOS/Rocky Linux/AlmaLinux
# Install EPEL repository if needed
sudo dnf install -y epel-release
# Install factorio
sudo dnf install -y factorio
# Enable and start service
sudo systemctl enable --now factorio
# Configure firewall
sudo firewall-cmd --permanent --add-port=34197/tcp
sudo firewall-cmd --reload
# Verify installation
factorio --version
Debian/Ubuntu
# Update package index
sudo apt update
# Install factorio
sudo apt install -y factorio
# Enable and start service
sudo systemctl enable --now factorio
# Configure firewall
sudo ufw allow 34197
# Verify installation
factorio --version
Arch Linux
# Install factorio
sudo pacman -S factorio
# Enable and start service
sudo systemctl enable --now factorio
# Verify installation
factorio --version
Alpine Linux
# Install factorio
apk add --no-cache factorio
# Enable and start service
rc-update add factorio default
rc-service factorio start
# Verify installation
factorio --version
openSUSE/SLES
# Install factorio
sudo zypper install -y factorio
# Enable and start service
sudo systemctl enable --now factorio
# Configure firewall
sudo firewall-cmd --permanent --add-port=34197/tcp
sudo firewall-cmd --reload
# Verify installation
factorio --version
macOS
# Using Homebrew
brew install factorio
# Start service
brew services start factorio
# Verify installation
factorio --version
FreeBSD
# Using pkg
pkg install factorio
# Enable in rc.conf
echo 'factorio_enable="YES"' >> /etc/rc.conf
# Start service
service factorio start
# Verify installation
factorio --version
Windows
# Using Chocolatey
choco install factorio
# Or using Scoop
scoop install factorio
# Verify installation
factorio --version
Initial Configuration
Basic Configuration
# Create configuration directory
sudo mkdir -p /etc/factorio
# Set up basic configuration
# See official documentation for detailed configuration options
# Test configuration
factorio --version
5. Service Management
systemd (RHEL, Debian, Ubuntu, Arch, openSUSE)
# Enable service
sudo systemctl enable factorio
# Start service
sudo systemctl start factorio
# Stop service
sudo systemctl stop factorio
# Restart service
sudo systemctl restart factorio
# Check status
sudo systemctl status factorio
# View logs
sudo journalctl -u factorio -f
OpenRC (Alpine Linux)
# Enable service
rc-update add factorio default
# Start service
rc-service factorio start
# Stop service
rc-service factorio stop
# Restart service
rc-service factorio restart
# Check status
rc-service factorio status
rc.d (FreeBSD)
# Enable in /etc/rc.conf
echo 'factorio_enable="YES"' >> /etc/rc.conf
# Start service
service factorio start
# Stop service
service factorio stop
# Restart service
service factorio restart
# Check status
service factorio status
launchd (macOS)
# Using Homebrew services
brew services start factorio
brew services stop factorio
brew services restart factorio
# Check status
brew services list | grep factorio
Windows Service Manager
# Start service
net start factorio
# Stop service
net stop factorio
# Using PowerShell
Start-Service factorio
Stop-Service factorio
Restart-Service factorio
# Check status
Get-Service factorio
Advanced Configuration
See the official documentation for advanced configuration options.
Reverse Proxy Setup
nginx Configuration
upstream factorio_backend {
server 127.0.0.1:34197;
}
server {
listen 80;
server_name factorio.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name factorio.example.com;
ssl_certificate /etc/ssl/certs/factorio.example.com.crt;
ssl_certificate_key /etc/ssl/private/factorio.example.com.key;
location / {
proxy_pass http://factorio_backend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Apache Configuration
<VirtualHost *:80>
ServerName factorio.example.com
Redirect permanent / https://factorio.example.com/
</VirtualHost>
<VirtualHost *:443>
ServerName factorio.example.com
SSLEngine on
SSLCertificateFile /etc/ssl/certs/factorio.example.com.crt
SSLCertificateKeyFile /etc/ssl/private/factorio.example.com.key
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:34197/
ProxyPassReverse / http://127.0.0.1:34197/
</VirtualHost>
HAProxy Configuration
frontend factorio_frontend
bind *:80
bind *:443 ssl crt /etc/ssl/certs/factorio.pem
redirect scheme https if !{ ssl_fc }
default_backend factorio_backend
backend factorio_backend
balance roundrobin
server factorio1 127.0.0.1:34197 check
Security Configuration
Basic Security Setup
# Set appropriate permissions
sudo chown -R factorio:factorio /etc/factorio
sudo chmod 750 /etc/factorio
# Configure firewall
sudo firewall-cmd --permanent --add-port=34197/tcp
sudo firewall-cmd --reload
# Enable SELinux policies (if applicable)
sudo setsebool -P httpd_can_network_connect on
Database Setup
See official documentation for database configuration requirements.
Performance Optimization
System Tuning
# Basic system tuning
echo 'net.core.somaxconn = 65535' | sudo tee -a /etc/sysctl.conf
echo 'net.ipv4.tcp_max_syn_backlog = 65535' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
Monitoring
Basic Monitoring
# Check service status
sudo systemctl status factorio
# View logs
sudo journalctl -u factorio -f
# Monitor resource usage
top -p $(pgrep factorio)
9. Backup and Restore
Backup Script
#!/bin/bash
# Basic backup script
BACKUP_DIR="/backup/factorio"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p "$BACKUP_DIR"
tar -czf "$BACKUP_DIR/factorio-backup-$DATE.tar.gz" /etc/factorio /var/lib/factorio
echo "Backup completed: $BACKUP_DIR/factorio-backup-$DATE.tar.gz"
Restore Procedure
# Stop service
sudo systemctl stop factorio
# Restore from backup
tar -xzf /backup/factorio/factorio-backup-*.tar.gz -C /
# Start service
sudo systemctl start factorio
6. Troubleshooting
Common Issues
1. Service won't start:
# Check logs
sudo journalctl -u factorio -n 100
sudo tail -f /var/log/factorio/factorio.log
# Check configuration
factorio --version
# Check permissions
ls -la /etc/factorio
2. Connection issues:
# Check if service is listening
sudo ss -tlnp | grep 34197
# Test connectivity
telnet localhost 34197
# Check firewall
sudo firewall-cmd --list-all
3. Performance issues:
# Check resource usage
top -p $(pgrep factorio)
# Check disk I/O
iotop -p $(pgrep factorio)
# Check connections
ss -an | grep 34197
Integration Examples
Docker Compose Example
version: '3.8'
services:
factorio:
image: factorio:latest
ports:
- "34197:34197"
volumes:
- ./config:/etc/factorio
- ./data:/var/lib/factorio
restart: unless-stopped
Maintenance
Update Procedures
# RHEL/CentOS/Rocky/AlmaLinux
sudo dnf update factorio
# Debian/Ubuntu
sudo apt update && sudo apt upgrade factorio
# Arch Linux
sudo pacman -Syu factorio
# Alpine Linux
apk update && apk upgrade factorio
# openSUSE
sudo zypper update factorio
# FreeBSD
pkg update && pkg upgrade factorio
# Always backup before updates
tar -czf /backup/factorio-pre-update-$(date +%Y%m%d).tar.gz /etc/factorio
# Restart after updates
sudo systemctl restart factorio
Regular Maintenance
# Log rotation
sudo logrotate -f /etc/logrotate.d/factorio
# Clean old logs
find /var/log/factorio -name "*.log" -mtime +30 -delete
# Check disk usage
du -sh /var/lib/factorio
Additional Resources
---
Note: This guide is part of the HowToMgr collection. Always refer to official documentation for the most up-to-date information.