Hosting a free & powerful Minecraft server on OCI free tier resources

Akhil Sudhakaran
Just Another Geeky Blog
6 min readAug 22, 2022

In this story, I am going to show you how to setup and run a private Minecraft server in the cloud. Oracle Cloud Infrastructure (OCI) has a very generous free tier which we would be using in order to achieve this.

We will be deploying an Ampere A1 compute instance, which uses an arm based processor. The free tier allows us to deploy one with up to 4 cores and up to 24 GB of RAM absolutely free forever!! That is more than enough resources to have a lobby of about 30 friends.

Before we begin make sure that you are signed up for an Always Free Account in OCI. If you do not have one yet, go on over to cloud.oracle.com/free and click on ‘Sign Up’ and complete the steps that follow. Do keep in mind that OCI requires the user to have a credit card in order to complete the sign up process.

Create a Virtual Machine Instance

Let us start by bringing up a new VM in Oracle Cloud. To spin one up, all you would need to do is to click on ‘Create a VM Instance’ right on the home page of the Oracle Cloud console.

Give your VM a name and head on over to ‘Image and shape’ and click on ‘Edit’. Make sure that the image used is Oracle Linux 8 and the shape is an Ampere A1 with 4 cores OCPU and 24 GB of RAM.

Head on over to ‘Networking’ and click on ‘Edit’. Make sure that you are assigning a Public IPv4 address since your server will not be accessible from the internet otherwise. If this is your first instance on Oracle Cloud leave the rest of the fields with default values, if not then either reuse an existing subnet or create a new one.

In the ‘Add SSH keys’ section, choose ‘Generate a key pair for me’ and make sure you save the private and the public key since we would be needing it to access the machine later on.

You can leave the other fields to the default value and go on ahead by clicking on ‘Create’.

You will be redirected to the Instance Details page and you instance should be in the ‘PROVISIONING’ state and the icon would be in orange.

After about a minute or so, the state should change to ‘RUNNING’ and the icon should turn green. Once it is ready take note of the public IP address of your VM.

Connecting to the cloud instance

To connect to you VM you’ll need the public IP Address of the instance, the private key that was downloaded earlier and an SSH client(PuTTY, Termius or via Windows Terminal).

  • Connect to the VM via the SSH client tool:
ssh opc@<IP Address of VM> -i <path to private key>
  • Minecraft server software is an application packaged as a jar file. We will need Java to run this software. You’ll need to install the Java Development Kit (JDK). Run the yum list command to get to know the list of available JDK packages and then choose the latest version available.
$ yum list jdk*
  • The output of the above command should look something like this:
Available Packages
jdk-11.aarch64 2000:11.0.16-ga ol8_oci_included
jdk-11.0.10.aarch64 2000:11.0.10-ga ol8_oci_included
jdk-11.0.11.0.1.aarch64 2000:11.0.11.0.1-ga ol8_oci_included
jdk-11.0.12.aarch64 2000:11.0.12-ga ol8_oci_included
jdk-15.0.2.aarch64 2000:15.0.2-ga ol8_oci_included
jdk-16.0.1.0.1.aarch64 2000:16.0.1.0.1-ga ol8_oci_included
jdk-16.0.2.aarch64 2000:16.0.2-ga ol8_oci_included
jdk-17.aarch64 2000:17.0.4-ga ol8_oci_included
jdk-18.aarch64 2000:18.0.2-ga ol8_oci_included jdk1.8.aarch64 2000:1.8.0_341-fcs ol8_oci_included
  • Choose the latest version of the jdk package and install it with yum
$ sudo yum install jdk-18.aarch64
  • Once done, check and confirm the java installation:
$ java --version
java 18.0.2 2022-07-19
Java(TM) SE Runtime Environment (build 18.0.2+9-61)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.2+9-61, mixed mode, sharing)

Add ingress rules to allow for public access to the server

  • In the instance dashboard, navigate to the subnet page.
  • Click on the default security list.
  • Click on ‘Add Ingress Rules’.
  • Add 2 ingress rules, one for TCP and the other for UDP. Populate Source CIDR with 0.0.0.0/0 and the Destination Port Range with 25565 (The default port used by Minecraft server application)
  • Log into the vm via SSH and open up the ports for TCP and UDP using the firewall-cmd:
sudo firewall-cmd --permanent --zone=public --add-port=25565/tcp
sudo firewall-cmd --permanent --zone=public --add-port=25565/udp
sudo firewall-cmd --reload

Setting up the Minecraft Server application and connecting to it

  • Create a directory for the Minecraft server files and change into that directory.
$ mkdir minecraft
$ cd minecraft
  • Download the server .jar file into the directory by getting the link to the same from here.
$ wget https://<server.jar link>
  • Run the application once to generate required files:
$ java -Xmx1024M -Xms1024M -jar server.jar nogui
  • Edit the eula.txt file that is generated and change the eula flag from false to true.
  • Start the server by running the following command (Note that more RAM can be provided to the extra params to java, the following command sets 1 gig ram):
$ java -Xmx1024M -Xms1024M -jar server.jar nogui
  • After some time the server should be up and running.

Note that you can start a tmux session and run the above command there to make sure that the server does not terminate when the client is closed.

  • Spin up your copy of Minecraft: Java Edition (If you don't have one, either purchase one from Mojang or you could even get a copy from your Microsoft game pass subscription).
  • Select Multiplayer -> Add Server and fill in a Server name and the public IP Address on the ‘Server Address’ input field and click on ‘done’.
  • You should see the server up and available to play on.

Do keep in mind that what is discussed here are the default settings and properties for the Minecraft server. There are a lot more parameters one can set in the server.properties file to change how the server behaves.

Summary

In this story, we looked at how to spin up an Ampere A1 instance on OCI with an always free account, set networking rules on OCI and the firewall settings of the VM to allow traffic via the internet and setup steps to run the Minecraft Server application.

Have Fun!! 🤩

--

--