TrinityCore is a rather complex and demanding software, and as such it may seem quite daunting to install and maintain. This how-to will attempt to help with this, and also show how this can be done in a way that also shows you the basics of how linux compilations works.
We also advice you to read your distributions documentation on how to install packages, and also have at least knowledge on how it works with regards to adding users.*

 

Icon
Most of this how-to is based on the use of a Debian based distribution, though we'll try to inform as best as we can when something differs totally.
Icon

TrinityCore requires gcc 4.7 or higher and SSE2 capable processor. Check your distribution to ensure you have the correct version of gcc available.

Getting started

We advice you to run/install TrinityCore on a dedicated machine, or a machine that you know you have full control over.
We also advice you to NOT install the software on a shared server solution or any server where other users may have access or might require resources to be available at all times.
Your server may be abruptly killed by an angry administrator or system staff for overuse of system resources.

Creating a user to work with

Start with logging in to your Linux-machine and create an account for the server itself - on most recent distributions this can easily be done with the following command :

sudo adduser <username>

Note : Change <username> into the preferred username of your server-account - we will as far as possible avoid using specific usernames in this how-to.

Required software

See TrinityCore Requirements

Optional software

These tools are only needed or useful if you are connecting from a Windows host to your Linux machine

Graphical database-viewing/editing

Please note that the software called Navicat is NOT supported due to issues with how it handles SQL-files with "/* */"-style comments. We advise all users to stay well clear of this program unless they really are looking for issues.

Remote console connects to the server

File transfer through SFTP or FTP

Building the server itself

Getting the source code

cd ~/
git clone git://github.com/TrinityCore/TrinityCore.git 

A directory trinitycore will be created automatically and all the source files will be stored in there.

FreeBSD G3D Patch

FreeBSD users will need to apply the patch located here for g3d to compile properly, before doing anything else.

Compiling the source code

Creating the build-directory

To avoid issues with updates and colliding source builds, we create a specific build-directory, so we avoid any possible issues due to that (if any might occur)

cd TrinityCore
mkdir build
cd build

Configuring for compiling

To configure the core, we use space-separated parameters attached to the configuration-tool (cmake) - do read the entire section before even starting on the configuration-part.
This is for your own good, and you HAVE been warned. A full example will also be shown underneath the explanations.

cmake ../ [additional parameters]

Parameter explanations

path to your OpenSSL library - do not use if you have OpenSSL installed system wide:

-DOPENSSL_LIBRARIES=<path to OpenSSL library>

path to your OpenSSL includes directory - do not use if you have OpenSSL installed system wide:

-DOPENSSL_INCLUDE_DIR=<path to OpenSSL includes>

-DSERVERS Build worldserver and authserver

-DSCRIPTS Build core with scripts included (enabled by default)
-DTOOLS Build map/vmap extraction/assembler tools -DTOOLS=1 (will include tools)
-DUSE_SCRIPTPCH Use precompiled headers when compiling scripts
-DUSE_COREPCH Use precompiled headers when compiling servers
-DWITH_WARNINGS Show all warnings during compile
-DWITH_COREDEBUG Include additional debug-code in core
-DPREFIX Set installation directory
-DCONF_DIR Set configuration directory
-DLIBSDIR Set library directory
-DCMAKE_C_FLAGS Set C_FLAGS for compile (advanced users only)
-DCMAKE_CXX_FLAGS Set CXX_FLAGS for compile (advanced users only)

Note : * means "used by default", and does not need to be set.

The above parameters when combined into a full example :

cmake ../ -DPREFIX=/home/<username>/server -DWITH_WARNINGS=1

Another Example Below: 
cmake ../ -DPREFIX=/home/wow/server -DCONF_DIR=/home/wow/server/etc -DLIBSDIR=/home/wow/server/lib -DTOOLS=1 -DWITH_WARNINGS=1

The above build the tools, set installation base directory to /home/<username>/server and show all warnings during compile.

Note that you WILL have to configure the server well if you ever want to use the RA-access functionality.

Building the core

After configuring and checking that everything is in order (read cmakes output), you can build Trinity (this will take some time unless you are on a rather fast machine)

make
make install

If you have multiple CPU cores, you can enable the use of those during compile :

make -j <number of cores>
make install 

After compiling and installing, you will find your core binaries in /home/<username>/server/bin, and the standard configuration files in the /home/<username>/server/etc folder.
(As usual, replace <username> with the username you created earlier). Now you can continue reading on and learn how how to update the source tree.

Keeping the code up to date

TrinityCore developers are always at work fixing and adding new features to the core. You can always check them here. To update the core files, do the following :

cd ~/TrinityCore/
git pull origin master

Now return to the compilation-section again, and repeat the instructions there.

