How to Create a MU Online Mobile Server — Step by Step
Learn how to set up and administer a MU Online Mobile private server from scratch, covering infrastructure, configuration, and network management.
Running a private MU Online Mobile server is a complex but rewarding technical project. Whether you are building a test environment for development purposes or managing a community server, understanding every layer of the stack — from the operating system to the in-game configuration files — is essential. This guide walks through the full setup process in a structured, hands-on way.
1. Planning Your Infrastructure
Before installing any software, define the scope of your server. Ask yourself how many concurrent players you expect, whether you need geographic redundancy, and how you will handle backups and updates.
A baseline production-grade setup consists of three logical tiers:
- Game Server — the process that handles client connections, game logic, and real-time events.
- Database Server — stores character data, item inventories, accounts, and logs.
- Web/API Layer — registration portal, patch distribution, and admin panel.
Even if you run all three on a single physical machine during development, keeping them logically separated from the start makes migration easier later.
Choosing the Operating System
Ubuntu 22.04 LTS is the recommended base. It has a five-year long-term support window, excellent documentation, and broad compatibility with the tooling used in the open-source emulation community.
Update the system immediately after provisioning:
# System update and essential packages
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential git curl wget unzip \
net-tools ufw fail2ban screen htop
# Set the system timezone
sudo timedatectl set-timezone America/Sao_Paulo
2. Preparing the Database Layer
MU Online Mobile servers typically rely on MySQL 8.x or MariaDB 10.x. The database stores all persistent game state, so its configuration directly affects both performance and data integrity.
Installing and Securing MySQL
# Install MySQL Server
sudo apt install -y mysql-server
# Run the security hardening wizard
sudo mysql_secure_installation
# Connect and create the game database and user
sudo mysql -u root -p <<'EOF'
CREATE DATABASE mu_mobile CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'mu_admin'@'127.0.0.1' IDENTIFIED BY 'CHANGE_THIS_PASSWORD';
GRANT ALL PRIVILEGES ON mu_mobile.* TO 'mu_admin'@'127.0.0.1';
FLUSH PRIVILEGES;
EOF
Key MySQL Configuration Parameters
Open /etc/mysql/mysql.conf.d/mysqld.cnf and tune the following values according to your available RAM:
# /etc/mysql/mysql.conf.d/mysqld.cnf — performance tuning block
[mysqld]
# → InnoDB buffer pool should be ~70% of dedicated DB RAM
innodb_buffer_pool_size = 2G
# → Log file size controls crash-recovery speed vs. write throughput
innodb_log_file_size = 512M
# → Keep only local connections unless the DB is on a separate host
bind-address = 127.0.0.1
# → Tune based on expected concurrent player queries
max_connections = 300
# → Slow query log helps identify problematic queries early
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 2
After editing, restart the service:
sudo systemctl restart mysql
sudo systemctl enable mysql
> [!WARNING] > Never leave the default root password empty in a production environment. Always bind MySQL to 127.0.0.1 unless the database is on a separate host — in that case, use a private network interface, never the public IP, and enforce TLS for the connection.
3. Configuring the Game Server Process
The game server executable and its configuration files are the heart of the setup. Configuration is done through a set of structured INI or XML files, depending on the server framework you are using.
Directory Layout
A clean directory structure prevents permission errors and simplifies log rotation:
/opt/mu-mobile/
├── bin/ → game server executables
├── config/ → all server configuration files
│ ├── server.ini → main server parameters
│ ├── rates.ini → experience, drop, and zen rates
│ └── network.ini → port and connection settings
├── data/ → static game data files (maps, items, monsters)
├── logs/ → runtime logs (rotate with logrotate)
└── scripts/ → startup and maintenance scripts
Create the structure and assign ownership:
sudo mkdir -p /opt/mu-mobile/{bin,config,data,logs,scripts}
sudo useradd -r -s /usr/sbin/nologin muserver
sudo chown -R muserver:muserver /opt/mu-mobile
Core Server Configuration
Edit /opt/mu-mobile/config/server.ini:
# /opt/mu-mobile/config/server.ini
[Server]
ServerName = ViciadosMU Mobile → displayed in client and logs
MaxPlayers = 500 → hard cap on concurrent connections
ServerID = 1 → unique ID when running multiple zones
MaintenanceMode = false → set true to block logins during updates
[Database]
Host = 127.0.0.1
Port = 3306
Database = mu_mobile
User = mu_admin
Password = CHANGE_THIS_PASSWORD
ConnectionPool = 20 → keep at 10–25 for most deployments
[Rates]
ExperienceRate = 5 → multiplier over base EXP table
DropRate = 3 → item drop multiplier
ZenRate = 2 → currency drop multiplier
[Network]
BindAddress = 0.0.0.0
GamePort = 55901
ChatPort = 55902
ConnectTimeout = 30 → seconds before idle handshake drops
MaxConnectionsPerIP = 3 → DDoS mitigation at application layer
4. Firewall and Network Security
A correctly configured firewall is non-negotiable for a public-facing server.
# Reset UFW to defaults and define the policy
sudo ufw default deny incoming
sudo ufw default allow outgoing
# Allow SSH (restrict to your IP in production)
sudo ufw allow 22/tcp
# Allow game traffic
sudo ufw allow 55901/tcp # game port
sudo ufw allow 55902/tcp # chat port
sudo ufw allow 80/tcp # registration portal (HTTP)
sudo ufw allow 443/tcp # registration portal (HTTPS)
sudo ufw enable
sudo ufw status verbose
> [!TIP] > For SSH, replace allow 22/tcp with a rule limited to your administrative IP: sudo ufw allow from YOUR_IP to any port 22. This single change eliminates the vast majority of automated brute-force attempts that target public servers.
Install and configure Fail2Ban to block repeated authentication failures:
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
# Check active jails
sudo fail2ban-client status
5. Process Management and Automatic Restart
Running the game server inside a systemd unit ensures it restarts on crash and starts automatically on reboot.
Create /etc/systemd/system/mu-mobile.service:
[Unit]
Description=MU Online Mobile Game Server
After=network.target mysql.service
Requires=mysql.service
[Service]
Type=simple
User=muserver
WorkingDirectory=/opt/mu-mobile
ExecStart=/opt/mu-mobile/bin/gameserver --config /opt/mu-mobile/config/server.ini
Restart=on-failure
RestartSec=10
StandardOutput=append:/opt/mu-mobile/logs/stdout.log
StandardError=append:/opt/mu-mobile/logs/stderr.log
[Install]
WantedBy=multi-user.target
Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable mu-mobile
sudo systemctl start mu-mobile
sudo systemctl status mu-mobile
6. Monitoring and Maintenance
Ongoing administration requires log review, database backups, and performance monitoring.
Automated Backups
Create /opt/mu-mobile/scripts/backup.sh:
#!/usr/bin/env bash
# backup.sh → daily database dump with 7-day retention
BACKUP_DIR="/var/backups/mu-mobile"
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
mkdir -p "$BACKUP_DIR"
mysqldump -u mu_admin -p'CHANGE_THIS_PASSWORD' mu_mobile \
| gzip > "${BACKUP_DIR}/mu_mobile_${TIMESTAMP}.sql.gz"
# Remove backups older than 7 days
find "$BACKUP_DIR" -name "*.sql.gz" -mtime +7 -delete
Schedule it with cron:
chmod +x /opt/mu-mobile/scripts/backup.sh
# Add to crontab: run at 03:00 every day
(crontab -l 2>/dev/null; echo "0 3 * * * /opt/mu-mobile/scripts/backup.sh") | crontab -
> [!TIP] > Test your backup script manually before relying on it. A backup that has never been validated is not a real backup. Run a restore into a test database at least once per month to confirm integrity.
Log Rotation
Create /etc/logrotate.d/mu-mobile:
/opt/mu-mobile/logs/*.log {
daily
rotate 14
compress
delaycompress
missingok
notifempty
postrotate
systemctl kill -s HUP mu-mobile.service
endscript
}
Conclusion
Setting up a MU Online Mobile server is a multi-layered process that demands attention to infrastructure, security, and ongoing administration. Each component — the OS, database, game server configuration, firewall, and monitoring — must work in harmony. Take the time to validate each layer before exposing the server to the public, keep regular backups, and review your logs frequently. A well-maintained server provides a stable, enjoyable experience for the entire community.
Perguntas frequentes
What are the minimum hardware requirements for a MU Online Mobile server?
For a small community (up to 50 concurrent players) you need at least a quad-core CPU at 3.0 GHz or higher, 8 GB of RAM, a 100 GB SSD, and a stable broadband connection with at least 100 Mbps upload. For larger populations, scale to 16–32 GB RAM and a dedicated database machine.
Which operating system is best for hosting the server?
Linux (Ubuntu 22.04 LTS or Debian 12) is the recommended choice. It offers better performance, stronger stability under long-running processes, and a wider range of open-source administration tools. Windows Server is also viable but consumes more baseline resources.
How do I protect my server from DDoS attacks?
Enable SYN-cookie protection in the kernel, configure iptables or nftables rules to rate-limit incoming packets per IP, and use a cloud-based upstream filter when possible. Also set connection limits in your game server's network configuration to cap the number of simultaneous connections from a single IP.
Can I run the database on the same machine as the game server?
For testing or very small communities this is acceptable, but for production it is strongly recommended to separate them. A dedicated database host reduces I/O contention, makes backups simpler, and allows you to scale each component independently.