{"id":31059947,"url":"https://github.com/developer239/factorio-headless-server-gcp","last_synced_at":"2025-09-15T09:54:57.735Z","repository":{"id":314200423,"uuid":"1054456566","full_name":"developer239/factorio-headless-server-gcp","owner":"developer239","description":"Deploy Factorio headless server on Google Cloud Platform using Terraform. Designed for small gaming groups with simple start/stop controls and service account management.","archived":false,"fork":false,"pushed_at":"2025-09-11T02:58:18.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-11T06:09:46.883Z","etag":null,"topics":["factorio","factorio-headless-server","gcp","server","terrraform"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developer239.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-10T21:38:30.000Z","updated_at":"2025-09-11T02:58:21.000Z","dependencies_parsed_at":"2025-09-11T06:09:49.416Z","dependency_job_id":"c8e79822-76a1-44e3-bad1-3e6ba2ddcd2a","html_url":"https://github.com/developer239/factorio-headless-server-gcp","commit_stats":null,"previous_names":["developer239/factorio-headless-server-gcp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/developer239/factorio-headless-server-gcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Ffactorio-headless-server-gcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Ffactorio-headless-server-gcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Ffactorio-headless-server-gcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Ffactorio-headless-server-gcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developer239","download_url":"https://codeload.github.com/developer239/factorio-headless-server-gcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Ffactorio-headless-server-gcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275239379,"owners_count":25429489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["factorio","factorio-headless-server","gcp","server","terrraform"],"created_at":"2025-09-15T09:54:53.499Z","updated_at":"2025-09-15T09:54:57.713Z","avatar_url":"https://github.com/developer239.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Factorio Headless Server on GCP with Terraform\n\nDeploy Factorio headless server on Google Cloud Platform using Terraform with HTTP API controls. Designed for small\ngaming groups with remote server management via HTTP endpoints.\n\n## Setup\n\n### 1. Authentication\n\nLogin to GCP and set up your environment:\n\n```bash\ngcloud auth login\n```\n\nSet your project:\n\n```bash\ngcloud config set project YOUR_PROJECT_ID\n```\n\nAuthenticate application default credentials so that Terraform can use them:\n\n```bash\ngcloud auth application-default login\n```\n\nEnable required APIs:\n\n```bash\ngcloud services enable compute.googleapis.com\ngcloud services enable iam.googleapis.com\n```\n\nYou might want to connect the project to your billing account.\n\n### 2. Configuration\n\nCreate and configure: `terraform.tfvars` you only need to update _project_id_ to run the server.\n\n```bash\ncp terraform.tfvars.example terraform.tfvars\n```\n\n### 3. Deploy\n\nNote that the terraform state file will be created in the current directory and is not configured for remote storage.\n\n```bash\nterraform init\nterraform apply\n```\n\nDeployment takes a couple of minutes.\n\nThen you need to wait a couple of minutes for the Factorio server to start.\n\n### 4. Get Server Information\n\nAfter deployment, get connection details:\n\n```bash\n# Get server IP for Factorio game connections\nterraform output connection_string\n\n# Get HTTP API URL for management\nterraform output http_api_url\n\n# Get server IP only\nterraform output server_ip\n\n# API Usage\nterraform output api_usage\n```\n\n## Server Control\n\nIf you want to pass management commands using a service account key instead of application default credentials, create a\njson key for the service account created by Terraform:\n\n```bash\ngcloud iam service-accounts keys create ./factorio-management-key.json \\\n  --iam-account=factorio-management-sa@YOUR_PROJECT_ID.iam.gserviceaccount.com \n```\n\nThe management key can be used on any machine with gcloud installed:\n\n```bash\ngcloud auth activate-service-account --key-file=factorio-management-key.json\ngcloud config set project YOUR_PROJECT_ID\n```\n\n**Commands:**\n\n- `./scripts/start-server.sh` - Start the Factorio server\n- `./scripts/stop-server.sh` - Stop the Factorio server\n\n## Server Management via HTTP API\n\nOnce deployed, the server exposes an HTTP API on port 8080 for remote management. Get the API URL from terraform\noutputs:\n\n```bash\nterraform output http_api_url\n```\n\n### Game Controls\n\n**Check Server Status:**\n\n```bash\ncurl http://YOUR_SERVER_IP:8080/factorio/status\n```\n\n**Pause/Unpause Game:**\n\n```bash\ncurl -X POST http://YOUR_SERVER_IP:8080/factorio/pause\ncurl -X POST http://YOUR_SERVER_IP:8080/factorio/unpause\n```\n\n**Control Game Speed:**\n\n```bash\ncurl -X POST http://YOUR_SERVER_IP:8080/factorio/speed/slow\ncurl -X POST http://YOUR_SERVER_IP:8080/factorio/speed/normal\ncurl -X POST http://YOUR_SERVER_IP:8080/factorio/speed/fast\n```\n\n### Save File Management\n\n**List Save Files:**\n\n```bash\ncurl http://YOUR_SERVER_IP:8080/factorio/saves\n```\n\n**Load Existing Save:**\n\n```bash\ncurl -X POST http://YOUR_SERVER_IP:8080/factorio/load/SAVE_NAME\n```\n\n**Upload and Load Save File:**\n\n```bash\ncurl -X POST http://YOUR_SERVER_IP:8080/factorio/upload-save \\\n  -F \"saveFile=@/path/to/your/save.zip\" \\\n  -F \"autoLoad=true\"\n```\n\n**Trigger Manual Save:**\n\n```bash\ncurl -X POST http://YOUR_SERVER_IP:8080/factorio/save\n```\n\n**Get Server Time:**\n\n```bash\ncurl http://YOUR_SERVER_IP:8080/factorio/time\n```\n\n## Troubleshooting\n\n- `gcloud compute ssh factorio-server --zone=europe-west4-a --tunnel-through-iap` ssh using IAP\n- `sudo systemctl status docker` check Docker status\n- `sudo docker logs factorio` view Factorio container logs\n- `cat /factorio/config/server-adminlist.json` view Factorio admin list\n- `sudo docker ps | grep factorio` check container status\n- `sudo docker logs $(sudo docker ps -q | head -1) --tail 50` view recent container logs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper239%2Ffactorio-headless-server-gcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper239%2Ffactorio-headless-server-gcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper239%2Ffactorio-headless-server-gcp/lists"}