The follow document covers how to build a server which allows the usage of Wrath of the Lich King (3.3.5a) clients to connect and play World of Warcraft on.
My server environment is a Intel Xeon L5420 2.50GHz with 8 cores, 16GBs of RAM, a 240GB SSD drive and Ubuntu Server 19.10. The system has a static public IP address. I recommend utilizing Google if you need assistance in configuring the basics such as disk space allocation, networking or general system administrative tasks. I created a separate system user in which I would run my CMaNGOS worlds and realm daemon under. I named this system user,
mangos. Easy to remember!
useradd -m -d /home/mangos -c "MaNGOS" -U mangos
- First you'll want to install some software which is essential to getting CMaNGOS built.
$ sudo apt install build-essential gcc g++ automake autoconf make \
patch libmysql++-dev mysql-server libtool libssl-dev grep binutils zlibc \
libc6 libbz2-dev cmake subversion libboost-dev libboost-all-dev
During the installation process of the above softwares you should be prompted to enter in a password for the root MySQL user. I generally choose something different then my system root user password for security purposes. It's up to you though.
Self Compiled Git
I prefer to use the latest version of Git available, however this requires compiling it yourself. Totally fine though and relatively easy. I do this as my root user.
$ sudo apt install libcurl4-openssl-dev gettext
$ cd /usr/local/src
$ wget https://github.com/git/git/archive/v2.23.0.tar.gz
$ tar zxvf v2.23.0.tar.gz
$ cd git-2.23.0/
$ make configure
$ ./configure --prefix=/usr
$ sudo make install
# git --version
git version 2.23.0
Fetching the CMaNGOS Files
- As your mangos user you'll want to run this command within it's home directory:
$ git clone https://github.com/cmangos/mangos-wotlk.git mangos
This will clone the CMaNGOS source code onto your system. This may take several minutes to run as there's a fair amount of source code to fetch.
- Our next step is to download the database. This will contain the content of your server, things like spells, and critters, etc... This one is important if you want there to be stuff inside your server. Run this as mangos in it's home directory (/home/mangos).
$ git clone https://github.com/cmangos/wotlk-db.git
This will create a new directory in /home/mangos called mangos.
- At this point you should have a directory structure similar to this:
I recommend also creating several more directories inside /home/mangos:
World of Warcraft (this name is up to you, I just kept it the same as the client structure)
At the bare minimum you should create the build directory. The others are optional, but as someone who appreciates organization I have them on my system.
Compiling the Source Code
- Go into your
build directory and run the following command:
$ cmake ../mangos -DCMAKE_INSTALL_PREFIX=\../mangos/run -DPCH=1 -DDEBUG=0 -DBUILD_PLAYERBOT=ON -DBUILD_EXTRACTORS=ON
This shouldn't take much time to run (I believe it took around 5-10 seconds for mine to complete).
- Now we're going to ACTUALLY compile stuff, YAY!! Run this command from the build directory:
This can take up to 45 minutes to complete depending on the hardware of your system. When this has finished running, run:
$ make install
Obtain & Extract Game Resources
This next part will require that you have access to a Windows PC. I had attempted to get this done under Linux but the map extraction tools seem to broken and no longer compile in a Linux environment.
The extraction tools are now able to be built and used in a Linux environment. For this, take your
Data directory and place it in your previously created
World of Warcraft directory. You'll take a copy of the tools from the /home/mangos/build/contrib directory and place them into your
World of Warcraft directory. A directory is created for each of the extractors:
extractor mmap vmap_assembler vmap_extractor
Just go into each of the directories and copy these binaries into your
World of Warcraft directory with your
Data directory. Then you can run them in the following order:
vmap_assembler tool, you will need to first create a
vmaps directory as well as specify directories when you run the command. While you're within your
World of Warcraft directory, run the following:
$ mkdir vmaps
$ ./vmap_assembler Buildings vmaps
For the MoveMapGen tool you will need to create an mmaps directory first. Again, create it within your World of Warcraft directory:
$ mkdir mmaps
These may take some time to run. The
MoveMapGen application can take a VERY long time to run. In infact had to leave it running over night, so it's possible it can take 12-18 hours to run (though in recent tests it may be closer to 4-8 hours). The files generated by
MoveMapGen are not necessary to run your server though. Files generated by the other applications are though.
Once you get your files (running the applications should have generated several directories --
vmaps...) extracted, place those aforementioned directories into your
Creating Necessary Databases
- This step you can perform while you're extracting resources from the previous step. In this step we're going to get our databases setup.
First we'll run a couple SQL files through MySQL. Remember when prompted for a password it will be your root MySQL password, not your system root password. Also, run these commands from
$ mysql -u root -p < mangos/sql/create/db_create_mysql.sql
Next we'll run a script to initialize the dbc data, and the mangos, characters and realmd databases.
mysql -u root -p mangos < mangos/sql/base/mangos.sql
for sql_file in `ls mangos/sql/base/dbc/original_data/*.sql`; do mysql -uroot -p --database=mangos < $sql_file ; done
for sql_file in `ls mangos/sql/base/dbc/cmangos_fixes/*.sql`; do mysql -uroot -p --database=mangos < $sql_file ; done
mysql -u root -p characters < mangos/sql/base/characters.sql
mysql -u root -p realmd < mangos/sql/base/realmd.sql
- Now we're going to fill up our database (and world) with some content! Run these commands from /home/mangos as the mangos user.
$ cd /home/mangos/wotlk-db
This will create a file
InstallFullDB.config. Open this file with your favorite text edit and edit it to match your values. The most important part is setting the right MySQL username and password - for some reason only inputting the root MySQL user and password here works for me. It's possible I may have been missing some permission in MySQL for my mangos user which is why it didn't work. Once edited, save the file and exit the editor. Now run
./InstallFullDB.sh again. This should important the full databases and any updates to the database.
Setup the CMaNGOS Configuration Files
Navigate into the directory
/home/mangos/mangos/run/etc. This directory is the location of your world, realm and Auction House Bot configurations (if you so choose to use the bot). Run these commands to start configuring:
$ cd /home/mangos/mangos/run/etc
$ cp mangos.conf.dist mangos.conf
$ cp realmd.dist.conf realmd.dist.conf
$ cp playerbot.conf.dist playerbot.conf
If you want to utilize AuctionHouseBot, you can copy it's configuration file from
If you want to utilize PlayerBot edit the playerbot.conf file. Most importantly in that file is setting the
PlayerbotAI.DisableBots option to 1.
Now you'll want to review and configure each of those files.
Updating Your Realm Information in MySQL
Now you can login to MySQL and update the realm settings in realmd.realmlist if you wish. You can use something like this:
SELECT * FROM realmlist;
UPDATE realmlist SET name='Your Realm Name' WHERE id='1';
UPDATE realmlist SET address='Your Servers IP Address' WHERE id='1';
I'd also recommend setting the
Running the world and realm Daemons
Now at this point you should be able to run
/home/mangos/mangos/run/bin. You will need to use the screen application or separate SSH login sessions because you cannot run both daemons one right after the other. So it's either screen sessions or individual SSH login sessions. I'd just recommend using screen sessions.
$ cd /home/mangos/mangos/run/bin
Creating Yourself an Account
You can use the following command to create yourself an account on the server (do this after the
mangosd daemon has started up and you're at the
mangos > prompt:
account create $username $password