This guide aims to show how to setup a Trackmania Dedicated Server in a Docker environment.
In the Advanced section below, you will find further explanations on how to add a server controller like PyPlanet or EvoSC.
This guide requires you to have a working installation of Docker installed, using either WSL2, MacOS, or Linux. Please refer to the official Docker Installation guide for more information.
Additionally, at the time of writing, ARM64-based systems, like Apple Silicon Macs or ARM64-based Linux servers, are not supported.
To get started, you will have to create a dedicated server login on the official Trackmania website.
Login to Trackmania website and navigate to the My server accounts section.
Fill out the Server Login
field and click the Submit
button.
The login should only contain Latin alphabet characters, digits and the following special characters: . _ -
After submitting, you will receive a randomly Dedicated Server password.
Save this somewhere, as you will not be able to retrieve it later.
To setup the Trackmania server with Docker, we need to prepare a few additional things.
Create the following directory structure somewhere, e.g. your home directory:
The files required, docker-compose.yml and example.txt, can be found further down in the tutorial or by clicking on the respective links.
Make a copy of example.txt
and name it maplist.txt
.
After creating the folders and files, execute the following commands in a Terminal shell:
sudo chown -R 9999:9999 Maps
sudo chmod -R 777 Maps
docker-compose.yml
MASTER_LOGIN
and enter your previously chosen server login.MASTER_PASSWORD
and enter the password that was generated for you.FORCE_IP_ADDRESS
and enter your public IPv4 address as well as the port defined in the ports
section for the trackmania
service.
curl ipv4.icanhazip.com
To finally start the server, navigate to the folder you created earlier and execute the following command:
docker compose up
To stop the server stack, press CTRL+C.
The first setup takes some time as Docker will have to download the Trackmania server image, unpack it, and start the server. You should eventually be greeted with an output looking like this:
Configuration file : dedicated_cfg.txt
Loading system configuration...
...system configuration loaded
Loading dedicated server configuration...
...Dedicated server configuration loaded
Connecting to master server...
...OK
Listening for xml-rpc commands on port 5000.
WARNING:
* The xml-rpc connection is open to any ip,
* but the Admin / SuperAdmin password hasn't been changed!
* Anybody can remotely control the server.
Match settings file : MatchSettings\default.txt
Loading match settings...
...Match settings loaded
Autostart server on internet
URL: uplay://launch/5595/0/#join=SERVERLOGIN@Trackmania
Starting server...
- Warning! -
You seem to be on a private network.
Unless you have configured your router,
other players on internet will not be
able to join in...
Script 'Mode:TM_TimeAttack_Online': [LOG]146> [Log] Logs are disabled in the "production" environment.
Loading map Summer 2023 - 01.Map.Gbx (7hk8IflYsbMbpJv2gyYzx48Zvt7)...
The server should now be up and running and joinable from within the game.
Refer to the next section on how to access it.
To keep the server running in the background, you need to start it like so:
docker compose up -d
The -d
flag means detached
, which starts the stack in the background. To inspect the logs of a detached stack, you can do the following:
If you need to access the logs of the detached Server stack, you can use the following command:
docker compose logs
You can stop the server with the following command:
docker compose stop
There’s 3 ways for you to access your server.
You can join the server via Play > Local > Local network
(only applicable if setup in WSL2)
URL: uplay://launch/5595/0/
#join=<uid>@Trackmania
Main menu > Settings > System > Join Link
and Press Enter⚙️ Administration
section at topClub Activities
Room > Use Dedicated server
Create
.Congratulations, you successfully setup a server via Docker and joined it for the first time!
You can change the game mode, its settings, and add more maps to your server by editing themaplist.txt
file you created earlier.
You may have noticed that the server you just set up doesn’t come with all the fancy features like Local Records
, Karma
, Custom Nicknames
and is overall barebones.
This is where Server Controllers, like EvoSC or PyPlanet, come into play.
To add a server controller, we will have to modify the existing docker-compose.yml
a bit and add two new services: A MariaDB database and a server controller.
However, we will not go too in-depth with the configuration of these, that’s left as an exercise for the reader.
You can find the modified docker-compose.yml
files below.
A few things to note for the PyPlanet installation:
You have to modify the folder structure you created in Server Setup section a bit - note the added PyPlanet-MX
folder.
To claim your MasterAdmin permissions in PyPlanet, look for the following line in the log after the first start with PyPlanet.
Copy the /claim ***********
part, and paste it into the chat on your Trackmania server.
[default][pyplanet.apps.contrib.admin.player] Welcome to PyPlanet, to claim admin rights, copy and paste this in the chat: /claim **************
version: "3.8"
services:
dedicated:
image: evotm/trackmania:latest
restart: unless-stopped
ports:
- 2351:2350/udp # increase external port by one
- 2351:2350/tcp # when spawning multiple instances
environment:
MASTER_LOGIN: "" # fill trackmania server login
MASTER_PASSWORD: "" # fill your trackmania server password
GAME_SETTINGS: "maplist.txt"
XMLRPC_ALLOWREMOTE: "True"
FORCE_IP_ADDRESS: "127.0.0.1:2351" # set to the servers external address to access from internet, or your network lan ip if you wish to host lan only
CONNECTION_UPLOADRATE: "102400"
CONNECTION_DOWNLOADRATE: "102400"
WORKERTHREADCOUNT: "2"
PLAYERS_MAX: 32
SPECTATORS_MAX: 32
SERVER_NAME: "TM2020 Server"
volumes:
- "./Maps:/server/UserData/Maps"
- "tmserverData:/server/UserData/"
volumes:
tmserverData: null
<?xml version="1.0" encoding="utf-8" ?>
<playlist>
<gameinfos>
<game_mode>0</game_mode>
<script_name>Trackmania/TM_TimeAttack_Online</script_name>
</gameinfos>
<startindex>0</startindex>
<map><file>Campaigns/CurrentQuarterly/Summer 2023 - 01.Map.Gbx</file></map>
<map><file>Campaigns/CurrentQuarterly/Summer 2023 - 02.Map.Gbx</file></map>
<map><file>Campaigns/CurrentQuarterly/Summer 2023 - 03.Map.Gbx</file></map>
<map><file>Campaigns/CurrentQuarterly/Summer 2023 - 04.Map.Gbx</file></map>
<map><file>Campaigns/CurrentQuarterly/Summer 2023 - 05.Map.Gbx</file></map>
</playlist>
version: "3.8"
services:
trackmania:
image: evotm/trackmania:latest
restart: always
ports:
- XXXX:2350/udp
- XXXX:2350/tcp
environment:
MASTER_LOGIN: "" # fill trackmania server login
MASTER_PASSWORD: "" # fill your trackmania server password
GAME_SETTINGS: "maplist.txt"
XMLRPC_ALLOWREMOTE: "True"
FORCE_IP_ADDRESS: "127.0.0.1:2351" # set to the servers external address to access from internet, or your network lan ip if you wish to host lan only
CONNECTION_UPLOADRATE: "102400"
CONNECTION_DOWNLOADRATE: "102400"
WORKERTHREADCOUNT: "2"
PLAYERS_MAX: 32
SPECTATORS_MAX: 32
SERVER_NAME: "TM2020 Server"
volumes:
- "serverData:/server/UserData"
- "/etc/trackmania:/server/UserData/Config/common"
db:
image: mariadb:latest
restart: unless-stopped
environment:
MARIADB_ROOT_PASSWORD: "secret"
MARIADB_USER: "evosc"
MARIADB_PASSWORD: "evosc"
MARIADB_DATABASE: "evosc"
volumes:
- "mariadbData:/var/lib/mysql"
evosc:
image: evotm/evosc:latest
restart: always
depends_on:
trackmania:
condition: service_healthy
environment:
DB_HOST: "db"
DB_NAME: "evosc"
DB_USER: "evosc"
DB_PASSWORD: "evosc"
RPC_IP: 'trackmania'
RPC_LOGIN: 'SuperAdmin'
RPC_PASSWORD: 'SuperAdmin'
volumes:
- "serverData:/server/UserData"
- "evoscConfig:/controller/config"
- "evoscModules:/controller/modules"
- "evoscCache:/controller/cache"
volumes:
serverData: null
evoscConfig: null
evoscModules: null
evoscCache: null
version: "3.8"
services:
dedicated:
image: evotm/trackmania:latest
restart: unless-stopped
ports:
- 2351:2350/udp # increase external port by one
- 2351:2350/tcp # when spawning multiple instances
environment:
MASTER_LOGIN: "" # fill trackmania server login
MASTER_PASSWORD: "" # fill your trackmania server password
GAME_SETTINGS: "maplist.txt"
XMLRPC_ALLOWREMOTE: "True"
FORCE_IP_ADDRESS: "127.0.0.1:2351" # set to the servers external address to access from internet, or your network lan ip if you wish to host lan only
CONNECTION_UPLOADRATE: "102400"
CONNECTION_DOWNLOADRATE: "102400"
WORKERTHREADCOUNT: "2"
PLAYERS_MAX: 32
SPECTATORS_MAX: 32
SERVER_NAME: "TM2020 Server"
volumes:
- "./Maps:/server/UserData/Maps"
- "tmserverData:/server/UserData/"
db:
image: mariadb:latest
restart: unless-stopped
environment:
MARIADB_ROOT_PASSWORD: "secret"
MARIADB_USER: "pyplanet"
MARIADB_PASSWORD: "pyplanet"
MARIADB_DATABASE: "pyplanet"
volumes:
- "mariadbData:/var/lib/mysql"
pyplanet:
image: pyplanet/pyplanet:latest
restart: unless-stopped
depends_on:
- db
- dedicated
environment:
GAME_SETTINGS: "maplist.txt"
PYPLANET_DEBUG: "False"
volumes:
- "pyplanetData:/app/server"
- "./Maps:/server/UserData/Maps"
volumes:
tmserverData: null
pyplanetData: null
mariadbData: null
Authors: reaby, Chris92