• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Simple docker-compose set up

jonasu

Well-Known Member
Joined
Nov 3, 2009
Messages
147
Solutions
2
Reaction score
59
Location
Stockholm, Sweden
Hi, thought I'd share a simple docker-compose setup for running a full OT stack. This is perfect for running a local development environment but could theoretically be used to host smaller servers. The setup for that is outside of the scope for this guide. Let me know if you're interested.

Requirements:
Ubuntu (or whichever Linux distro you like)
docker
docker-compose

The commands below may have to be run with sudo <command> depending on your permissions, eg. sudo apt install.
In ubuntu run the following comman to install the requirements:
Bash:
apt install docker.io docker-compose

Create your folder structure:
Bash:
cd /srv && \
mkdir -p /srv/ot/mariadb && \
mkdir -p /srv/ot/nginx/www

Clone the forgottenserver repo, with version v1.4.2:
Bash:
cd /srv/ot && \
git clone https://github.com/otland/forgottenserver.git srv -b v1.4.2

Download latest MyAAC release, get the tar.gz and save it to /srv/nginx/www:
Bash:
cd /srv/nginx/www && \
tar xf myaac-0.8.9.tar.gz --strip-components=1

Create your docker-compose.yaml file, change super_secret to your own password:
Bash:
cat << 'EOF' > /srv/ot/docker-compose.yaml
---
version: "2.1"
services:
  nginx:
    image: lscr.io/linuxserver/nginx:latest
    container_name: nginx
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - ./nginx:/config
      - ./srv:/srv
    ports:
      - 80:80
      - 443:443
    restart: unless-stopped
  mariadb:
    image: lscr.io/linuxserver/mariadb:latest
    container_name: mariadb
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - MYSQL_ROOT_PASSWORD=super_secret # change to your own password
      - MYSQL_DATABASE=tfs # tfs database name
      - MYSQL_USER=tfs # tfs database user
      - MYSQL_PASSWORD=super_secret # change to your own password
    volumes:
      - ./mariadb:/config
    ports:
      - 3306:3306
    restart: unless-stopped
  srv:
    image: localimage.sh/tfs:latest
    container_name: srv
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
    volumes:
      - ./srv:/srv
    ports:
      - 7071:7071
      - 7072:7072
    restart: unless-stopped

EOF

Build the forgottenserver docker image:
Bash:
cd /srv/ot/srv && \
docker build . -t localimage.sh/tfs:latest

Run the stack for the first time:
Bash:
cd /srv/ot && \
docker-compose up -d

Configure your config.lua for use with the mariadb container (Close and save with CTRL+X):
Bash:
cd /srv/ot/srv && \
nano config.lua

MySQL part should look like this:
Bash:
-- MySQL
mysqlHost = "mariadb"
mysqlUser = "tfs"
mysqlPass = "super_secret"
mysqlDatabase = "tfs"
mysqlPort = 3306
mysqlSock = ""

Import the schema, use whatever root password you set, replace super_secret:
Bash:
docker exec -i mariadb mariadb -uroot -psuper_secret tfs < /srv/ot/srv/schema.sql

Make sure your server is running correctly by running:
Bash:
docker restart srv && \
docker logs srv

Now you should be able to access http://localhost/install
Set your ip in /srv/ot/nginx/www/install/install.txt as displayed in the MyAAC install wizard

You should now have a server running TFS v1.4.2 and MyAAC.

For some Linux basics, have a look at this slighty obnoxius but good resource: https://www.youtube.com/playlist?list=PLIhvC56v63IJIujb5cyE13oLuyORZpdkL

I'm not responsible for any dataloss that might occur, you are on your own.
 
Last edited:
dude, people in this community are unable to setup myaac or other gesior aacs and you want them to use docker
😅 I guess you’re right. Hopefully someone finds it useful. I learnt alot from this community, but that was 15 years ago.
Post automatically merged:

Tibia version?
How about you search around a bit about forgottenserver 1.4 and see if you can find the answer to that question 😊
 
Last edited:
Back
Top