Sign inSign up

strenkml/beammp-server

By strenkml

•Updated about 2 years ago

Container for running a BeamMP server

Image
0

584

strenkml/beammp-server repository overview

⁠Differences from original repo

The container does not depend on the environment variables. The server config is completely managed by the ServerConfig.toml file

Release Pipe Docker Hub pulls Docker Hub size trivy os-arch Donate me

This project provides a container image for the BeamMP⁠ game server and shows its usage in a docker-compose environment.

⁠Motivation

Because there were no well-documented BeamMP server container images out there, I did one by myself.

⁠⚠️ BREAKING CHANGE and migration guide ⚠️

With the latest release of this container image there were two changes that will break your current setup:

  1. The environment variables⁠ were renamed.
  2. The ADDITIONAL_SERVER_CONFIG_TOML no longer exists. Instead, you can now mount a custom ServerConfig.toml file to the container.

In order to migrate you have to:

  1. Rename your existing environment variables to the new ones listed in the environment variables⁠ section.
  2. If you used the ADDITIONAL_SERVER_CONFIG_TOML environment variable, you have to create a ServerConfig.toml file and mount it to the container. See the ServerConfig.toml⁠ section for more information.

⁠Usage

The sections below provides use cases for docker and docker-compose.

⁠docker

Quick start:

docker run --name beammp-server \
           -p 30814:30814/tcp -p 30814:30814/udp \
           -e BEAMMP_NAME='My first awesome Server' \
           -e BEAMMP_AUTH_KEY='<insert auth-key>' \
           rouhim/beammp-server

If you want to interact with the server console, just add the -it flag to the docker run command.

⁠docker-compose

First clone this repository and check docker-compose.yml if interested. The configuration should be done within the .env file.

To get started copy .env.example to .env and create the mod folder.

cp .env.example .env 
mkdir client-mods server-mods
chmod 777 client-mods server-mods

Adjust the values in the .env to your needs and run:

docker-compose pull && docker-compose up -d

⁠Server interaction

To connect to the interactive game server console, you need to start the server in detached (docker / -compose -d flag) mode. Then run the following command to attach to the server console:

docker attach <container-name>

⁠Environment parameter

Variable namedescriptiondefault value
BEAMMP_AUTH_KEYMandatory! The authentication key used by the server. It is used to identify your server and is not optional.
BEAMMP_DEBUGSet to true to enable debug output in the console.false
BEAMMP_PRIVATESet to true if you don't want to show up in the Server Browser.true
BEAMMP_MAX_CARSHow many vehicles a player is allowed to have at the same time.1
BEAMMP_MAX_PLAYERSHow many players your server can hold at a time.10
BEAMMP_MAPWhat the server map is./levels/gridmap_v2/info.json
BEAMMP_NAMEWhat your server is called. This shows up in the Server Browser.BeamMP New Server
BEAMMP_DESCRIPTIONWhat shows under the name when you click on the server.BeamMP Default Description
BEAMMP_PORTThis value must be identical to the containers exposed port.30814

A new auth key can be claimed on this site⁠, you will need a Discord⁠ account for this. Note that the IP entered there does not matter, despite what the site claims. For more information refer to this wiki page⁠.

⁠Client mods

In the first place you should consider reading the official mods guide⁠. Mods can be downloaded from the official BeamNG resources website⁠. Just copy the downloaded zip file into the client-mods folder.

⁠Custom maps

Copy the downloaded zip file into the client-mods folder.

Then have to find out the custom map path name (e.g.: /levels/car_jump_arena/info.json), to set it later as the map to load. To do so:

  1. Execute the shell command below, or open the zip file manually.
  2. Copy the absolute path to the info.json location (/levels/{map-name}/info.json).
  3. Set in .env file: BEAMMP_MAP=/levels/{map-name}/info.json. Example: BEAMMP_MAP=/levels/car_jump_arena/info.json

A simple way to print the full map path including info.json (unzip, grep and awk is required):

unzip -l PATH/TO/MAP.zip \
  | grep 'levels/.*/info.json' \
  | awk '{split($0,a," "); print "/"a[4]}'

⁠Server mods

Server mods can be found in the BeamMP forum⁠. Installation and configuration instructions are provided by each mod.

⁠Custom ServerConfig.toml

If you want to specify a custom ServerConfig.toml file, just create a new file called ServerConfig.toml and fill it with your configuration (Example⁠). Make sure to mount the file as volume to the container. The file will be mounted to the server directory on startup.

Docker example:

docker run --name beammp-server \
           -p 30814:30814/tcp -p 30814:30814/udp \
           -e BEAMMP_NAME='My first awesome Server' \
           -e BEAMMP_AUTH_KEY='<insert auth-key>' \
           -v ./ServerConfig.toml:/beammp/ServerConfig.toml \
           rouhim/beammp-server

For docker-compose, just add the following line to the volumes section:

volumes:
  - ./ServerConfig.toml:/beammp/ServerConfig.toml

Environment variables will always override the values in the ServerConfig.toml file.

Make sure to create the file first, otherwise docker will create a directory instead.

If you are getting permission errors, you can fix them with: chmod 777 ServerConfig.toml

⁠Resources

Tag summary

Content type

Image

Digest

sha256:ab116ac06…

Size

35.6 MB

Last updated

about 2 years ago

docker pull strenkml/beammp-server