No description
  • Shell 88.6%
  • Dockerfile 11.4%
Find a file
Chris Toph 49f7c6f29a
All checks were successful
Docker / build (x86_64_v3, v3) (push) Successful in 47s
Docker / build (x86_64_v4, v4) (push) Successful in 1m0s
fix: improve server initialization and configuration handling
2026-03-07 23:41:02 -05:00
.forgejo/workflows feat: add proton cachy v3 option 2026-03-07 19:34:39 -05:00
bin fix: improve server initialization and configuration handling 2026-03-07 23:41:02 -05:00
.dockerignore init 2026-03-07 15:45:40 -05:00
.gitignore init 2026-03-07 15:45:40 -05:00
docker-compose.yml fix: improve server initialization and configuration handling 2026-03-07 23:41:02 -05:00
Dockerfile feat: add proton cachy v3 option 2026-03-07 19:34:39 -05:00
LICENSE init 2026-03-07 15:45:40 -05:00
README.md fix: improve server initialization and configuration handling 2026-03-07 23:41:02 -05:00

Astroneer Dedicated Server (Docker)

A simple Docker setup for running an Astroneer dedicated server on Linux. It uses Wine (from Proton-CachyOS) to run the Windows server binary headlessly.

Inspired by birdhimself/astroneer-docker and barumel/docker-astroneer-server, but takes a different approach: no extra launcher tools, no JavaScript wrapper; just a Fish shell entrypoint that talks directly to Wine and steamcmd.

Requirements

  • Docker and Docker Compose
  • Linux host with x86_64 CPU (AVX2 minimum)
  • (Optional) NTSync support in your kernel for better Wine performance (/dev/ntsync)

Image Variants

Two images are published to the registry:

Tag CPU Requirement Use When
:v3 AVX2 (most CPUs from ~2015+) Default — works on most hardware
:v4 AVX-512 (some Intel/AMD CPUs) You know your CPU supports AVX-512

Check your CPU with grep -o 'avx512f' /proc/cpuinfo. If it returns nothing, use :v3.

Quick Start

  1. Clone the repo and cd into it.

  2. Create a .env file with your server settings:

ASTRO_SERVER_NAME=My Astroneer Server
ASTRO_SERVER_PASSWORD=changeme
ASTRO_SERVER_OWNER_NAME=YourSteamName
  1. Set the image tag in your compose file (:v3 or :v4):
image: git.ryot.foo/toph/astroneer-docker:v3
  1. Start the server:
docker compose up -d

The first boot takes a while -- it downloads the game files via steamcmd and sets up Wine. After that, restarts are fast because everything is cached in the ./data/ directory.

  1. Check the logs:
docker compose logs -f

Environment Variables

Variable Required Default Description
ASTRO_SERVER_NAME Yes -- Name shown in the server browser
ASTRO_SERVER_PASSWORD Yes -- Password to join the server
ASTRO_SERVER_OWNER_NAME Yes -- Steam name of the server owner
ASTRO_SERVER_PORT No 5520 UDP port the server listens on
ASTRO_SERVER_PUBLIC_IP No Auto-detected Public IP address for the server
ASTRO_SERVER_DOMAIN_NAME No -- Domain name to resolve for the public IP
ASTRO_SERVER_AUTO_SAVE_INTERVAL No 60 Auto-save interval in seconds

If you don't set ASTRO_SERVER_PUBLIC_IP or ASTRO_SERVER_DOMAIN_NAME, the entrypoint will auto-detect your public IP using ipify.org.

Data and Persistence

All game data lives in bind-mounted directories on your host:

./data/astroneer/   - Game files, saves, Wine prefix (everything the server needs)
./data/backup/      - Automatic backups

Don't delete ./data/astroneer/ unless you want a fresh install. The Wine prefix and game files are cached there so you don't have to wait for setup again.

Backups

The server automatically backs up your save files every 10 minutes. Older backups get moved to a daily/ folder every hour.

./data/backup/              - Recent backups (last hour)
./data/backup/daily/        - Older backups (one per day)
./data/backup/restore/      - Drop files here to restore them

Restoring a Save

  1. Stop the server: docker compose down
  2. Copy the .savegame file you want to restore into ./data/backup/restore/
  3. Start the server: docker compose up -d

The entrypoint will pick up the file and put it in the right place on boot.

Health Checks

The entrypoint watches for corrupted or duplicate save files every 20 seconds. If it detects a problem, it automatically copies the latest good backup to the restore folder and restarts the container. With restart: always in the compose file, it comes back up on its own.

NTSync

The compose file passes through /dev/ntsync from the host. This is a Linux kernel feature that speeds up Wine's thread synchronization. If your kernel supports it, the server will use it automatically. If not, you can remove the devices section from docker-compose.yml and things will still work fine -- just a bit slower.

How It Works

The whole startup flow is handled by a single Fish shell script:

  1. Updates steamcmd and installs/updates the Astroneer server (with retry logic)
  2. On first run, sets up a Wine prefix and copies the needed DLLs from Proton
  3. Generates the server config files if they don't exist yet
  4. Applies your environment variables to the config files
  5. Restores any saves from the restore folder
  6. Starts the server with Wine
  7. Runs the backup and health check loops in the background
  8. Handles graceful shutdown on SIGTERM/SIGINT

The Windows server binary runs through Wine from Proton-CachyOS. It uses software Vulkan rendering (Mesa lavapipe) so no GPU is needed. The server communicates over UDP, not TCP.

Ports

The server uses UDP port 5520 by default. Make sure your firewall and port forwarding are set up for UDP, not TCP.

Troubleshooting

Server won't start / crashes with segfault

  • The compose file includes init: true and security_opt: [seccomp:unconfined]. Both are required — init prevents Wine from crashing when Fish runs as PID 1, and seccomp:unconfined allows system calls that Wine needs. If you removed either, add them back.
  • Check the logs with docker compose logs. Make sure all three required env vars are set.
  • If the server crashes silently, you might be using :v4 on a CPU without AVX-512. Switch to :v3.

Server starts but exits after ~60 seconds

  • If you set ASTRO_SERVER_PUBLIC_IP to a private/internal IP, the server may shut itself down. Either remove it (auto-detection will find your real public IP) or set it to your actual public IP.

First boot is very slow

  • That's normal. steamcmd is downloading the game (~2 GB) and Wine is being set up. It only happens once.

Can't connect from the game

  • Make sure port 5520/udp (or your custom port) is forwarded on your router and open in your firewall.
  • Check that the public IP in the logs matches what you expect.

NTSync errors in logs

  • Your kernel might not support NTSync. Remove the devices section from docker-compose.yml.