MaNGOS Server Setup Guide

MaNGOS Four / Classic Server Setup Guide

Step 1: Update Your Server

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Packages

sudo apt install git make cmake build-essential libssl-dev libbz2-dev \
default-libmysqlclient-dev libace-dev python2 net-tools screen gdb mariadb-server mariadb-client -y

Step 3: Create a Server User and Folder Structure

sudo adduser mangos
sudo usermod -aG sudo mangos
cd ~
mkdir -p ~/mangos/four/db
mkdir -p ~/mangos/four/bin
mkdir -p ~/mangos/four/gamedata
mkdir -p ~/mangos/four/logs
        

Step 4: Setup the Database

sudo mysql
CREATE USER 'mangos'@'localhost' IDENTIFIED BY 'mangos';
GRANT ALL PRIVILEGES ON *.* TO 'mangos'@'localhost' WITH GRANT OPTION;
CREATE DATABASE IF NOT EXISTS mangos_auth CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE IF NOT EXISTS mangos_characters0 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE DATABASE IF NOT EXISTS mangos_world0 CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
EXIT
        

Step 5: Clone the Database Repo Without Broken Submodules

cd ~/mangos/four/db
git clone --recursive https://github.com/mangosfour/database.git ~/mangos/four/db/database

# Remove the broken Translations submodule
cd ~/mangos/four/db/database
git submodule deinit -f Translations
git rm --cached Translations
rm -rf .git/modules/Translations

# Update remaining submodules (Realm)
git submodule update --init --recursive
        

Step 6: Import the Database

# Import the auth database
mysql -u mangos -p mangos_auth < ~/mangos/four/db/database/Realm/Setup/realmdLoadDB.sql

# Import character and world databases
mysql -u mangos -p mangos_characters0 < ~/mangos/four/db/database/Character/Setup/characters.sql
mysql -u mangos -p mangos_world0 < ~/mangos/four/db/database/World/Setup/world.sql
        

Step 7: Fix the Realmlist Table

If your realmlist table is empty, insert a row manually:

mysql -u mangos -p
USE mangos_auth;

INSERT INTO realmlist 
    (id, name, address, localAddress, localSubnetMask, port, icon, realmflags, timezone, allowedSecurityLevel, population, realmbuilds)
VALUES
    (1, 'ServerNameHere', '192.168.x.x', '192.168.x.x', '255.255.255.0', 8085, 0, 2, 0, 0, 0, '33555');

SELECT * FROM realmlist;
EXIT
        

This ensures your realm is recognized by the server.

Step 8: Clone and Build the Server

cd ~/mangos/four
git clone --recursive https://github.com/mangosfour/server.git ~/mangos/four/server

cmake -S ~/mangos/four/server/ -B ~/mangos/four/build/ \
  -DBUILD_MANGOSD=1 -DBUILD_REALMD=1 -DBUILD_TOOLS=1 \
  -DUSE_STORMLIB=1 -DSCRIPT_LIB_ELUNA=1 -DSCRIPT_LIB_SD3=1 -DPLAYERBOTS=1 -DPCH=1

cd ~/mangos/four/build
make -j$(nproc)
make install
        

Step 9: Copy Server and Game Data Files

cp ~/mangos/four/build/install/bin/mangosd ~/mangos/four/bin/
cp ~/mangos/four/build/install/bin/realmd ~/mangos/four/bin/
cp ~/mangos/four/build/install/bin/tools/*-extractor ~/mangos/four/gamedata/
cp ~/mangos/four/build/install/bin/tools/*.sh ~/mangos/four/gamedata/
cp ~/mangos/four/build/install/bin/tools/offmesh.txt ~/mangos/four/gamedata/
chmod -R a+w ~/mangos/four/gamedata
cd ~/mangos/four/gamedata
chmod +x ExtractResources.sh
./ExtractResources.sh
        

Step 10: Configure Server

cd ~/mangos/four/build/etc
cp *.dist ~/mangos/four/etc/
cd ~/mangos/four/etc
cp mangosd.conf.dist mangosd.conf
cp realmd.conf.dist realmd.conf
cp ahbot.conf.dist ahbot.conf

# Edit database connection info and server settings in these files
nano mangosd.conf
nano realmd.conf
        

Step 11: Run the Server

cd ~/mangos/four/bin
screen -S realm -d -m ./realmd
screen -S mangos -d -m ./mangosd
        

Use screen -r realm or screen -r mangos to attach to logs.

Step 12: Update Your Client

# In your WoW client folder:
set realmlist <Server-IP-or-Hostname>
        

Default accounts:

USER: ADMINISTRATOR | PASSWORD: ADMINISTRATOR
USER: GAMEMASTER   | PASSWORD: GAMEMASTER
USER: PLAYER       | PASSWORD: PLAYER
USER: MODERATOR    | PASSWORD: MODERATOR