Use case · Game server

Avorion dedicated server on Linux, on hardware you control

An Avorion dedicated server is Boxelware's AvorionServer binary, fetched by SteamCMD as app 565060 with an anonymous login and started through server.sh with a galaxy name, a data path and your 64-bit SteamID as admin. On Linux it wants port 27000 open for TCP and UDP plus three UDP ports beside it, a galaxy folder you copy off the box yourself, and a service manager that ends it with Ctrl-C instead of a hard kill.

See the game servers

What the server asks of the machine

On sources: the FAQ on avorion.net does not cover dedicated servers, and its Wiki link goes to a community-edited wiki on Fandom (it began as wiki.avorion.net, which now redirects there); that wiki's server page carries an outdated banner. Facts below come from Boxelware's Steam patch notes, posts by the Boxelware team on its forum, Valve's SteamCMD page and, where marked, that community wiki.

ItemFigureWhere it comes from
BuildsWindows and Linux, 64-bitSteam's app info for 565060
Memory, verified servers16 GB free for the game after the OSBoxelware Verified Server rules, 2020
CPU, verified servers4 real cores, not threadsBoxelware Verified Server rules, 2020
Default player cap10, set by --max-players or maxPlayersCommunity wiki
workerThreadsAs many as the machine's hardware threadsCommunity wiki
generatorThreadsAt least 2, never as many as hardware threadsCommunity wiki

The 16 GB and four-core figures are the bar Boxelware set for a server it marks with its blue Verified checkmark: public, moderated, kept up with anti-hang or auto-restart scripts. They are not a minimum to boot, and Boxelware publishes no smaller figure for a private galaxy. Boxelware also warned in its September 2020 Black Market update post that Avorion is not an MMO, so raising the player count in server.ini is not automatically wise. Steam lists 64-bit Windows and Linux builds; we read that as x86-64 and would not put the server on an ARM machine. That last point is our inference, not a Boxelware statement.

Why a whole machine, and which one

Per the community wiki, worker threads simulate the sectors and generator threads build or load sectors as players travel, and the advice is one worker per hardware thread. That advice assumes the threads are yours. On a dedicated server they are: each core, the full memory and every disk serve the one galaxy, with root and no hypervisor in between.

  • Game server machines are configured to the game's requirements and paired with the operating system you choose, in New York, Miami, San Francisco, Amsterdam or Bucharest.
  • Each dedicated server includes an unmetered port and one IPv4 address. Nothing counts the traffic.
  • Rack servers and blades carry an out-of-band controller (HPE iLO, Dell iDRAC or a Supermicro BMC): browser console, virtual media and power, which the dashboard publishes for you as soon as a console login exists.
  • Ready servers go live about 30 minutes after the order is approved; a build to order takes 4-24 hours.
  • The network is our own, AS19624, so there is no upstream reseller between the galaxy and the metal.

For the Verified bar, pick a rack server with at least four physical cores and 16 GB left over after Ubuntu. Our Linux dedicated servers page names the other distributions on offer, and the five data centres each publish a test IP to ping from where your players sit.

Installing on Ubuntu

Valve's SteamCMD page recommends the distribution package and calls running SteamCMD as root a security risk. On Ubuntu that means the multiverse repository and i386 packages. The install asks you to accept the Steam licence; answer it before you paste anything else.

# SteamCMD from Ubuntu multiverse, the route Valve documents
sudo add-apt-repository multiverse
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install steamcmd

Next comes a service account, the firewall (IPv6 enabled ahead of the first rule, ufw active while nothing listens yet), the server files and the first start. The Ubuntu package puts SteamCMD at /usr/games/steamcmd. Replace YOUR_STEAMID64 with your 17-digit Steam ID.

# Service account with no login shell
sudo useradd -m -s /usr/sbin/nologin avorion

# Firewall first: IPv6 copies of every rule, SSH open, then on
sudo sed -i 's/^IPV6=.*/IPV6=yes/' /etc/default/ufw
sudo ufw allow OpenSSH
sudo ufw --force enable
sudo ufw allow 27000/tcp
sudo ufw allow 27000/udp
sudo ufw allow 27003/udp
sudo ufw allow 27020:27021/udp

# Server files (app 565060) and a galaxy folder, owned by avorion
sudo -u avorion -H bash -c '/usr/games/steamcmd +force_install_dir /home/avorion/server +login anonymous +app_update 565060 validate +quit && mkdir -p /home/avorion/galaxies'

