Workload · Running a BeamNG.drive multiplayer server

Host a BeamMP server for your BeamNG.drive group

To host a BeamMP server you run BeamMP's own server program on a Linux machine, give it a key from the BeamMP Keymaster, and open port 30814 for both TCP and UDP so your friends' games can reach it. The program is light: what decides how a session feels is where the machine sits and how quickly it can hand your mods to each player who joins. Here is what it needs, which machine fits, and an evening's worth of setup on Ubuntu 24.04.

The short version
  1. Light on the processor, heavy on upload when players fetch mods
  2. One port number, opened for TCP and UDP
  3. Your key stays in a file only the server's user can read
  4. Runs as a service that comes back on its own

What you are putting online

BeamMP is the multiplayer mod for BeamNG.drive, and its server, BeamMP-Server, is the meeting point: every player's game sends its cars to the server, and the server passes them on to everyone else. You choose the map, how many people can join, how many cars each may spawn, and which mods everyone gets. With Private = true only people you give the address to can find it; with Private = false it shows up in the in-game server list.

BeamMP publishes ready-made Linux programs for Debian 12, Debian 13, Ubuntu 22.04 and Ubuntu 24.04, for both ordinary x86_64 processors and arm64. There is also a Windows build. You do not have to compile anything.

How big a machine does it need?

Very little, by the project's own estimate. The README in the BeamMP-Server repository lists rough minimums it says may change with each release: 50 MiB or more of free memory, a processor above 1 GHz (more than one core preferred), no graphics card, 10 MiB of disk plus your mods and plugins, and 5 to 10 Mb/s of upload.

That last figure is the one that bites at home. Every vehicle or map zip you add is sent to each player when they join, so a big modded map means a big download from your connection, every time someone new arrives. A machine in a data centre with a port of its own takes that off your home line.

The server that fits

Since the program asks for so little, put the money into the right city and a calm network rather than a big processor. Every one of our game server machines is an entire server, each on a port that is not shared with any other customer at the access switch, and nothing counts the traffic, so handing out mods costs nothing extra. Choose the nearest of our five cities to where your group plays. A machine already in a rack is yours in about 30 minutes once the order is approved; payment checks can make that longer.

  • The simple choice: any x86_64 server with Ubuntu 24.04 or 22.04, picked from the Linux dedicated servers.
  • If you want a screen to fall back on: rack servers and blades have a management controller with a browser console. Among the small Moonshot cartridges, the m510 and the m710x include one; every other cartridge offers just power switching.
  • arm64: the Ampere Altra machine installs Ubuntu 22.04 and 24.04, which BeamMP builds for, but it is assembled to order, which takes one to two weeks. The X-Gene cartridge will not do: its only Ubuntu releases are 16.04 and 18.04.

Your key and your firewall, sorted first

  1. Sign in at keymaster.beammp.com with Discord, open Keys, press the green plus, give the key a label and copy it. BeamMP asks you to treat it like a password. You get a limited number, and each one can run only one server at a time.
  2. Order the server with Ubuntu 24.04, sign in over SSH and become root with sudo -i.
  3. Keep port 30814 in mind. BeamMP's guide says to allow it for both TCP and UDP, and the server only speaks IPv4 for now.

Up and running in an evening

Step 1, the program. This installs the one library BeamMP needs to run (liblua5.3-0), makes a separate beammp account so the server never runs as root, switches the firewall on with SSH allowed first, and downloads BeamMP-Server v3.9.3. The file is only installed if its fingerprint matches the SHA-256 GitHub publishes for it, and the block does nothing if a server program is already there.

apt-get update && apt-get install -y liblua5.3-0 curl ufw
getent passwd beammp >/dev/null || useradd -r -m -d /opt/beammp -s /usr/sbin/nologin beammp
sed -i 's/^IPV6=.*/IPV6=yes/' /etc/default/ufw
ufw allow OpenSSH && ufw --force enable && ufw allow 30814/tcp && ufw allow 30814/udp
REL=v3.9.3; ASSET=BeamMP-Server.ubuntu.24.04.x86_64
if [ -e /opt/beammp/BeamMP-Server ]; then echo "already installed"; else
  cd /opt/beammp && curl -fL -o dl.tmp "https://github.com/BeamMP/BeamMP-Server/releases/download/$REL/$ASSET" &&
  echo "7de765ccbb9c2ae685c5394c70518a1a948801fb488ea419150fb54f5b41bd0b  dl.tmp" | sha256sum -c - &&
  install -m 755 dl.tmp BeamMP-Server && rm dl.tmp && ./BeamMP-Server --version
fi

On Ubuntu 22.04 or an arm64 machine, change ASSET to the matching file name from the v3.9.3 release page and use the fingerprint GitHub shows beside it. Step 2, the settings and your key. BeamMP's guide has you start the server once to create ServerConfig.toml; here you write the file yourself, created readable by the beammp account alone before your key goes in. The final line prompts for the key without showing it on screen and refuses anything that is not 36 letters, digits and dashes.

