Skip to content

Docker Installation

wsrvn edited this page Mar 23, 2024 · 13 revisions

Installing using Docker

The easiest and fastest way to get a Trackmania Forever server with Trakman up and running on your system is by using Docker. In this section we will provide an easy to follow tutorial.

Opening your ports

Follow a port forwarding guide for your router and open ports 2350 and 3450 (or different ones if you already have a server running, but make sure to remember that for later).

Installing Docker

Follow the Docker installation instructions on the official Docker page, they explain them better than we ever could. Verify you have a working docker compose by running docker compose version (or docker-compose -v depending on your version).

Configuration

Create a new directory, enter it and download the docker-compose.yml file.

Here's how to do that in a linux command line:

$ mkdir tmserver
$ cd tmserver
$ wget https://raw.githubusercontent.com/lythx/trakman/main/docker-compose.yml

Edit the file and set the environment variables. For our purposes, the following ones are important (go here for more detail):

Variable Values Description
SERVER_ADMIN_NAME string "SuperAdmin" by default, change it to whatever
SERVER_ADMIN_PASSWORD string A secret password
SERVER_ACC_LOGIN string Your server login (either a TMNF login or one from your player page)
SERVER_ACC_PASSWORD string Password for the above login
SERVER_ACC_KEY string Last 3 characters of your player key (leave empty if you are using a TMNF account as the SERVER_ACC_LOGIN)
SERVER_NAME string Your server name
SERVER_PASSWORD string Password for your server (leave empty if none)
SERVER_NET_PORT 1-65535 Internet port, 2350 by default, change if you already have a server running
SERVER_P2P_PORT 1-65535 Peer-to-peer port, 3450 by default
OWNER_LOGIN string Your TrackMania login
DEDIMANIA_PASSWORD string Server password or player page community code
FREEZONE_PASSWORD string Received on 'freezone:servers' manialink in-game. More details available here
WEBSERVICES_LOGIN string See Trackmania Web Services for more details
WEBSERVICES_PASSWORD string -||-
DISCORD_LOG_ENABLED "YES" or "NO" Discord Webhook with logs is enabled (more info here)
DISCORD_WEBHOOK_URL string URL generated by Discord for the Webhook
DISCORD_TAGGED_USERS strings separated by commas Which users to tag in case of a fatal error

Warning

If you changed the ports, make sure to change them in the ports section, too. The ports MUST match each other (e.g. - "2353:2353/tcp" and udp when SERVER_NET_PORT is set to 2353).

Exposing a different port from the one the server uses will not work because of how the Trackmania Forever dedicated server advertises itself.

Using your own database

In case you already have a Trakman database or want to use a remote one (in a different location), follow these instructions. TODO

Running

You are now ready to run the containers. Start them using docker compose up -d (or docker-compose up -d) and wait up to a few minutes for everything to launch.

You should then be able to see your server in Trackmania.

If you see the controller crashing 1-3 times when first started, just wait, that is a known issue that resolves itself after a few restarts (which are normally automatic). If that doesn't work, go to the Troubleshooting section.

Making changes & Customising

If you make any changes to Trakman's code (inside the trakman/ directory), you need to re-build it using the following command:

docker exec -it trakman-server npm run build --prefix /app/server/trakman (in case you changed the name of the Docker container in docker-compose.yml, replace trakman-server with the other name)

Afterwards, you can restart the controller from Trackmania using the //kc command.

Troubleshooting

If you run into any trouble with running the server, look into the logs in the /logs/ directory, or, alternatively, run the docker compose without the -d flag for it to output logs directly to your terminal. If you don't find your issue below, either create an issue on GitHub or ask for help on our Discord server. "Stupid" questions are also welcome as they indicate possible improvements to the documentation.

ECONNREFUSED when executing a database query

Your postgres container is not running, or trakman cannot connect to it - try double-checking your configuration. The default one works.

The server is listed in Trackmania, but I cannot connect to it

This indicates a port misconfiguration, ensure that if you changed a port - SERVER_NET_PORT, for instance - that you also changed it in the ports section of docker-compose.yml. Refer to the warning in the Configuration section.