# First start in the foreground: creates the galaxy and its admin
sudo -u avorion -H bash -c 'cd /home/avorion/server && bash server.sh --galaxy-name mygalaxy --datapath /home/avorion/galaxies --admin YOUR_STEAMID64'

When the console stops scrolling, type /save, then /stop. The community wiki gives that sequence to write the galaxy's config files. Its rule never to stop the server by closing the console is older than patch 0.17.1, in which Boxelware made both Ctrl-C and closing the console a graceful shutdown; the service below relies on the Ctrl-C half. The galaxy now sits in /home/avorion/galaxies/mygalaxy: Boxelware's 0.10.2 notes renamed --name to --galaxy-name, and the wiki gives the final path as data path plus galaxy name.

The ports, one by one

PortProtocolJobSource
27000TCP and UDPGame traffic, set with --portCommunity wiki; a server log posted on Boxelware's forum prints it as Game Port
27003UDPPolling, so the server can be queried over the internetBoxelware team, forum, 2016
27020UDPSteam query portCommunity wiki for the port; the name as printed in a server log on Boxelware's forum
27021UDPSteam portCommunity wiki for the port; the name as printed in a server log on Boxelware's forum
27015TCPRCON, disabled until rconPassword is setBoxelware patch notes, 2017

Boxelware made every server port configurable on the command line in patch 0.10.2. The flag names for the polling and Steam ports (--query-port, --steam-query-port, --steam-master-port) appear in community posts rather than Boxelware's notes, so confirm them with --help on your build. RCON stays shut in the rules above on purpose.

Boxelware never documented two galaxies on one IP address. Its team said in 2016 that polling always uses 27003 and in 2017 not to change that port, and a 2018 thread on its forum reports that a second server only worked once it had an IP of its own. So give a second galaxy an additional IPv4 address on the server, its own install directory, its own unit and its own server.ini, bind it to that address (the Boxelware team mentioned IP binding in 2017; community posts use --ip, so confirm the flag with --help), and check it from outside before anyone is invited.

Running it under systemd

# /etc/systemd/system/avorion.service
[Unit]
Description=Avorion dedicated server
Wants=network-online.target
After=network-online.target

[Service]
User=avorion
WorkingDirectory=/home/avorion/server
ExecStart=/bin/bash /home/avorion/server/server.sh --galaxy-name mygalaxy --datapath /home/avorion/galaxies
KillSignal=SIGINT
TimeoutStopSec=300
Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target

Load it with sudo systemctl daemon-reload && sudo systemctl enable --now avorion and follow it with journalctl -u avorion -f. KillSignal=SIGINT is the Ctrl-C that Boxelware made a clean shutdown; 300 seconds of stop timeout is our choice, so raise it if your galaxy takes longer to save. Restart=always restarts it if it crashes, and also after an in-game /stop, so use sudo systemctl stop avorion when you want it down.

--admin is left out on purpose. Admins live in admin.xml in the galaxy folder, the Boxelware team says the ID to use is the 64-bit SteamID, and patch 0.10.2 stopped clearing existing admins when --admin is passed again. Under systemd the console has no keyboard: give commands in game chat as an admin (/help lists what your build accepts) or through RCON.

server.ini, admins and RCON

Everything the galaxy owns sits in its folder: server.ini, admin.xml, modconfig.lua, the sectors and players, and the dated server logs. Since patch 1.1.3 the server also writes a documentation file for server.ini. Edit server.ini only while the service is stopped; the community wiki says the server writes its settings back on shutdown. The keys below come from the community wiki's settings table, on a page marked outdated, so check each one against the documentation file your build writes.

  • name, description and password: what the server list shows, and the join password.
  • maxPlayers: the cap, 10 by default per the community wiki.
  • isListed, isPublic, isAuthenticated, useSteam: listing, privacy and Steam authentication; the wiki says a public listing needs useSteam.
  • saveInterval: seconds between saves.
  • workerThreads, generatorThreads, scriptBackgroundThreads: the thread counts sized earlier.
  • rconPassword, rconPort, rconIp: RCON; blank password means RCON is off.

