Welcome to my step-by-step tutorial on how to compile Trinity Core 3.3.5a on Debian 11.
Step 1: Requirements To Begin
- Access to Debian 11
Step 2: Logging Into Debian via Termius
If you already know how to connect to your server via ssh, you can skip this part. I decided to use termius for this tutorial simply because it is cross platform and anyone can follow along with this tutorial. Now that you have all the tools needed to follow along with this tutorial, let’s begin.
Logging Into the server:
You’ll need to enter your server IP into the field shown in the circle and click Create host.
Once you created the host, you’ll see the following screen where you’ll need to enter your username and password to connect to your server.
Once you have configured your username and password, simply double-click the host you just created to login into the server via ssh.
Step 3: Creating A User
Let’s create a separate user, we will use to compile and manage our trinity core server from. We will call this user trinitycore for the sake of this tutorial, but you can name it whatever you’d like.
sudo adduser trinitycore
Now you’d need to give this newly created user sudo permissions in order to follow along with this tutorial.
sudo usermod -aG sudo trinitycore
Now let’s switch over to the new user we just created and gave sudo permissions. Use the password you decided on when creating the user.
Now you’ll want to change to your Directory that belongs to this user.
Please be aware that it is generally considered best practice to avoid using the root username and to refrain from granting sudo permissions to new users, as they are not usually necessary. However, for the purposes of this tutorial, I have demonstrated how to do so.
Step 4: Updating The Server And Installing Required Tools
Now you are ready to update your server and install the required tools to compile trinity core.
sudo apt-get update && sudo apt-get upgrade
Now that your server is updated, you are ready to install the required software to compile trinity core.
sudo apt-get install git clang cmake make gcc g++ libmariadb-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev libboost-all-dev mariadb-server p7zip default-libmysqlclient-dev p7zip-full unzip sudo update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100 sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang 100
Enter ‘Y’ and the installation process for the software may take a moment to complete.
Step 5: Cloning Trinity Core From Github & Compiling
Now that you have the necessary tools for the job. You can clone TrinityCore from GitHub.
git clone -b 3.3.5 https://github.com/TrinityCore/TrinityCore.git
We will know go to the trinity core folder just cloned and make a build directory.
cd TrinityCore mkdir build cd build
Before we begin the compilation process, we need to determine the number of cores in our CPU. As shown in the example below, my server has 8 cores. However, the number of cores on your server may be different, so use the number that corresponds to your server.
We are now ready to use cmake to prepare the source code. The command below will set the server directory to /home/trinitycore/Server.
cmake ../ -DCMAKE_INSTALL_PREFIX=/home/trinitycore/Server -DTOOLS=0
Remember the number of cores in your CPU. You will need to input that information here by replacing ‘X’ with the number of cores. For example, if your server has 8 cores, you would enter ‘8’
make -j X sudo make install
You are now compiling trinity core. This may take awhile depending on the resources available on your server.
We will now need to rename the configuration files before moving to the next step.
cd /home/trinitycore/Server/etc/ sudo mv authserver.conf.dist authserver.conf | sudo mv worldserver.conf.dist worldserver.conf
Step 6: Setting up MySQL
We will now go ahead and setup our mysql database for our server, and connect to it using the following command. There is no password by default.
sudo mysql -u root -p
Now that you have connected to your database, you will need to run some queries.
CREATE USER 'trinity'@'localhost' IDENTIFIED BY 'trinity' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0; GRANT USAGE ON * . * TO 'trinity'@'localhost'; CREATE DATABASE `world` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE `characters` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE DATABASE `auth` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; GRANT ALL PRIVILEGES ON `world` . * TO 'trinity'@'localhost' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON `characters` . * TO 'trinity'@'localhost' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON `auth` . * TO 'trinity'@'localhost' WITH GRANT OPTION;
These queries will create a new user with the name trinity, and password trinity. It will also create three new databases ‘auth’, ‘characters’ and ‘world’.
Now that we have our database ready, we will need to visit the trinity core release section of GitHub. You will need to download the latest version, as of right now it’s TDB 335.22101. We will only need the database file, simply right click and copy the link.
Now download the file to your server, making sure that you are in the server folder ‘/home/trinitycore/Server/bin/’ before doing so.”
sudo wget https://github.com/TrinityCore/TrinityCore/releases/download/TDB335.22101/TDB_full_world_335.22101_2022_10_17.7z
Once the download is complete, we will use p7zip to extract the files using the following command.
sudo 7z x TDB_full_world_335.22101_2022_10_17.7z
It is important to note that if you are using this tutorial at a later date, the name of the file may have changed.
Step 7: Populating Your Databases & Downloading Data
You will now need to start the worldserver to populate the databases, this may take awhile depending on resources available to you.
cd /home/trinitycore/Server/bin ./worldserver
After the world server completes populating the databases, run the following commands in order to download the data(maps, dbc, mmaps, vmaps) required to run the worldserver.
cd /home/trinitycore/Server/bin/ sudo wget https://www.mediafire.com/file/7a45qqij3a11xl9/data.zip sudo unzip data.zip sudo rm -v data.zip
You may now start your authserver and worldserver by simply typing ./authserver or ./worldserver. But please note, doing it this way will disconnect as soon as you close the SSH session. I will be making a guide shortly about setting these up as a service.
If you have any suggestions on how I can improve this tutorial, feel free to share them below.