You Will Need
- A
Java Minecraft AccountMinecraft license, as of 07 June 2022 these games are now bundled together. - A credit / debit card for oracle account verification (anti-bot process)
Getting Started
This guide will assume you have already gone through the sign-up process for the OCI console. Once this step has been completed you can follow the rest of this guide.Creating a Virtual Machine instance.
Don’t Panic! This part isn’t as complicated as it sounds. Once you have finished setting up your account, click the “Create a VM instance” panel.
Give your VM instance a name. Anything will work, but make it easily identifiable. You can leave the default (Root) compartment selected.
Now, Scroll down to the “Image and Shape” section. Make sure “Ubuntu LTS 22.04 (Or just the latest build)” Is selected. Then click “Change shape”. Under “Shape series”, Select “Ampere”. Now set the amount of Ram and CPU Cores you would like.
:::tip
You should allocate no less than 2 CPU Cores and 8GB of ram to the VPS. After you have finished selecting the shape, make sure the “Always free eligible” Tag is showing.
:::
Next, we need to create a VCN (Or Virtual Cloud Network). If you already have a VCN, use that. If not, select “Create a Virtual Cloud Network” Copy the settings in the picture below!
We’ll need an SSH Key pair to access the server remotely. To generate a keypair, tick the box that says “Generate a new keypair” and then download both the public and private keys. Don’t lose these, or else you won’t be able to connect to your server remotely!
Leave the boot volume settings alone and hit “Create”!
Once you hit “Create”, you will be redirected to your VM details and your VM will be in a “Provisioning” state. Wait for it to be in a running state, which should take 30-60 seconds. Under the “Instance access”, you should see an IP Address. Copy it.
Connecting to your VM with SSH.
There are multiple SSH clients out there from classics such as PuTTY and newer clients such as Termius. For simplicity and universal sake we will use a command prompt / terminal window. Open a command prompt / terminal window and type in the following command :Y or typing Yes in the confirmation box. You should then see a screen similar to the below.
Our VM is now deployed and ready to configure with Java and our server.
Installing Java
Ubuntu uses theAPT package manager, it’s generally considered a good idea to run the following commands before trying to install an application for the first time.
version-number to determine if you would like to install Java 8, Java 11 or Java 17.
:::
Creating the Minecraft server
We are nearing the end of this guide, only a few more things to do! Before we download anything, we should make a directory to put our server in. You can do this by typing the following commands.--content-disposition we’re preventing the downloaded file being an extension-less file called download.
To confirm the file has downloaded correctly you can use the ls -al command to display the contents of the minecraft-server-folder.
Done in (seconds) you can press shift + c to end the session or type stop like a normal server.
So now technically everything is setup and ready - If your newly created VPS was sitting in your house you would be able to play right now… but it’s not - so we need to open the 25565 port to the internet.
Making it accessible over the internet (Port Forwarding)
While we’re still connected via SSH it will save time later for us to configure the servers local firewall now. :::info This tutorial uses Ubuntu and UFW. If you chose another another distro at the start of this guide you will most likely have a different wrapper, if this is the case you will need to consult the docs for how best to open ports 25565 for TCP and UDP traffic. ::: To open TCP and UDP traffic within Ubuntu we need to use the following commands.
Then click the “Default Security list” link.
And Add an “Ingress Rule”. Copy the configuration shown here ,Then create another ingress rule with the same configuration, but change the “IP Protocol” to TCP, as shown below.
Switching back to the server, you should now be able to start the server again using the same command we used previously.
Optional Configuration
The above steps will get you up and running with the basics, but some settings can be adjusted further to make life easier for yourself as an admin.Adjusting RAM Allocation
We go over adjusting the RAM allocation in more depth here.Installing ‘Screen’
Screen is an application that allows for you to run your server in the background even after you close your SSH session. To install screen run the following command.CTRL + A + D. You should now be able to close the command prompt window without the server crashing. If you need to return to your screen windows you can use the command screen -r.
Installing Plugins
We go over installing plugins in more depth here.JVM Flags (Aikar)
We go over adjusting the start-up flags in more depth here.Disclaimer
This guide has been modified slightly to cater for the needs of this project, setup.md has adjusted the following from the original article.- Moved from Oracle Linux to Ubuntu LTS
- Moved some Optional Configuration topics to either their own pages within our KB / hyperlinked to existing documents (this prevents topic duplication).
- Ordering / Combining of steps in relation to EULA and port forwarding.