C=/opt/beammp/ServerConfig.toml
if [ -e "$C" ]; then echo "$C exists, leaving it alone"; else
install -m 600 -o beammp -g beammp /dev/null "$C" && cat > "$C" <<'EOF'
[General]
Name = "Our BeamMP lobby"
Description = "Friends only"
Tags = "Freeroam"
Map = "/levels/west_coast_usa/info.json"
MaxPlayers = 10
MaxCars = 2
Private = true
AllowGuests = false
Port = 30814
IP = "::"
ResourceFolder = "Resources"
InformationPacket = true
LogChat = false
Debug = false
AuthKey = ""
[Misc]
ImScaredOfUpdates = false
UpdateReminderTime = "30s"
EOF
fi
read -rs -p 'Paste your AuthKey: ' KEY; echo; [[ $KEY =~ ^[A-Za-z0-9-]{36}$ ]] && printf 's|^AuthKey = .*|AuthKey = "%s"|\n' "$KEY" | sudo -u beammp sed -i -f - "$C" && echo "key saved" || echo "that did not look like a key, nothing saved"; unset KEY

Typing the key at the prompt keeps it out of your shell history and out of the process list. Step 3, a service that starts with the machine. This writes a systemd unit (only if there is none yet) that runs the server as beammp and starts it again 10 seconds after any exit, and it only switches the service on if a well-formed key is in the file; if not, it tells you so and leaves the service off.

U=/etc/systemd/system/beammp.service
if [ -e "$U" ]; then echo "$U exists, leaving it alone"; else cat > "$U" <<'EOF'
[Unit]
Description=BeamMP-Server for BeamNG.drive
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=beammp
Group=beammp
WorkingDirectory=/opt/beammp
ExecStart=/opt/beammp/BeamMP-Server
UMask=0077
Restart=always
RestartSec=10
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload; fi
grep -Eq '^AuthKey = "[A-Za-z0-9-]{36}"$' /opt/beammp/ServerConfig.toml && systemctl enable --now beammp && journalctl -u beammp -n 30 --no-pager || echo "no valid AuthKey in ServerConfig.toml: service not started, re-run the key line from step 2"

Look for [ERROR] lines in that output; BeamMP's guide says the server should then stay up. Join from BeamMP's Direct Connect tab with your server's IPv4 address and 30814. Worth knowing: the server writes ServerConfig.toml back out each time it starts (TConfig.cpp), so any comments you add vanish, but its permissions stay as they are.

Adding cars, maps and scripts

Everything players download lives in /opt/beammp/Resources/Client. Copy a vehicle zip there and it is offered to every player as they join. BeamNG's built-in maps need nothing installed: change Map to a path from BeamMP's list, such as /levels/gridmap_v2/info.json, /levels/east_coast_usa/info.json or /levels/johnson_valley/info.json. For a modded map, add its zip to the same folder, look inside the zip's levels folder for the map's folder name (no need to unpack), and point Map at /levels/ plus that name plus /info.json.

Server-side scripts go in Resources/Server: the README mentions Lua mods for the server, and TLuaEngine.cpp treats each folder in there as a separate plugin. After copying anything in, give it back to the service account with chown -R beammp: /opt/beammp/Resources and restart with systemctl restart beammp. If players get stuck on a done or start message while joining, BeamMP's guide points to a broken or clashing mod: take mods out until it clears.

Talking to your server and stopping it safely

BeamMP-Server has a built-in console with commands such as list, kick, say, status, settings, reloadmods and exit (the full list is in TConsole.cpp). Run as a service it has no keyboard attached, so when you need it: stop the service, then start the program by hand as root with cd /opt/beammp && sudo -u beammp ./BeamMP-Server, type what you need, finish with exit, then bring the service back with systemctl start beammp. Never run the two together, because your key only covers one running server.

Stopping is safe. In SignalHandling.cpp the server treats SIGTERM, which systemctl stop beammp sends, as a request to shut down gracefully, and main.cpp then kicks connected players with a shutdown notice and gives plugins up to 5 seconds to finish. Logs go to the journal and to Server.log, which BeamMP says never shows your key.

Keeping it safe: copies and new versions

You manage the server; we keep the hardware and the network running. The two things worth copying are ServerConfig.toml and the whole Resources folder; the program itself can always be downloaded again. From a root shell: install -d -m 0700 /srv/beammp-copies && umask 077 && out=/srv/beammp-copies/beammp-$(date +%Y%m%d).tgz && tar -C /opt/beammp -czf "$out" ServerConfig.toml Resources && tar -tzf "$out" >/dev/null && echo saved "$out". If any plugin saves data as it runs, stop the service before copying. Your key is inside, so keep any copy you move off the machine private.

