Introduction

I really like Ragnarok Online and it consist most of my early teenage year.
After it changed to pay to play model, I turned into private servers and subsequently interested in how to make a private ragnarok online server.
Most guide I found online is a bit unclear so I decided to make one to help future people that are interested -w-.
Note: This is kinda like gray area of law, hosting ragnarok server is not illegal but modification and distribution of client is, proceed carefully.

Prerequisite

In this guide I will assume you have a little bit knowledge on Linux command.

I used Digital Ocean VPS for demonstration purpose.

You need at least 512 MB RAM for the server.
Recommended 1GB RAM if you want smooth performance.

For this tutorial I will use Ubuntu 14.04, but no worries, you can use any Linux distro. Just replace the apt-get command with other repository code.

Use default setting and click "Create Droplet"

Follow this guide to create a new non-root user for the server
Using root account is dangerous if you dont know what you are doing ^^;

After setting up the new account, login with your new account to your server.

GUI for managing database

To make it easier to manage database, we need to install nginx for web server,php for processing, MySQL for database and phpMyAdmin to access database using GUI.
I prefer to use Nginx than Apache as it consumes less RAM. If you have a web server running before then you can skip to next section.

Follow this guide to install Nginx, PHP, MySQL

phpMyAdmin installation guide

sudo apt-get install phpmyadmin

During the installation, phpmyadmin will ask you if you want to configure the database with dbconfig. Go ahead and choose yes.

Input MySQL database password when prompted and click ok.

When phpmyadmin prompts you to choose a server (either apache or lighttpd) hit tab, and select neither one.

Create a symbolic link (shortcut, so you can access it with http://your_server/phpmyadmin)
sudo ln -s /usr/share/phpmyadmin/ /usr/share/nginx/html/phpmyadmin

Restart the nginx server
sudo service nginx restart

By accessing http://your_server/phpmyadmin , it should look like this :

Log in with your MySQL username and password.
Create a database named herculesrag (or other name you like, I will use this name for the following section) using phpmyadmin before proceeding to next step.

Installing and configuring Hercules server

We will be using Hercules server as emulator for Ragnarok Online's server.
First, install the dependency.
apt-get install git make gcc mysql-server libmysqlclient-dev zlib1g-dev libpcre3-dev screen

Then navigate to the folder you desire, then clone the Hercules folder from github.
git clone https://github.com/HerculesWS/Hercules.git ~/Hercules

Change the current directory to the Hercules folder we just copied.
cd Hercules

Change directory to sql-files folder, we need to import some stuff to database first.
cd sql-files

Login to mysql using terminal/command prompt.
mysql -u mysql username -p
Then type your mysql user's password when prompted.

Execute the following commands :
(replace herculesrag with your database name)
herculesrag < item_db.sql
herculesrag < item_db2.sql
herculesrag < item_db_re.sql
herculesrag < logs.sql
herculesrag < main.sql
herculesrag < mob_db.sql
herculesrag < mob_db2.sql
herculesrag < mob_db_re.sql
herculesrag < mob_skill_db.sql
herculesrag < mob_skill_db2.sql
herculesrag < mob_skill_db_re.sql

Go back to Hercules folder
cd ../

For 64 bit Linux, type the following code to compile Hercules.
./configure
make sql

For 32 bit Linux, type the following code to compile Hercules.
./configure --disable-64bit
make sql plugins

Before you start the server, use Filezilla or any other ftp client to access your server and go to Hercules/conf directory.
Download,edit and reupload the following file : char-server.conf , inter-server.conf, login-server.conf, map-server.conf.

Replace the server ip with your server ip.
Replace the sql db,user and password with your own database information.
Replace the following with your desired username and password for the server account.

Then go to phpmyadmin, access your hercules_rag table and choose the login table, find the row with account_id '1' .

Replace the userid and user_pass with the username and password you typed just now.

Starting the server

Navigate to the Hercules folder,
Change the file access permission on the start file
chmod a+x athena-start

To start the server, type
./athena-start start
To stop,
./athena-start stop
To restart,
./athena-start restart

Ta-dah! Your ragnarok server should be running fine now , cheers!

Extra Information

Hercules server official wiki
Client files and tools