Thursday 28 April 2016

How to run a Minecraft Server in the Oracle Cloud


UPDATE: this is an old post based on the Oracle Cloud Infrastructure Classic (OCI-C). There is an updated version of this post for running Minecraft on the Oracle Cloud Infrastructure (OCI).

---8<--------------------------------------------------------------------------------------------------------------------

This handson tutorial shows the steps needed to run a Minecraft Server on the Oracle Compute Cloud Service



Let's start in the My Services Dashboard and click on the Oracle Compute Cloud Service.


In the list of existing instances, click on Create Instance.


Choose the Oracle Linux 6.6 image, the smallest Shape should be more than sufficient.


Don't touch the defaults on the second page.


The Minecraft server is so small, that we do not need additional storage.


The SSH public key is important. If you don't have one, refer to the Oracle Cloud Documentation. What you need here are the contents of the .pub file, if you follow the documentation.


Take a last look at the summary and click on Create.


Wait a few minutes until the instance has been created. Then click on the menu icon on the right, chose View and copy the public IP address.


Now open your SSH client, like PuTTY in this example. Here paste the public IP address, give the session a name and click Save.


Enter the Auto-login username 'opc'.


Under Connection/SSH/Auth choose you private key file. Then save again and open your session.


Pull the Minecraft server directly from its publisher via

wget https://s3.amazonaws.com/Minecraft.Download/versions/1.9.2/minecraft_server.1.9.2.jar

Then start it:

java -jar minecraft_server.1.9.2.jar

After the first start, the server terminates immediately, because you have to accept the EULA first.


It created a new file eula.txt. Open it in vi and change the content to eula=true.


As the Minecraft server has an interactive console, it should be accessible even when the SSH console has been closed in between. I prefer to use screen for that, which is already preinstalled in Oracle Linux. So open a new screen with

screen -S minecraft


Now start the Minecraft server again. We are done with SSH, close the screen session via CRTL-A D or just close your PuTTY window. If you want to reconnect to your Minecraft server from a new SSH session, just type


screen -d -r minecraft


Back in the Oracle Cloud Services. The Minecraft server is running, but is blocked by the firewall. So we do need to configure that.


Click on the Network tab. The only port, that has been opened, is the one for SSH which we just used.


Under 'Security Applications', click on Create Security Application


The port for the Minecraft Server is 25565.


Now we need a rule for the application. Under Security Rules click on Create Security Rule.


Here, chose Minecraft as the Security Application and 'public internet' as Source Security List.

Now the Minecraft rule is shown under the SSH Rule.


Start Minecraft and configure a new Server. Give it a name and enter the public IP address of your instance.


Your Oracle Cloud instance will be listed in Minecrafts server list, notice the good ping. Double click to start your game.


Have fun with the Oracle Cloud and Minecraft!