Many people have questions about how to properly set up a newly acquired VPS to run the rAthena emulator. To simplify this process, I created an automated script that handles all the necessary configuration quickly and easily.
Most tutorials available online focus on running the emulator on personal computers, but nowadays, the trend is to use a VPS for better performance and stability. With this script, you can set up your environment efficiently, even without advanced server knowledge.
For those who want to start a professional rAthena project, here are some tips:
1. Use MariaDB instead of MySQL
MariaDB is a community-developed fork of MySQL that offers several performance and optimization advantages, especially for large-scale applications like rAthena. While both database systems are compatible, MariaDB stands out due to its efficiency in handling intensive queries.
Benefits of using MariaDB:
Better Performance: MariaDB is optimized for handling large volumes of data and executes complex queries faster than MySQL.
Improved Storage Engines: Supports advanced engines like Aria and TokuDB, which enhance performance and reduce data fragmentation.
Faster Replication: Offers faster and safer master-slave replication, ensuring better data synchronization in distributed environments.
Open Source & Active Development: Fully open-source with a more active development cycle, meaning better features and faster bug fixes.
Optimized Thread Pooling: Handles multiple simultaneous connections efficiently, reducing CPU overhead and improving query response time.
For an rAthena server, this translates to faster character loading, smoother gameplay, and better handling of concurrent player actions.
2. Use nftables instead of iptables
nftables is a modern packet filtering framework that replaces the older iptables. It is now the default in most Linux distributions and provides better performance and flexibility when managing network rules, including basic DDoS protection.
Benefits of using nftables:
Higher Performance: Processes rules faster with a more optimized kernel implementation, reducing the impact on system resources.
Simplified Rule Management: Uses a cleaner and unified syntax, making it easier to create and manage complex firewall rules.
Better DDoS Mitigation: Supports more efficient rate limiting and packet inspection, allowing you to block basic DDoS attacks with minimal overhead.
Dynamic Rules: Allows for dynamic rule adjustments without the need to reload the entire firewall configuration.
IPv4/IPv6 Support: Handles both IPv4 and IPv6 rules natively, simplifying firewall management in modern environments.
For a professional rAthena project, nftables ensures better network protection, faster packet processing, and more efficient handling of traffic spikes during large player events or attacks.
Instructions to Use the Script:
Upload the script to your VPS
Use an SCP tool or copy-paste the script contents into a file called ubuntu.sh.
Make the script executable:
chmod +x ubuntu.sh
Run the script with root privileges:
sudo ./ubuntu.sh
Follow the interactive prompts:
Choose between MariaDB or MySQL.
Input the database name, database user, and password.
The script will:
Update system packages.
Install required dependencies for compiling rAthena.
Set up MySQL or MariaDB.
Install and configure phpMyAdmin at /phpmyadmin.
After completing these steps, your VPS will be ready to compile and run rAthena.
ubuntu.sh