Tibia Server Setup Guide

Comprehensive tutorial to install and configure a Tibia server on Linux using The Forgotten Server (TFS).

Introduction

This guide walks you through setting up a Tibia server on a Linux system using The Forgotten Server (TFS). You'll learn how to install necessary dependencies, configure the server, and set up a web interface for account management.

Prerequisites

Step 1: Update System Packages

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Dependencies

sudo apt install -y build-essential cmake git libboost-system-dev libboost-filesystem-dev libboost-regex-dev liblua5.2-dev libmysqlclient-dev libssl-dev libxml2-dev libgmp-dev libboost-iostreams-dev

Step 3: Clone The Forgotten Server Repository

git clone https://github.com/otland/forgottenserver.git
  cd forgottenserver

Step 4: Compile The Forgotten Server

mkdir build && cd build
  cmake ..
  make -j$(nproc)
Note: Compilation may take several minutes depending on your system's performance.

Step 5: Configure the Server

Copy the sample configuration file and edit it:

cp ../config.lua.dist ../config.lua
  nano ../config.lua

Update the following parameters:

Step 6: Set Up MySQL Database

sudo apt install -y mysql-server
  sudo mysql -u root -p

Within the MySQL prompt:

CREATE DATABASE tfs_database;
  CREATE USER 'your_mysql_user'@'localhost' IDENTIFIED BY 'your_mysql_password';
  GRANT ALL PRIVILEGES ON tfs_database.* TO 'your_mysql_user'@'localhost';
  FLUSH PRIVILEGES;
  EXIT;

Step 7: Import Schema

Import the TFS schema into your MySQL database:

mysql -u your_mysql_user -p tfs_database < ../schema.sql

Step 8: Run the Server

cd ../
  ./tfs

The server should now be running. Monitor the console for any errors.

Step 9: Set Up Web Interface (Znote AAC)

Install necessary packages:

sudo apt install -y apache2 php php-mysql libapache2-mod-php php-xml php-mbstring

Download and configure Znote AAC:

cd /var/www/html
  sudo git clone https://github.com/Znote/ZnoteAAC.git
  cd ZnoteAAC
  sudo cp config.php.dist config.php
  sudo nano config.php

Update database credentials in config.php accordingly.

Restart Apache:

sudo systemctl restart apache2

Access the web interface via http://your_server_ip/ZnoteAAC.

Security Recommendations