Prerequisites:
- Clone the repository
- gcloud CLI installed
- Paste the service account key JSON file created during Terraform deployment into the repository root and name it
factorio-management-key.json. - Authenticate gcloud using the service account key:
gcloud auth activate-service-account --key-file=factorio-management-key.json- Set your project:
gcloud config set project private-factorio-server- You are good to go! Use the scripts in the
scriptsdirectory to manage your Factorio server.
Commands:
./scripts/start-server.sh- Start the Factorio server./scripts/stop-server.sh- Stop the Factorio server
Once the server is running, you can manage it remotely via HTTP API on port 8080:
# Get server IP from terraform
SERVER_IP=$(cd /path/to/terraform && terraform output -raw server_ip)
# Check server status
curl http://$SERVER_IP:8080/factorio/status
# Get API URL directly
curl http://$SERVER_IP:8080/factorio/time# List all saves
curl http://$SERVER_IP:8080/factorio/saves
# Load a specific save
curl -X POST http://$SERVER_IP:8080/factorio/load/default
# Upload and auto-load save
curl -X POST http://$SERVER_IP:8080/factorio/upload-save \
-F "saveFile=@/path/to/save.zip" \
-F "autoLoad=true"# Pause/unpause
curl -X POST http://$SERVER_IP:8080/factorio/pause
curl -X POST http://$SERVER_IP:8080/factorio/unpause
# Speed controls
curl -X POST http://$SERVER_IP:8080/factorio/speed/slow
curl -X POST http://$SERVER_IP:8080/factorio/speed/normal
curl -X POST http://$SERVER_IP:8080/factorio/speed/fast