Use these instructions on the Factorio host with an account that can run
sudo. They assume the Ansible deployment layout.
/home/factorio/home/factorio/data/home/factorio/data/saves/home/factorio/data/config/home/factorio/backupsfactorio.serviceThe default game port is UDP 34197. Restarting the service keeps the current
world. Resetting the saves or creating a new world changes it.
On the server:
sudo systemctl status factorio --no-pager
cd /home/factorio
sudo docker compose ps
sudo docker compose logs --tail=100 factorio
Follow the live log while troubleshooting:
cd /home/factorio
sudo docker compose logs -f factorio
Use this after changing server settings or when the server is misbehaving. It leaves the saves untouched.
On the server:
sudo systemctl restart factorio
sudo systemctl status factorio --no-pager
To stop and start it separately:
sudo systemctl stop factorio
sudo systemctl start factorio
Stopping the server first makes the archive consistent. This backs up saves, configuration, and the other persistent Factorio data.
On the server:
sudo install -d -o factorio -g factorio -m 0750 /home/factorio/backups
sudo systemctl stop factorio
sudo tar -C /home/factorio \
-czf "/home/factorio/backups/factorio-data-$(date +%Y%m%d-%H%M%S).tar.gz" \
data
sudo systemctl start factorio
sudo systemctl status factorio --no-pager
List the available archives:
sudo ls -lh /home/factorio/backups
These backups are on the same disk as the server. They are useful for trying different worlds, but do not protect against loss of the host itself.
Replace BACKUP_FILE with the archive you want, for example
factorio-data-20260916-203000.tar.gz.
Inspect it first:
sudo tar -tzf "/home/factorio/backups/BACKUP_FILE" | head -30
Restore it on the server:
sudo systemctl stop factorio
sudo mv /home/factorio/data \
"/home/factorio/data.before-restore-$(date +%Y%m%d-%H%M%S)"
sudo tar -C /home/factorio \
-xzf "/home/factorio/backups/BACKUP_FILE"
sudo chown -R factorio:factorio /home/factorio/data
sudo systemctl start factorio
sudo systemctl status factorio --no-pager
The old data directory is moved aside rather than deleted, so the restore can be undone if needed. Use the same Factorio version that created the save.
This removes the active saves from the server's save directory while keeping a rollback copy. It does not remove the server password or other configuration.
On the server:
sudo systemctl stop factorio
sudo mv /home/factorio/data/saves \
"/home/factorio/data/saves.before-reset-$(date +%Y%m%d-%H%M%S)"
sudo install -d -o factorio -g factorio -m 0750 /home/factorio/data/saves
sudo systemctl start factorio
sudo systemctl status factorio --no-pager
Whether an empty saves directory automatically creates a new world depends on the Compose command and image configuration. If it does not, inspect the configured create/start command:
cd /home/factorio
grep -nE 'SAVE|CREATE|START|factorio' compose.yaml .env 2>/dev/null
Use the world-creation command defined there, then check the logs for the new save name.
Restore the corresponding factorio-data-*.tar.gz archive using the restore
procedure above.
Map-generation settings only affect a newly created world. Changing them does not alter an existing save.
/home/factorio/data/config/map-gen-settings.json.compose.yaml.Keep server-settings.json unless you intentionally want to change the server
name, description, visibility, password, or related settings.
Copy the save ZIP into the saves directory, then select it using the save-name
option defined by the deployment's compose.yaml or .env.
On the server:
sudo cp /path/to/world.zip /home/factorio/data/saves/
sudo chown factorio:factorio /home/factorio/data/saves/world.zip
cd /home/factorio
grep -nE 'SAVE|START|factorio' compose.yaml .env 2>/dev/null
sudo systemctl restart factorio
Map-generation settings are not applied to an existing save.