Installing libMPQ (MoPaQ) MPQ-reader library

Installation of the libMPQ library is only required if you want to extract the data files, and/or compile the tools.
Do note that the library has been hard-linked to the binary in later revisions, and is not "enforced" unless the tools are required.

Configuring, compiling and installing libMPQ

IMPORTANT : If you are the owner of the machine, and at this stage want the MPQ-library to be available for other users on your Linux-machine (and also making it easier for yourself at later stages), please follow <i>alternative 2</i>

Change directory to ~/TrinityCore/dep/libmpq/ before doing this

Alternative 1 : Local installation

sh ./autogen.sh
./configure --prefix=/home/<username>/.sys/
make
make install

Again, replace <username> with the username you chose when creating the account.

Alternative 2 : System wide installation

sh ./autogen.sh
./configure
make
sudo make install

As stated above, alternative 2 will build the library as a user without any specific privileges, and then install it into /usr/local as root (the superuser), reachable for other users that wish to use it for their own projects.
It is safe to allow this library to be installed system wide.

Installing MySQL Server

When configuring MySQL make sure you remember the password you set for the default root account and that you enabled both MyISAM and InnoDB engines.

You can leave all the other settings as default. You might want to enable remote access to your MySQL server if your are also testing a website for your Trinity server or if you have friends testing with you which need access from remote. Remember that this will decrease the security level of your MySQL server!

Setting up the server

Now that you have compiled the source you need to extract some necessary files.

Extracting dbc, maps and vmaps files

In order to run, TrinityCore needs dbc- and map files. In addition, if you want to enable vmaps (Making NPCs unable to see through walls etc.) you will need to extract them as well.
Warning: use Trinity's extractors. If you use extractors from other projects it is almost certain that your Trinity Core will not recognize the extracted data!

To get the Trinity extractors you have to build the project with option -DTOOLS=1 (#Parameter_explanations).

dbc and maps files

cd <your WoW client directory>
/home/<username>/server/bin/mapextractor
mkdir /home/<username>/server/data
cp -r dbc maps /home/<username>/server/data

Visual Maps (aka vmaps - optional)

You can also extract vmaps which will take quite a while depending on your machine (1-2 hours).

cd <your WoW client directory>
/home/<username>/server/bin/vmap4extractor
mkdir vmaps
/home/<username>/server/bin/vmap4assembler Buildings vmaps
cp -r vmaps /home/<username>/server/data

When this is complete you will receive the following message which can be safely ignored.

Processing Map 724
[################################################################]
Extracting GameObject models...Extracting World\Wmo\Band\Final_Stage.wmo
No such file.
Couldn't open RootWmo!!!
Done!
 
Extract V4.00 2012_02. Work complete. No errors.

Movement Maps (aka mmaps - optional and experimental)

Extracting mmaps will take quite a while depending on your machine (2-4 hours).

cd <your WoW client directory>
mkdir mmaps
/home/<username>/server/bin/mmaps_generator
cp -r mmaps /home/<username>/server/data

Configuring the server

First of all you need to create 2 files : worldserver.conf and authserver.conf in your /home/<username>/server/etc/ folder.
You'll find 2 files named worldserver.conf.dist and authserver.conf.dist. Copy these to their namesakes without the .dist extension.

cp worldserver.conf.dist worldserver.conf
cp authserver.conf.dist authserver.conf

Now you can go ahead and edit the two files (worldserver.conf and authserver.conf) to your liking.

 

Click here for ways how to proceed to get onto your server.

Support and conclusion

This guide is for beginners and states what to do and what to edit, assuming you left everything else with default values. Visit the following threads and post questions if you still need special support:

Warning: The TrinityCore development team/owners and the TrinityDB team/owners DO NOT in any case sponsor nor support illegal public servers. If you use these projects to run an illegal public server and not for testing and learning it is your own personal choice.

SPECIAL NOTES!

Things to notice :

-DSSLLIB=<path> has been deprecated and is not used at all (remove this if ever used before)
-DWITH_COREDEBUG=0 not required, as its default is : 0

The new method for custom SSL-libraries are:

-DOPENSSL_LIBRARIES=<path to OpenSSL libraries directory>
-DOPENSSL_INCLUDE_DIR=<path to OpenSSL br /includes directory>

The paths for installation can be done without any other parameters but this :

-DPREFIX=/path/to/where/you/want/core/to/be/installed

It will create the following structure:

<path>/bin/ - binaries will be placed here
<path>/etc/ - config files will be placed here

Also, compile has been tested on Debian 7.4 x32/x64, 8 x32/x64, Ubuntu 13.10 x64, Fedora Core 19 x64 - all without problems IF YOU DO NOT MESS AROUND ON YOUR OWN!