This guide provides detailed instructions to help you build and configure a SWGEmu server on a Debian 11 virtual machine. All necessary steps, including the installation of dependencies and key configurations, are covered to ensure a smooth setup process.
Begin by downloading Debian 11 Cinnamon from the official Debian archives:
Install Debian 11 Cinnamon on your machine. You can choose to install it on:
Follow the Debian installation prompts to complete the setup. Ensure that you have administrative (sudo
) privileges on the installed system.
After installation, update your package lists and upgrade existing packages to ensure your system is up to date.
sudo apt update && sudo apt upgrade -y
Install the necessary packages required for building the SWGEmu server.
sudo apt install -y build-essential git cmake zlib1g-dev liblua5.3-dev \
libboost-all-dev libssl-dev libdb5.3-dev default-jdk libmariadb-dev libmariadb-dev-compat
Explanation:
build-essential
: Provides compiler and linker utilities.git
: For cloning the repository.cmake
: For configuring the build system.zlib1g-dev
: Development files for the zlib compression library.liblua5.3-dev
: Development files for Lua 5.3.libboost-all-dev
: Boost libraries required for various functionalities.libssl-dev
: Development files for SSL, required for encryption.libdb5.3-dev
: Development files for Berkeley DB 5.3, required by SWGEmu.default-jdk
: Java Development Kit, required for Java components.libmariadb-dev
and libmariadb-dev-compat
: Development files for MariaDB, compatible with MySQL client libraries.Clone the Core3 repository from GitHub and switch to the unstable
branch.
cd ~
git clone https://github.com/swgemu/Core3.git
cd Core3
git checkout unstable
Verify the Branch:
git branch
Expected Output:
* unstable
The CMakeLists.txt
file is located inside the MMOCoreORB
directory.
cd ~/Core3/MMOCoreORB
mkdir build
cd build
Run CMake to configure the build system, specifying the build type.
cmake -DCMAKE_BUILD_TYPE=Release ..
Explanation:
-DCMAKE_BUILD_TYPE=Release
: Specifies that we want to build the server in release mode, which enables optimizations and excludes debug symbols.Start the compilation process.
make -j$(nproc)
Explanation:
make
initiates the build process.-j$(nproc)
utilizes all available CPU cores to speed up compilation.SWGEmu requires a database to store game data. We'll use MariaDB, which is a drop-in replacement for MySQL.
sudo apt install -y mariadb-server
Run the security script to improve MariaDB security.
sudo mysql_secure_installation
During the script:
Log into MariaDB as root:
sudo mariadb -u root -p
Enter the root password you set during the secure installation.
Inside the MariaDB shell, execute the following commands:
CREATE DATABASE swgemu;
CREATE USER 'swgemu'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON swgemu.* TO 'swgemu'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace 'your_password'
with a strong password of your choice.
Navigate to the sql
directory and import the schema.
cd ~/Core3/MMOCoreORB/sql
mysql -u swgemu -p swgemu < swgemu.sql
mysql -u swgemu -p swgemu < datatables.sql
Enter the password for the swgemu
user when prompted.
Update the server configuration to match your setup.
cd ~/Core3/MMOCoreORB/bin/conf
nano config.lua
Modify the following sections in config.lua
:
Update the database credentials to match those you set up in Step 7:
DBHost = "127.0.0.1",
DBPort = 3306,
DBName = "swgemu",
DBUser = "swgemu",
DBPass = "your_password",
Ensure DBPass
matches the password you set for the swgemu
database user.
Change DBSecret
to a unique and reasonably long value. This secret is used for internal authentication between server components.
DBSecret = "your_unique_secret", -- Change this! This value should be unique and of reasonable length.
Replace "your_unique_secret"
with a strong, unique string.
Adjust the LoginRequiredVersion
if necessary. This should match the client version you're using.
LoginRequiredVersion = "20050408-18:00",
If you're using a different client version, update this accordingly.
If you're not using Mantis for bug tracking, you can leave these settings as they are or comment them out.
-- MantisHost = "127.0.0.1",
-- MantisPort = 3306,
-- MantisName = "swgemu",
-- MantisUser = "swgemu",
-- MantisPass = "123456",
-- MantisPrfx = "mantis_", -- The prefix for your mantis tables.
After making the necessary changes, save and exit the editor.
In nano, press Ctrl+X
, then Y
, then Enter
.
Before running the server, you need to provide the necessary game data files. The SWGEmu server requires the original game .tre
files to function correctly.
.tre
files..tre
files in your game installation directory. These files typically include:
data_*.tre
patch_*.tre
data_sku1_00.tre
data_sku1_01.tre
data_texture_00.tre
patch_00.tre
By default, the server looks for the .tre
files in a specific directory. The expected directory is:
/home/your_username/Desktop/SWGEmu/
You can either use this default directory or specify a custom path in the server's configuration.
mkdir -p ~/Desktop/SWGEmu/
.tre
Files:
Place the .tre
files into the ~/Desktop/SWGEmu/
directory.
/home/your_username/SWGEmuTreFiles/
mkdir -p ~/SWGEmuTreFiles/
.tre
Files:
Place the .tre
files into the ~/SWGEmuTreFiles/
directory.
config.lua
to Set the Data Path:
nano ~/Core3/MMOCoreORB/bin/conf/config.lua
Add or update the following line:
DataPath = "/home/your_username/SWGEmuTreFiles/"
Ensure the path ends with a trailing slash /
.
Save and exit the editor.
Ensure that the server has read access to the .tre
files.
chmod 644 /path/to/your/tre/files/*.tre
Navigate to the bin
directory and start the server.
cd ~/Core3/MMOCoreORB/bin
./core3
Note: The server runs in the foreground. To kill it, press Ctrl+C
. To shut it down correctly, type exit
and hit enter.
If your server needs to accept external connections, configure your firewall accordingly.
sudo apt install -y ufw
sudo ufw allow 44419/tcp
sudo ufw allow 44419/udp
sudo ufw allow 44453/tcp
sudo ufw allow 44453/udp
sudo ufw allow 44455/tcp
sudo ufw allow 44455/udp
sudo ufw allow 44462/tcp
sudo ufw allow 44462/udp
sudo ufw allow 44463/tcp
sudo ufw allow 44463/udp
sudo ufw enable
Check Firewall Status:
sudo ufw status
If you are running swgemu as a VM, you will also need to allow the ports on the Windows host firewall. Here is a quick Powershell script to add them.
# Add both TCP and UDP on Port 44419 - Inbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Inbound Port 44419" -Direction Inbound -Protocol TCP -LocalPort 44419 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Inbound Port 44419" -Direction Inbound -Protocol UDP -LocalPort 44419 -Action Allow
# Add both TCP and UDP on Port 44419 - Outbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Outbound Port 44419" -Direction Outbound -Protocol TCP -LocalPort 44419 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Outbound Port 44419" -Direction Outbound -Protocol UDP -LocalPort 44419 -Action Allow
# Add both TCP and UDP on Port 44453 - Inbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Inbound Port 44453" -Direction Inbound -Protocol TCP -LocalPort 44453 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Inbound Port 44453" -Direction Inbound -Protocol UDP -LocalPort 44453 -Action Allow
# Add both TCP and UDP on Port 44453 - Outbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Outbound Port 44453" -Direction Outbound -Protocol TCP -LocalPort 44453 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Outbound Port 44453" -Direction Outbound -Protocol UDP -LocalPort 44453 -Action Allow
# Add both TCP and UDP on Port 44455 - Inbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Inbound Port 44455" -Direction Inbound -Protocol TCP -LocalPort 44455 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Inbound Port 44455" -Direction Inbound -Protocol UDP -LocalPort 44455 -Action Allow
# Add both TCP and UDP on Port 44455 - Outbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Outbound Port 44455" -Direction Outbound -Protocol TCP -LocalPort 44455 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Outbound Port 44455" -Direction Outbound -Protocol UDP -LocalPort 44455 -Action Allow
# Add both TCP and UDP on Port 44462 - Inbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Inbound Port 44462" -Direction Inbound -Protocol TCP -LocalPort 44462 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Inbound Port 44462" -Direction Inbound -Protocol UDP -LocalPort 44462 -Action Allow
# Add both TCP and UDP on Port 44462 - Outbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Outbound Port 44462" -Direction Outbound -Protocol TCP -LocalPort 44462 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Outbound Port 44462" -Direction Outbound -Protocol UDP -LocalPort 44462 -Action Allow
# Add both TCP and UDP on Port 44463 - Inbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Inbound Port 44463" -Direction Inbound -Protocol TCP -LocalPort 44463 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Inbound Port 44463" -Direction Inbound -Protocol UDP -LocalPort 44463 -Action Allow
# Add both TCP and UDP on Port 44463 - Outbound
New-NetFirewallRule -DisplayName "SWGEmu TCP Outbound Port 44463" -Direction Outbound -Protocol TCP -LocalPort 44463 -Action Allow
New-NetFirewallRule -DisplayName "SWGEmu UDP Outbound Port 44463" -Direction Outbound -Protocol UDP -LocalPort 44463 -Action Allow
Check logs for any errors or issues.
cd ~/Core3/MMOCoreORB/log
ls -l
Open log files with a text editor or view them with less
:
less filename.log