Boxelware's 2017 notes put RCON on TCP 27015 behind a password from server.ini, and 0.17 added support for both the Rust and Valve RCON protocols. Because ufw does not open 27015, reach it from your own computer through SSH, ssh -L 27015:127.0.0.1:27015 you@your-server, and point the RCON client at localhost. The password sits in plain text in server.ini, so sudo chmod 600 that file, and check the mode again after the first restart, since the server writes the file back on shutdown.

Workshop mods

Boxelware's 0.23 update gave dedicated servers a modconfig.lua in the galaxy folder: the server downloads the Workshop mods listed there, and players who join get them automatically without subscribing. Patch 2.5.8 improved how servers update those mods at start. Achievements were switched off with mods in 0.23; since patch 2.3 Steam achievements can optionally be enabled while mods are active.

The file's layout comes from the community wiki: a mods table of entries like {workshopid = "1691539727"} for what runs on the server, and an allowed table for client-side mods players may bring. The server enables every mod it loads, so comment an entry out to switch it off, then restart the unit.

Updates, backups and restores

Update by hand, with a copy taken first, all in one shell so the file name stays the same past midnight. The community wiki says to back up galaxies before every update and warns that dropping from the beta branch back to the default one will most likely corrupt a galaxy.

  1. ARCHIVE=/root/avorion-$(date +%F).tar.gz
  2. sudo systemctl stop avorion
  3. sudo tar -C /home/avorion -czf "$ARCHIVE" galaxies, then sudo tar -tzf "$ARCHIVE" | head to see that it reads back.
  4. sudo -u avorion -H /usr/games/steamcmd +force_install_dir /home/avorion/server +login anonymous +app_update 565060 validate +quit
  5. sudo systemctl start avorion
  6. sudo install -o "$USER" -m 600 "$ARCHIVE" ~/ puts a copy your own user can read, since /root is closed to it; scp it from your home directory to your own computer.

Avorion's own hourly emergency backups are not a substitute. Boxelware's 0.32 notes say a restore keeps player progress only, with the NPC factions and the rest of the world reset; the 0.32 beta notes add that copying a galaxy's folder is the way to be able to revert it. Your own archive is the snapshot you can roll back to. To restore one, in a shell where ARCHIVE names the file:

  1. sudo test -f "$ARCHIVE" && echo found; if nothing prints, stop and check the name.
  2. sudo systemctl stop avorion
  3. sudo mv /home/avorion/galaxies /home/avorion/galaxies.old (rename any older galaxies.old first).
  4. sudo tar -C /home/avorion -xzf "$ARCHIVE"
  5. sudo chown -R avorion:avorion /home/avorion/galaxies
  6. sudo systemctl start avorion

When this is the wrong setup

A few friends playing now and then can host from the game client: the game has a server launcher of its own, where Boxelware's team notes you can add command-line options too. A rented machine pays off when the galaxy should keep running while the host is offline, or when you want the Verified checkmark. Anyone already running a Space Engineers server can budget the same way: a whole box, sized for the busiest evening.

Questions

Does the Avorion server cost anything to download?

No. Steam lists app 565060, Avorion Dedicated Server, as a free download, and SteamCMD downloads it anonymously (+login anonymous), so no Steam account sits on the server.

Where does a Linux server keep the galaxy?

In the data path plus the galaxy name: with the flags above, /home/avorion/galaxies/mygalaxy. Without --datapath, the community wiki gives ~/.avorion/galaxies on Linux. Boxelware's 0.16.5 notes say the server no longer creates ~/.avorion at all when --datapath is set.

How do I add a second admin?

Stop the unit, run the first-start line once more in the foreground with their 64-bit SteamID after --admin, then /save, /stop and start the unit again. Since patch 0.10.2 existing admins in admin.xml are kept when --admin is used again.

Can the server run the beta branch?

Yes: add -beta beta before validate in the SteamCMD update line. The community wiki warns that moving a galaxy back from beta to default will most likely corrupt it, so archive the galaxy first and treat the switch as one-way.

Why is my server missing from the public list?

Check that isListed is true and useSteam is on, since the community wiki says listing needs both, and that UDP 27003, 27020 and 27021 are open beside 27000. Edit server.ini only while the unit is stopped, or the server writes the old values back.

A machine for one galaxy

Pick a city near your players and a rack server with four or more real cores, install Ubuntu, then work down this page.

See the game servers

Related on Server Room

Other use cases