Putting a copy back takes four short commands from a root shell (sudo -i). Each one spells out the full path; swap NAME for the file name of the copy you want in /srv/beammp-copies.

  1. Stop the lobby: systemctl stop beammp.
  2. Save what is there now and put your copy in its place, in a single command: the swap only happens after a new keep-copy has been made right here and both archives open cleanly. `if [ -e /srv/beammp-copies/before-restore.tgz ]; then echo "before-restore.tgz already exists: delete or move it first, nothing was touched"; else tar -C /opt/beammp -czf /srv/beammp-copies/before-restore.tgz ServerConfig.toml Resources && tar -tzf /srv/beammp-copies/before-restore.tgz >/dev/null && tar -tzf /srv/beammp-copies/NAME.tgz >/dev/null && rm -r /opt/beammp/Resources && tar -C /opt/beammp -xzf /srv/beammp-copies/NAME.tgz && chown -R beammp: /opt/beammp/Resources /opt/beammp/ServerConfig.toml && chmod 0600 /opt/beammp/ServerConfig.toml && systemctl start beammp.service || echo "restore halted: one of the archives would not open, or a step failed"; fi`.
  3. Not what you expected? Unpack the keep-copy you made in step 2, without making another: `systemctl stop beammp; tar -tzf /srv/beammp-copies/before-restore.tgz >/dev/null && rm -r /opt/beammp/Resources && tar -C /opt/beammp -xzf /srv/beammp-copies/before-restore.tgz && chown -R beammp: /opt/beammp/Resources /opt/beammp/ServerConfig.toml && chmod 0600 /opt/beammp/ServerConfig.toml && systemctl start beammp.service`.
  4. Happy with the result? Delete /srv/beammp-copies/before-restore.tgz, because the next restore will refuse at step 2 while it exists.

Updating, per BeamMP's maintenance page, means swapping the old program for the new one. Fill in the new release's tag, the file for your Ubuntu release and the SHA-256 digest that GitHub shows beside it, then run this as root, all on one line: `REL=vX.Y.Z; ASSET=BeamMP-Server.ubuntu.24.04.x86_64; SUM=DIGEST-FROM-GITHUB; cd /opt/beammp && if [ -e BeamMP-Server.old ]; then echo "BeamMP-Server.old is still here: delete or move it first"; else curl -fL -o dl.tmp "https://github.com/BeamMP/BeamMP-Server/releases/download/$REL/$ASSET" && echo "$SUM dl.tmp" | sha256sum -c - && systemctl stop beammp && mv BeamMP-Server BeamMP-Server.old && install -m 755 dl.tmp BeamMP-Server && rm dl.tmp && systemctl start beammp || echo "update halted, see the error above"; fi`. Your lobby keeps running until the new file has passed the check.

Going back is the rename in reverse: systemctl stop beammp && mv /opt/beammp/BeamMP-Server.old /opt/beammp/BeamMP-Server && systemctl start beammp. Once the new version has behaved for a while, delete /opt/beammp/BeamMP-Server.old; the next update will not start while it is there.

The licence, in plain words

BeamMP-Server is published under the GNU AGPL version 3, according to the LICENSE file in its repository. As our general reading and not legal advice: hosting the official, unchanged program for your group asks nothing of you. If you hand copies to others, changed or not, the source has to go with them under the same terms; and if you change the server and let people play on it over the network, you must offer those players your changed source. The README also says BeamMP allows public builds only from unmodified source, and asks that any build come from a tagged release.

If you rent from one of BeamMP's partner hosts instead, their VPS guide says you cannot edit ServerConfig.toml yourself there. On a server you rent outright you keep root and decide every setting.

Questions people ask

Why can't my friends see my BeamMP lobby in the list?
Check that Private is false and that a valid key is in the config, then restart. BeamMP also suggests clearing search filters and setting the map filter to Any. Players can always join through Direct Connect with your IPv4 address and port.
My friends get Connection Failed. What should I check?
BeamMP's guide links error codes such as 10060 or 10061 in the launcher window to an unreachable server. On your own machine that usually means the firewall: ufw status should show 30814 allowed for both tcp and udp. Also confirm the service is running with systemctl status beammp.
Is it worth paying for a whole machine for something this light?
The processor is not the reason. You get a port nobody else shares at the switch and traffic nobody counts, which matters once mods are being pulled by every new player, and the machine runs whatever else your group needs beside the lobby. If all you want is a tiny box for one lobby, any small x86 machine with Ubuntu 22.04 or 24.04 will do.
Can I change the map without editing files?
The console's settings command can read and change some values while the server runs; the source marks Map, MaxPlayers and MaxCars as changeable there, and others, such as the port, as read-only. Under systemd there is no console attached, so editing ServerConfig.toml as the beammp user and restarting is the simpler route.

Give your group a lobby that is always there

Choose a city near the people you race with, order it with Ubuntu 24.04 installed, then follow steps 1 to 3 on this page.

Get a server for your BeamMP lobby

Read next