{"id":18157176,"url":"https://github.com/panuozzo77/factorio_updater_headless","last_synced_at":"2026-04-18T17:02:27.632Z","repository":{"id":260699129,"uuid":"878376666","full_name":"panuozzo77/factorio_updater_headless","owner":"panuozzo77","description":"Automated updater and server manager for a Factorio headless server on Linux. Uses tmux and systemd for seamless version checks, updates, and server boot up, stop \u0026 start only when updating.","archived":false,"fork":false,"pushed_at":"2024-11-01T22:14:37.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T07:41:41.631Z","etag":null,"topics":["auto-updater","bash-script","factorio","factorio-server","game-server","linux","self-hosted","server-automation","shell-script","systemd","tmux"],"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/panuozzo77.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}},"created_at":"2024-10-25T09:23:49.000Z","updated_at":"2024-11-01T22:14:41.000Z","dependencies_parsed_at":"2024-11-01T23:29:02.673Z","dependency_job_id":null,"html_url":"https://github.com/panuozzo77/factorio_updater_headless","commit_stats":null,"previous_names":["panuozzo77/factorio_updater_headless"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panuozzo77%2Ffactorio_updater_headless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panuozzo77%2Ffactorio_updater_headless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panuozzo77%2Ffactorio_updater_headless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/panuozzo77%2Ffactorio_updater_headless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/panuozzo77","download_url":"https://codeload.github.com/panuozzo77/factorio_updater_headless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247583828,"owners_count":20962068,"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","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":["auto-updater","bash-script","factorio","factorio-server","game-server","linux","self-hosted","server-automation","shell-script","systemd","tmux"],"created_at":"2024-11-02T06:05:35.227Z","updated_at":"2026-04-18T17:02:22.584Z","avatar_url":"https://github.com/panuozzo77.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Factorio_updater_headless\n\n# Project Structure\n\n```markdown\nyour pc\n├── factorio_root_folder\n│   ├── factorio                  # Root folder containing Factorio game files\n│   ├── factorio-installed.tar.xz # Downloaded archive of the latest Factorio version\n│   ├── factorio_sha256sums.txt   # Checksum file for verifying the Factorio version\n│   ├── logfile.log               # Log file to track update events and errors\n│   ├── **start.sh**                  # Script to start the Factorio server\n│   └── **updater.sh**                # Main update script for downloading and applying updates\n└── systemd_daemons\n    ├── **factorio-updater.service**   # Systemd service to run the updater script\n    ├── factorio-updater.timer     # Systemd timer to schedule the updater service\n    ├── **start_tmux.sh**              # Script to start a tmux session for running Factorio\n    └── **tmux_session.service**       # Systemd service to start the tmux session at boot\n```\n\n## What you need to do\n### Prerequisites:\n- A Linux server with **tmux**, **curl**, **wget**, **rsync** and **systemd** installed.\n- An active Factorio headless server installation.\n- Basic understanding of using bash, tmux, and systemd.\n\n### Step-by-Step Setup\n1. Place Files in the Correct Locations\n    - Move the factorio_root_folder to the desired location on your server, e.g., /home/criadmin/factorio_root_folder.\n    - Place the updater.sh and start.sh scripts inside factorio_root_folder.\n    - Place factorio-updater.service, factorio-updater.timer, start_tmux.sh, and tmux_session.service into /etc/systemd/system/.\n2. Configure the [start.sh](factorio_root_folder/start.sh) Script\n    - This script is responsible for launching the Factorio server. Make sure to update the path in the script to point to your Factorio installation. Adjust the --start-server with the arguments you like\n\n```bash\n#!/bin/bash\n# Start the Factorio server\n../factorio_root_folder/factorio/bin/x64/factorio --start-server ../factorio_root_folder/saves/my-save.zip\n```\n3. Configure the [updater.sh] Script\n    - Even if it's \"PERFECT\" I don't know if you'd like how it works, so change it if you wish to.\n    - The [updater.sh](/factorio_root_folder/updater.sh) script 1) checks for new Factorio versions, 2) downloads updates if available, and 3) restarts the server. Ensure the paths in the script are correct, especially the following variables:\n```bash\nLATEST_RELEASES_URL=\"https://factorio.com/api/latest-releases\"  # URL for latest releases\nINSTALLED_TAR=\"factorio-installed.tar.xz\"  # Path to installed tar.xz\nFACTORIO_DIR=\"factorio\"  # Directory containing Factorio files\nLOG_FILE=\"logfile.log\"  # Change this to your desired log file path\n\nTMUX_SESSION=\"mysession\"  # Name of your tmux session\nFACTORIO_WINDOW=\"factorio\" # Name of the tmux window running Factorio\n```\n4. Create and Configure [tmux-session.service](/systemd_daemons/tmux_session.service)\n    - This service will start the tmux session automatically at boot. In the tmux-session.service file, make sure to update \u003cyour_directory\u003e in ExecStart to point to the actual path where start_tmux.sh resides.\n\n5. Create and Configure [factorio-updater.timer](/systemd_daemons/factorio-updater.timer)\n    - The timer triggers the updater script on a set schedule. In this example, it’s set to check for updates every hour.\n\n6. Create [start_tmux.sh](/systemd_daemons/start_tmux.sh)\n    - This script initializes the tmux session and sets up the windows for the Factorio server.\n    - You can place it wherever you want\n\n7. Enable and Start the Systemd Services\n    - Run the following commands to enable and start the necessary services:\n    ```bash\n    sudo systemctl daemon-reload\n    sudo systemctl enable tmux-session.service\n    sudo systemctl start tmux-session.service\n    sudo systemctl enable factorio-updater.timer\n    sudo systemctl start factorio-updater.timer\n    ```\n8. Logs and Troubleshooting\n    - Logs for the tmux session are written to /tmp/tmux-session.log, while Factorio update logs are in factorio_root_folder [logfile.log](/factorio_root_folder/logfile.log). Use these to troubleshoot any issues. \n    - If everything works fine, you should see a log like this written each hour:\n    ```bash\n    2024-10-25 11:00:00 - You are using the latest version (2.0.9). No update needed.\n    2024-10-25 11:00:00 - Update process completed.\n    2024-10-24 12:20:34 - A new version (factorio_linux_2.0.10.tar.xz) is available.\n    2024-10-24 12:20:36 - Attempting to stop Factorio server...\n    2024-10-24 12:20:36 - Sending /quit command to tmux session: mysession, window: factorio\n    2024-10-24 12:20:36 - Command sent successfully.\n    2024-10-24 12:20:41 - Factorio server has stopped.\n    2024-10-24 12:20:41 - Updating Factorio server...\n    2024-10-24 12:20:48 - Update process completed.\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanuozzo77%2Ffactorio_updater_headless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpanuozzo77%2Ffactorio_updater_headless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpanuozzo77%2Ffactorio_updater_headless/lists"}