If you have read the entirety of this guide or you're confused about any part, feel free to ask in my discord server. Please check the troubleshooting & faq section before asking. Your issue or question might've already been covered here. I try my best to keep this guide up to date, but I do forget about it at times and I could also miss anything in the guide when updating it to a new version. Please do your own research (for mods in particular) and try using newer versions of the mods/software available if it breaks!
This is a small list to explain the linux commands being used in this guide.
cd
- This allows us to change our working directory (also known as ./
) into another directory, by default, you will be in your home directory (/home/user/
also known as ~
). If you wish to go to a parent directory (the directory which your current directory is in), then you can simply use ..
as the destination.
mkdir
- This lets us create a directory, we use this to make one for housing our minecraft related files and we'll be relying on cd to get into it. This is all for making it cleaner instead of having all of your files in one place.
curl
- This is a tool to transfer data from a server, we use it to grab files such as the fabric installer and fabric mods.
sudo
- This stands for superuser do. It is used to execute commands as root (basically administrator) in this guide.
dnf
- This is what handles the packages on Oracle Linux, we use it to install various programs we'll utilize in this guide.
nano
- A terminal text editor to edit files.
screen
- A screen manager, this will manage a session for us that would otherwise not exist when we disconnect from ssh, therefore not having the Minecraft server stay up 24/7
man
- This command is not used in the guide, but I highly recommend learning it, as you can read manual pages from commands with it, always look at this if you're stuck first! (Example usage: man cd
).
firewall-cmd
- Firewall running on the server (yes, you have a software firewall managed by the vm and another one managed by Oracle Cloud, both will need to be configured.), we can use this to open ports for the firewall to let through.
In this guide, we will download various software (with the Oracle Linux OS provided by Oracle Cloud). Screen is used to handle a session to keep the server running, zip is a dependency for sdkman, sdkman is a package manager for SDK (software development kit) which (in my opinion) makes it easy to install jre (java runtime environment). You will also need a method to ssh into the machine, make sure you know how to use ssh keys (public and private) to connect to the machine with whatever software you're running. It is more safe than using a password!
If you're on Linux, I simply recommend using the terminal emulator of your choice to ssh and transfer files with, or transfer files with your file manager if you're more comfortable with that.
For Windows users, I recommend using PuTTy to access the terminal through ssh, if you wish to transfer files, I recommend WinSCP. With WinSCP, You'll most likely get dropped into the root directory, but you can simply just go to the home
directory and then the one with the name of your user.
I'm not going to explain this step, it should be straightforward.
Begin by navigating to "Create a VM instance"
Give the instance a name of your choice, such as minecraft-server
Scroll down to Image and Shape and Change the Shape to VM.Standard.A1.Flex
. For maximum performance, please change the shape to 4 cores instead of 1, however you should be fine to run it on 2 cores instead, it is up to your liking and how you wish to spend your resources. I also highly recommend you stick with Oracle Linux as that seems to be performing best on their hardware.
Afterwards, double check that the Always Free Eligible label persists next to the name.
Next up is making sure that it has a virtual cloud network with ipv4 address assigned and a subnet. You could create this with the setup shown in the image.
Next up, you will need some sort of ssh access, choose one of the options for ssh and handle it how you feel is best suited, you will need some sort of method to ssh into the machine in the end. After this, leave the boot volume defaults and create your virtual machine.
This is vital for anyone to be able to connect to your virtual machine, you will need to open port 25565 as UDP and TDP, to do this navigate to the control panel of your virtual machine and press on the subnet. Don't forget to write down your ip from the machine, this is to connect through it via ssh and minecraft later on.
Press on the default security list to change firewall rules.
Press the button to add an ingress rule
Add an ingress rules, only one for Ip Protocol TDP (UDP is unneccesary) with this configuration:
Now, ssh into your virtual machine and run these 3 commands to open them on the firewall on the machine:
sudo firewall-cmd --permanent --zone=public --add-port=25565/tcp
sudo firewall-cmd --reload
If you're not sure how to ssh into your machine, try ssh [email protected]
We are going to install Java through dnf, if you plan on running a server before 1.16 (especially forge) you will need to use java 8. Any other server software will work with java 17 all the way back to 1.7.2
sudo dnf install java-17-openjdk
If you wish to install java 11 or 8 instead, that is doable by replacing the 17
with those 2 numbers. Other versions are not available through the official repository (the source from which dnf uses to install software).
Next up, we create a directory and download fabric.
mkdir minecraft
cd minecraft
curl https://maven.fabricmc.net/net/fabricmc/fabric-installer/0.11.0/fabric-installer-0.11.0.jar -o fabric-installer.jar
If you wish to create a minecraft server on the latest version of Minecraft, simply run this command below
java -jar fabric-installer.jar server -downloadMinecraft
However, if you wish to specify your minecraft version you need to pass the -mcversion
flag and specify the version after it, i.e for 1.16.5 you would add -mcversion 1.16.5
. Please do note that different versions need different java (1.17 needs java 16 and anove, whereas 1.18 needs java 17 and above. Most cases you can use java 17 for older versions too, but it doesn't go as well for older versions like 1.7) to the end of the command above. To get all availabe flags you can set, run java -jar fabric-installer.jar help
For running the minecraft server, we will use a systemd service. Which allows it to run in the background of the server and not depend on your session (the thing you're connecting to, as running it normally would be connected to it) to be active.
Controlling the server after this will be quite simple:
sudo systemctl <start/stop/restart> minecraft # Replace the brackets with either of the commands, does as described
sudo journalctl -fu minecraft # This will get the latest logs, run with -u instead of -fu to get the full logs
First of all, we need to accept the eula, this can be done easily with the command below, however, I recommend making yourself familiar with the EULA before agreeing to it.
echo "eula=true" > eula.txt
If you wish to skip the explanation for how to setup the systemd service file, simply run the following commands
sudo curl https://gist.githubusercontent.com/AI-nsley69/ba4050b9bc3584b59d0424f25fda99a2/raw/e2d151f355dbd6488ae80a04a548dc233753343a/minecraft.service -Lo /etc/systemd/system/minecraft.service
sudo curl https://gist.githubusercontent.com/AI-nsley69/ba4050b9bc3584b59d0424f25fda99a2/raw/e2d151f355dbd6488ae80a04a548dc233753343a/minecraft.socket -Lo /etc/systemd/system/minecraft.socket
sudo systemctl enable --now minecraft
TODO: Write an explanation of the systemd service file and how to configure it
And you're done! Now you should be able to connect to your Minecraft server by entering the ip. If you have any questions or issues, feel free to ask in my discord server.
Images from Oracle Cloud guide.
none of the pictures load