{"id":29081591,"url":"https://github.com/addono/spt-server","last_synced_at":"2025-06-27T19:40:09.822Z","repository":{"id":294904412,"uuid":"935007422","full_name":"Addono/spt-server","owner":"Addono","description":"Fly.io deployment configuration for hosting your own SPT Server","archived":false,"fork":false,"pushed_at":"2025-05-22T16:03:35.000Z","size":287,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"3.11","last_synced_at":"2025-05-22T17:08:18.487Z","etag":null,"topics":["game-server","self-hosted","spt","tarkov"],"latest_commit_sha":null,"homepage":"https://gh.aknapen.nl/spt-server/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Addono.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-02-18T18:53:33.000Z","updated_at":"2025-05-22T16:03:39.000Z","dependencies_parsed_at":"2025-05-22T17:10:37.157Z","dependency_job_id":"360d2cac-5113-4815-9cea-b51532b1ab50","html_url":"https://github.com/Addono/spt-server","commit_stats":null,"previous_names":["addono/spt-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Addono/spt-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fspt-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fspt-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fspt-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fspt-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Addono","download_url":"https://codeload.github.com/Addono/spt-server/tar.gz/refs/heads/3.11","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2Fspt-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262320653,"owners_count":23293257,"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":["game-server","self-hosted","spt","tarkov"],"created_at":"2025-06-27T19:40:05.508Z","updated_at":"2025-06-27T19:40:09.781Z","avatar_url":"https://github.com/Addono.png","language":"Shell","readme":"# SPT Server on Fly.io\n\nThis repository helps creating and managing an SPT server on [Fly.io](https://fly.io).\n\n## Table of Contents\n- [SPT Server](#spt-server)\n  - [Table of Contents](#table-of-contents)\n  - [What's Included](#whats-included)\n  - [Setup](#setup)\n    - [(Optional) GitHub Repository](#optional-github-repository)\n    - [Fly.io](#flyio)\n    - [(Optional) GitHub Actions](#optional-github-actions)\n      - [Backups](#backups)\n  - [Cost](#cost)\n  - [Customizing Your Server](#customizing-your-server)\n    - [Adding or Removing Mods](#adding-or-removing-mods)\n    - [Changing the SPT Version](#changing-the-spt-version)\n    - [Changing the Fika Version](#changing-the-fika-version)\n    - [Changing Server Resources and Provisioning](#changing-server-resources-and-provisioning)\n      - [Adjusting Resources (CPU \\\u0026 Memory)](#adjusting-resources-cpu--memory)\n      - [Always-On vs. Scale-to-Zero](#always-on-vs-scale-to-zero)\n      - [Enabling Swap (Extra Memory)](#enabling-swap-extra-memory)\n  - [References](#references)\n  - [Contributing](#contributing)\n\n## What's Included\n\nThis repository provides a simple setup for hosting a modded SPT (Single Player Tarkov) server on Fly.io. It automates deployment, mod management, scaling, and backups, making it easy to run and maintain a custom Tarkov server in the cloud with minimal manual intervention and on a budget.\n\nAmong other things, it includes:\n\n- 🚀 **Fly.io deployment configuration**: Pre-configured `fly.toml` and Dockerfile to deploy the SPT server to Fly.io, including automatic scale-to-zero when no users are connected to the server.\n- 🛠️ **Automated mod installation**: Installs a curated set of mods automatically from URLs defined in `fly.toml`.\n- ⚙️ **Custom mod configuration**: Example custom configs for mods (e.g., SVM and Lotus) included in the `mount/` directory. This config is automatically copied to the server on deployment, making it easier to manage it from Git and avoiding the need to SSH into the server.\n- 🔄 **Automated Startup Modifications**: Handles mod setup, applying config stored in Git, and applies Linux compatibility fixes on container start.\n- 💾 **Automated Backups**: Daily backups of player profiles using GitHub Actions, storing them as artifacts in the repository. This allows you to restore player profiles in case of profile corruption or data loss.\n- 🌐 **Remote Deploys**: Deploys can either be triggered locally or remotely via GitHub Actions, allowing you to manage the server from anywhere.\n\nAnd probably the best part, it's really cheap! See the [Cost](#cost) section for more details, but spoiler: my bill has been waived every month so far as it never goes over $5. 💸\n\n## Setup\n\n### (Optional) GitHub Repository\n\n\u003e [!NOTE]\n\u003e In case you do not want to use GitHub, you can just download this repository and work on it locally:\n\u003e\n\u003e \u003cimg width=\"200\" alt=\"image\" src=\"https://github.com/user-attachments/assets/71be58ec-8491-4742-a041-87e69cf04d78\" /\u003e\n\u003e\n\u003e Skip this step and go straight to the step on [deploying to Fly.io](#flyio). \n\n\nIf you want to use this repository as a template for your own SPT server, you can fork this repository and store any changes you make in your fork. Using GitHub (or Git in general) is optional, but recommended if you want to keep track of changes or contribute back to the original repository.\n\nLogin to GitHub and click on the fork-button on the top right of the page. This will create a copy of this repository in your GitHub account. \n\n\u003cimg width=\"333\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b549f636-7304-43c3-8c0d-646f7931ea97\" /\u003e\n\nAlternatively, if you have the GitHub CLI installed, you can fork the repository using the following command:\n\n```bash\ngh repo fork Addono/spt-server\n```\n\n### Fly.io\n\n\u003e [!NOTE]  \n\u003e This guide assumes you have a Fly.io account and the `flyctl` CLI tool installed. If you don't have these, please refer to the [Fly.io documentation](https://fly.io/docs/getting-started/) for setup instructions.\n\nFirst of all, pick a globally unique name for your server. This will be used as the subdomain for your server, e.g. `https://\u003cSERVER NAME\u003e.fly.dev`. Alternatively, omit it when creating the server and let Fly.io generate a random name for you.\n\nCreate an app on Fly.io:\n\n```bash\nflyctl apps create \u003cSERVER NAME\u003e\n```\n\nUpdate the `fly.toml` file with your server name, add a new line:\n\n```toml\napp = \"\u003cSERVER NAME\u003e\"\n```\n\nNow deploy your app:\n\n```bash\nfly deploy\n```\n\nIn the output, you will see a URL like `https://\u003cSERVER NAME\u003e.fly.dev` where your SPT server is now running. In your SPT launcher, you can now configure it to connect to `https://\u003cSERVER NAME\u003e.fly.dev:6969`.\n\nClients with ModSync installed will automatically download all required mods on boot, as such it's highly recommended that all clients do this.\n\nAfter the first deployment, it is important to check whether all mods have been successfully downloaded and extracted. You can do this by SSHing into the server and checking the folder `./mod_downloads/remains`:\n\n```bash\n❯ fly ssh console\nConnecting to \u003cyour server IP\u003e... complete\nroot@\u003cmachine ID\u003e:/opt/server# cd mod_download/remains/\n```\nAny files in this folder are mods that have not been successfully downloaded or extracted. Manually move them to the `./mods` folder to make them available to the server. For more information on how to manage mods, see [fika-spt-server-docker](https://github.com/zhliau/fika-spt-server-docker?tab=readme-ov-file#-running) documentation.\n\n### (Optional) GitHub Actions\n\nGitHub Actions is an optional tool to automate some tasks, currently only for creating backups. To use it, you need to set up the following secrets:\n\n```bash\nflyctl tokens create deploy | gh secret set FLY_API_TOKEN\n```\n\nAlternatively to creating it through the CLI, create a deploy token manually and set it as `FLY_API_TOKEN` in the repository secrets.\n\n\n#### Backups\n\nThe GitHub Action for creating backups is configured to, on a schedule, pull down all the profiles from the SPT server and storing those in GHA artifacts.\n\n**Retention** Artifacts are **not** retained permanently, the retention period can be configured (30 days by default, although it can be updated to 90 days). To access the backups, open the latest run of the backup profile workflow and download the artifacts.\n\n**Schedule**: Backups run daily at 00:00 UTC. To change this, edit the `schedule` in [`.github/workflows/backup-profiles.yml`](.github/workflows/backup-profiles.yml). \n\n**Testing** To test the action instead of waiting for the schedule to kick-in, you can manually dispatch it.\n\n## Cost\n\nThis setup is designed to be budget-friendly. The pricing model of Fly.io is pay-per-use. In addition, the server will scale to zero when no users are connected, meaning you only pay for the time the server is actually running.\n\nYou can tweak the resources available to the server in the `fly.toml` file, for example, by changing the `vm.memory` and `vm.cpus` settings. The default settings are usually sufficient for a small SPT server with a few players.\n\nThe only constant-cost would be storage, which is a couple of cents per GB per month.\n\nIn our experiences, our bill has been around $2-3 a month. Fly.io typically doesn't invoice you for bills under $5 each month, thus the server has effectively been free.\n\n## Customizing Your Server\n\nYou can easily customize your SPT server setup to fit your needs. Here are the main ways to tailor your deployment:\n\n### Adding or Removing Mods\n\nTo add or remove mods, edit the `MOD_URLS_TO_DOWNLOAD` environment variable in your `fly.toml` file. This variable contains a list of mod download URLs. Simply add new URLs (one per line) to install more mods, or remove lines to exclude mods you don't want. Changes will take effect on the next deployment.\n\n- **File:** `fly.toml`\n- **Section:** `[env]` → `MOD_URLS_TO_DOWNLOAD`\n\n### Changing the SPT Version\n\nThe SPT version is determined by the Docker image specified in your `Dockerfile`. To change the SPT version, update the image tag in the `FROM` line. For example:\n\n```\nFROM ghcr.io/zhliau/fika-spt-server-docker:3.11.3\n```\n\nReplace `3.11.3` with the desired version. See the [fika-spt-server-docker releases](https://github.com/zhliau/fika-spt-server-docker/pkgs/container/fika-spt-server-docker) for available tags.\n\n- **File:** `Dockerfile`\n- **Line:** `FROM ghcr.io/zhliau/fika-spt-server-docker:\u003cversion\u003e`\n\n### Changing the Fika Version\n\nThe Fika version is set in the `FIKA_VERSION` environment variable in your `fly.toml` file. To use a different version, change the value of `FIKA_VERSION`:\n\n```\nFIKA_VERSION = 'v2.4.8'\n```\n\nReplace `'v2.4.8'` with the version you want. Make sure the version is compatible with your chosen SPT version.\n\n- **File:** `fly.toml`\n- **Section:** `[env]` → `FIKA_VERSION`\n\n### Changing Server Resources and Provisioning\n\nYou can further customize how your SPT server is provisioned on Fly.io by editing the `fly.toml` file. This allows you to balance cost, performance, and availability according to your needs.\n\n#### Adjusting Resources (CPU \u0026 Memory)\n\nThe `[vm]` section in `fly.toml` controls the amount of memory and CPU allocated to your server:\n\n```toml\n[vm]\n  memory = '3gb'   # Increase for better performance, decrease to save cost\n  cpu_kind = 'shared' # Can be 'shared' or 'performance' (dedicated)\n  cpus = 2        # Number of CPU cores\n```\n- **More resources** improve server performance, especially with many mods or players, but increase cost.\n- **Fewer resources** reduce cost but may impact performance.\n\n#### Always-On vs. Scale-to-Zero\n\nBy default, the server is configured to scale to zero (suspend) when not in use, minimizing costs:\n\n```toml\n[http_service]\n  auto_stop_machines = \"suspend\"  # Scale to zero when idle\n  min_machines_running = 0         # No always-on machines\n```\n- **To keep the server always on**, set `auto_stop_machines` to `false` and `min_machines_running` to `1`:\n  ```toml\n  [http_service]\n    auto_stop_machines = false\n    min_machines_running = 1\n  ```\n- **Tradeoff:** Always-on servers are more responsive but incur higher costs, as you pay for uptime even when no one is playing.\n\n#### Enabling Swap (Extra Memory)\n\nYou can enable swap to provide extra (slower) memory, which can help avoid out-of-memory errors without increasing RAM size:\n\n```toml\n# swap_size_mb = 1024  # Enable for 1GB swap (uncomment to use)\n```\n- **Note:** Swap is not compatible with scale-to-zero (suspend mode). Only enable swap if your server is always on.\n- **Tradeoff:** Swap is slower than RAM but can prevent crashes due to memory exhaustion. Useful for mod-heavy servers.\n\n## References\n\n- [Fly.io Documentation](https://fly.io/docs/reference/configuration/)\n- [fika-spt-server-docker GitHub Repository](https://github.com/zhliau/fika-spt-server-docker)\n- [Fika Project Wiki](https://project-fika.gitbook.io/wiki)\n- [Dockerfile Reference](https://docs.docker.com/engine/reference/builder/)\n- [Bash Scripting Guide](https://www.gnu.org/software/bash/manual/bash.html)\n- [GitHub Actions Documentation](https://docs.github.com/en/actions)\n- [TOML Language Documentation](https://toml.io/en/)\n- [Linux Command Line Basics](https://ubuntu.com/tutorials/command-line-for-beginners)\n\nFor more details, see the comments in `fly.toml` and the rest of this README and codebase for configuration and customization options.\n\n## Contributing\n\nPlease see the [CONTRIBUTING.md](CONTRIBUTING.md) file for detailed guidelines on how to contribute, including the process for submitting issues and merge requests.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fspt-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddono%2Fspt-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fspt-server/lists"}