[Oracle VPS] Create your own Minecraft Server always free
Table of Contents
VPS Oracle - This article is part of a series.
Introduction #
This article guides you through the creation of a free Minecraft game server for life using Oracle Cloud Infrastructure’s (OCI) “Always Free” offering.
OCI isn’t the only possible solution for creating your own Minecraft server, however I think it’s the best solution on the market available today, and here’s why:
Other solutions #
To create your own Minecraft server, there are generally 3 solutions:
- Host your server on your own machine.
- Use a free specialized host such as Aternos
- Use a paying generalist host such as OVH
Using your own machine is free (if you don’t count the electricity consumed) and gives you total control over your server, but it does require a machine with good performance and a fast Internet connection, otherwise the server won’t be of good quality.
In addition, you’ll need to open certain ports on your Internet router (your wifi box) to allow your friends to connect to your server. This may be difficult to achieve, depending on your Internet Service Provider (ISP), and may carry security risks for anyone using the router. Finally, the server will only be accessible when your machine is switched on (if you switch off your computer, the server will be closed).
This is a solution I don’t recommend, but it’s possible.
Using a specialized hosting provider like Aternos is free, simple and fast. In fact, once you’ve created your account, we can quickly generate a Minecraft server that can be accessed and played right away.
However, this server can only accommodate 10 people maximum and can only be in Vanilla (no plugins, mods or custom maps). If you want to unlock these features, you’ll have to pay. What’s more, you have no control over the server, which means that Aternos can remove it at any time. This happens regularly because they don’t have unlimited servers, so in order to offer their service to enough people they have to sort.
Generally speaking, if your server is inactive for more than a week or two, it will be deleted and given to another user. And yes, using cloud services is really using someone else’s computer, so if this service is free don’t forget that the real owner of the machine can do whatever he wants.
So this is a solution I’d only recommend if you want a small Vanilla server quickly and don’t intend to play on it much.
Using a general-purpose, pay-as-you-go host like OVH solves the problem of control: you pay a certain amount per month for a VPS. As a reminder, VPS stands for “Virtual Private Server”, and as indicated in the name, this server is private. Your host provides it to you and won’t touch it as long as you pay although this doesn’t rule out potential physical problems such as a fire on the premises. As you have total control over this server, there’s nothing to stop you using it as a game server, but also as a small personal cloud or VPN server…
In my opinion, this is the best solution, but unfortunately it comes at a price. The more powerful your VPS, the more it will cost. Here’s an overview of OVH prices:
OCI is also a general-purpose hosting provider, but thanks to its “Always Free” offer, we get a free solution that solves the main problems of other solutions, making it in my opinion **the best offer on the market today!
We can now create our Minecraft server
Minecraft Vanilla server #
→ Read the introduction of this serie
Once you’ve followed the introduction, you should have an Oracle account and a VM (instance) dedicated to your Minecraft server. You can now follow the steps described below:
Install java #
Every Minecraft server needs java
to run, so we’re going to install the Java Development Kit (JDK) on our server. To find the latest version available, here’s the command to run:
yum list jdk*
Don’t be surprised, I use the Hyper terminal, the appearance is slightly different but the commands don’t change.
We’re going to install the latest “headless” version, this version may be different for you, take the latest version available, here’s the command to run at home:
sudo yum install jdk-22-headless.aarch64
To check that java is installed :
java --version
Installing the Minecraft server #
At last we come to the exciting part! To install the Minecraft server you first need to get the .jar
file from the official site.
Once you’ve retrieved the .jar file from your local machine, create a folder on your VM for your Minecraft Vanilla server and transfer the .jar to this folder:
From your SSH access, go to this folder and execute this command:
java -Xms1G -Xmx2G -jar server.jar nogui
Xms
allows you to specify the minimum RAM to be allocated to your serverXmx
allows you to specify the maximum RAM your server can use
Always check that the minimum RAM allocated is sufficient for your server and that the maximum RAM is not equal to or greater than the RAM available to your VM.
In fact, if your VM has 2GB of RAM and you allocate 2GB to your Minecraft server, your VM is likely to crash. You should always keep at least 1 or 2GB that your VM can use for other resources.
Numerous lines will appear, including this one:
This message indicates that you need to accept the EULA (end-user license agreement) in order to launch the Minecraft server.
If you list the current directory, you’ll see that the server has created all the files and folders it needs, including the eula.txt
file.
Edit this file with the command :
nano eula.txt
Change the value “false” to “true” :
CTRL
+ X
then Y
then the Enter
key. If you don’t want to save your changes, press the N
key instead of the Y
key.You can now restart your server with the same command:
java -Xms1G -Xmx2G -jar server.jar nogui
Your server is now generating the various worlds, until you get the message “Done”.
CTRL
+ C
combination or write stop
.You’d think our server would be up and running by now, but unfortunately not yet 😭 (cheer up, it’s almost over).
You won’t be able to connect to your Minecraft server from the game right now, simply because we haven’t opened the port for the Minecraft game!
Firewall configuration #
In reality, all the VMs we create are behind a firewall. The principle of the firewall is to authorize or block communications between our VMs and the outside world.
To communicate with the outside world, our VMs can use a lot of protocols, each of which has a default port:
- port 80 and 443 are used by the
HTTP
andHTTPS
protocols for a website - Port 25 is used by the
SMTP
protocol for e-mail transfer.
On an Oracle server, all ports are blocked by default except port 22 for the SSH
protocol, which allows us to administer the machine.
We therefore need to open the port used by the Minecraft server, port 25565:
To do this, go to your server’s instance page and click on “subnet”:
Then in the “Security List” of this subnet:
As you can see in the “Egress Rules” list, all ports are blocked by default:
Only port 22 is authorized in the “Ingress Rules”:
We’re going to add port 25565, to do this press “Add Ingress Rules” then add a rule to authorize anyone (0.0.0.0/0) to access port 25565 via TCP and UDP:.
For the server to take these changes into account, you need to run these commands:
sudo firewall-cmd --permanent --zone=public --add-port=25565/tcp
sudo firewall-cmd --permanent --zone=public --add-port=25565/udp
sudo firewall-cmd --reload
And get the message “success” :
Launching the server #
Your Minecraft Vanilla server is finally ready!
You can try to connect to your server from the Launcher:
And that’s it! Now all you have to do is share your server information with your friends so you can play together:
Minecraft server with plugins - PaperMC #
Creating a Minecraft Vanilla server is cool, but creating a server with plugins is even better! Minecraft plugins can greatly enhance the game experience without changing Minecraft’s source code (unlike mods). The advantage is that you can add as many plugins as you like to your server (as long as it’s powerful enough), and players don’t have to do a thing.
Let’s create our Minecraft server with plugins!
Installing plugins #
To get started, you’ll need to download the .jar file for a server capable of running plugins. There are several possibilities, but for my part I’ll choose PaperMC (because it’s the most widely used):
Once you have retrieved the .jar file, create a folder specifically for this server and transfer the .jar to it:
It works in exactly the same way as a Vanilla server: go to this folder from your SSH access, then launch the server and allocate the necessary RAM:
java -Xms1G -Xmx3G -jar server-paper.jar nogui
The server will create the folders and files it needs to function properly, and then you’ll need to accept EULAs as described above for the Vanilla server:
If you restart your server, it will be operational, but for the moment we haven’t installed any plugins.
For the example I’m going to install 3 popular plugins:
- WorldEdit → advanced build and destroy functionalities
- EssentialX → lots of features needed by other plugins
- BlueMap → world generation in a web interface
For each plugin you want to install, you need to make sure it’s compatible with your server.
Each plugin corresponds to a .jar file, once the files are downloaded I transfer them to my server in the “plugins” folder (Paper has automatically created this folder, you may have to create it yourself if you use another server such as Spigot) :
To install the plugins, simply restart your server!
Plugin configuration #
Some plugins will require you to configure them, so it’s up to you to read the documentation for each plugin to understand whether there are things you need to modify or not. In our case, we only need to configure BlueMap.
Go to plugins > BlueMap > core.conf, then agree to use BlueMap by changing “false” to “true”:
BlueMap uses the default port 8100 for the web application, as you can see in the webserver.conf
file:
You can change this port if you wish, but in any case you’ll need to authorize it on the firewall for the plugin to work.
Once the port has been added to the firewall, don’t forget to reload the firewall configuration on your VM:
sudo firewall-cmd --permanent --zone=public --add-port=8100/tcp
sudo firewall-cmd --permanent --zone=public --add-port=8100/udp
sudo firewall-cmd --reload
You should get the message “Success”:
When you launch your server, it tells you that the BlueMap plugin is operational:
You can go to the url http://[IP_of_your_VM]:8100
and see that your world has been taken into account by BlueMap :
Now you know how to create a Minecraft server and install plugins!
Modded Minecraft Server - Forge #
Now we’ll take a look at how to set up a Minecraft server with mods.
The difference between a modded server and a server with plugins is that mods change the game’s source code, so two people can’t play with different source code because it’s not the same game!
This means that if you decide to create a Minecraft server with mods X and Y, all the people who want to play on your server must also have mods X and Y installed on their machine in the same version!
[Client side] - Prerequisites #
To install a mod on your local machine, you’ll need to download the CurseForge application. This allows you to install mods on a wide range of games. Go to the download page and install the “Overwolf” version :
Follow the installation process (it’s very simple), and once the application is installed, choose Minecraft :
[Client side] - Installing mods #
For this example, we’re going to install the “ Pixelmon” mod, which lets you play Pokémon on Minecraft!
Click on “Browse” and on the mod you want to install:
The latest version of Minecraft available for this mod is 1.20.2, however this version is in “Beta” which means that the mod includes new features but is not necessarily stable.
You can find all available versions in the “Versions” tab:
If you click on the “Install” button (1), CurseForge will install the latest stable (release) version of the mod, here the version in 1.16.5, but you can choose to install the beta version by clicking on the button on the right (2) if you wish:
What’s important to remember here is that the “server” version is only available as a stable release, so we’re going to download the 1.16.5 version:
Once the mod is installed, you can find it on your “My Modpacks” tab:
If you press “Play”, CurseForge will automatically launch your Minecraft Launcher and load the mod:
Now that your mod has been installed on the client side, we’re going to install it on our VM. Please note that anyone wishing to play on your server must first install the mod on their own machine.
[Server Side] - Installing mods #
A modded server is a Forge
server, so the installation process differs slightly from that of a server with plugins. To begin, retrieve the mod from CurseForge, using the “Download Server Pack” button:
Create a folder for your Forge server on your VM and upload the modpack .zip file:
Unzip the contents of this file with the command :
unzip [filename]
You can delete the .zip file.
Numerous files and folders have been created, including .sh, these files are scripts, but for the moment these scripts are not executable. To give them this right, we need to write the command :
chmod u+x *.sh
Run the “Install.sh” file, which will install the Forge server and all the .jar files corresponding to the mods in the modpack:
./Install.sh
You can now start your modde server with the command:
./ServerStart.sh
And then the worst happens: the server doesn’t launch and a big error appears on the screen!
But don’t panic, it’s perfectly normal. This mod is quite old, in fact we’ve installed a version of java that’s too recent for it, I deliberately used this modpack to show you this scenario, as it happens regularly.
If we consult the Pixelmon mod documentation, we can see that we need Java 8 (for the stable version) and not a higher version:
We will therefore install Java 8 (corresponding to jdk11) with the command :
sudo yum install jdk-11-headless.aarch64
We now have 2 versions of Java available on our VM. To use the correct one, simply run the following command, then choose the number corresponding to the version we want to use:
sudo update-alternatives --config java
To check that we have changed version, let’s run the command :
java --version
Now we can restart the server with ./ServerStart.sh
, then accept the EULA :
And our modded server is ready! We can now play on it with the Pixelmon modpack installed:
Now you know how to create your own modded Minecraft server!
Improvements #
We’ve covered in detail how to create a Minecraft Vanilla, Paper and Forge server, as well as the configuration of multiple plugins and mods. However, it would be a shame to stop there, as we’re not yet exploiting all our VM’s potential.
Let me show you some of the improvements that change everything!
One VM, multiple servers #
You may have noticed up to now that we’ve only been running one Minecraft server at a time, but in reality it’s possible to run several on the same VM!
If you open several SSH terminals accessing your VM and try to launch the Vanilla and Paper servers at the same time, you’ll get an error message informing you that port 25565 is already in use.
This is normal, as both servers have the same default port configuration, but it’s possible to change this!
If you open the configuration of one of the two servers in the server.properties
file, you’ll see 2 parameters with the number 25565:
query.port
which corresponds to the server’s UDP portserver.port
which corresponds to the server’s TCP port
If you change these parameters to the number 25564 for example, open this port on the Oracle firewall and don’t forget to load the firewall configuration into the VM as described in the previous points, you can now launch your Vanilla server and your Paper server at the same time!
Always keep 1 or 2 GB of RAM strictly allocated to your VM and nothing else.
Here, our VM has 10GB and the maximum allocated RAM for both servers is : 2+3=5 GB, so no worries.
The more servers you have at the same time, the more computing power you’ll need, so don’t forget OCPUs too.
Open your server to cracked versions #
Maybe some of your friends haven’t bought the game but would still like to have some fun with you: it’s totally possible to open your server to cracked versions!
To do so, go to the server.properties
file and change the online-mode
parameter to false :
Managing your world - saving and resetting #
After hours of playing on your server, constructing numerous buildings and mining endless resources, your world crashes for no reason and you have to start all over again!
To avoid this situation, it’s a good idea to make regular backups of your world. It’s so simple!
Simply download the folders corresponding to the worlds on your server from your FTP client. There are 3 basic folders:
overworld
, corresponding to the normal worldworld_nether
, which corresponds to the nether worldworld_the_end
corresponds to the end
Once you’ve retrieved these folders, store them in a safe place, and simply put them back on your server to retrieve your current progress.
This can be very useful if you want to “go back in time”, or if you change server.
Alternatively, you can stop your server and delete these folders. When you restart your server, it will automatically regenerate a new, blank world.
Importing a world #
With what we’ve just seen in the previous section, you can imagine that it’s possible to import a world created by anyone!
You can find maps on this site, we’ll use the Far Far Away kingdom from the Shrek universe as an example:
Download the map (which is a simple compressed file), then upload it to your server:
In the server.properties
file, change the level-name
parameter to the name of the map folder:
Restart your server, and you’re ready to play on the map you’ve imported!
24/7 Open Server - Service creation #
Of all the possible improvements, this is certainly the best.
In fact, if you’re observant, you’ll have noticed that from the start, my server has been linked to the terminal of my SSH connection. If I close my SSH connection or this terminal, I stop all processes linked to it, so I stop my Minecraft server. If I want my server to be open 24/7, my SSH access would also have to be open 24/7, and so would my own machine, which is very annoying!
I’m going to show you how to open your server 24/7 without having to keep your own computer on.
To do this, we’ll need a service.
Services are used for a variety of essential tasks that need to run continuously or at regular intervals, for example:
- Network management: Services that manage network connections.
- Web servers: Services that provide web content (such as Apache or Nginx).
- Databases: Services that manage databases (such as MySQL or PostgreSQL).
- Security: Monitoring and protection services (such as firewalls or antivirus).
- Task scheduling: Services that execute scheduled tasks at specific times or continuously.
It’s this last type of service that we’re interested in.
On Windows, you can view all the services running on your local machine from the services.msc console:
On Linux, the most common service management system is systemd, and the tool for interacting with it is systemctl
.
To list all services (active, inactive, …) you can use the command :
systemctl list-units --type=service --all
For this example, I’m going to create a service that will run the Forge server continuously.
First, create the service with the command :
sudo nano /etc/systemd/system/[service_name].service
Here, I’ll name my service : server-forge.service
Then we need to write the service configuration. Here’s what ours looks like:
[Unit]
Description=Forge Server Service
After=network.target
[Service]
WorkingDirectory=/home/opc/server-forge
ExecStart=/bin/bash ServerStart.sh
Restart=on-failure
RestartSec=60
[Install]
WantedBy=multi-user.target
The [Unit] section contains general information about the service.
Description=Forge Server Service
: Provides a description of the service.After=network.target
: Indicates that our service should start after the network.target service, it means after the network is available.
The [Service] section defines how the service is to operate.
WorkingDirectory=/home/opc/test-forge
: Specifies the working directory for the service. Commands will be executed from this directory.ExecStart=/bin/bash ServerStart.sh
: Defines the command our service will execute. Here, our service executes the bash script ServerStart.sh to start the Forge server.Restart=on-failure
: Indicates that the service is to be restarted automatically if an error occurs.RestartSec=60
: Defines the delay in seconds before attempting to restart the service after a failure. Here, we wait 60 seconds before restarting.
The [Install] section defines when and how the service should be installed or activated.
WantedBy=multi-user.target
: Indicates that this service should be started when the system reaches the multi-user.target operating level, which is a typical operating state for non-graphical (multi-user) systems.
Once the configuration has been written, save it and close the file editor.
We need to make our system take our new service configuration into account with the command:
sudo systemctl daemon-reload
To inform the system that this service must be started each time your VM is restarted, run the command :
sudo systemctl enable server-forge
Finally, to start your service, run the command :
sudo systemctl start server-forge
You can view the status of your service with the command
sudo systemctl status server-forge
As you can see, our service is fully functional:
You can stop your service (and therefore your Minecraft server) with the command :
sudo systemctl stop server-forge
Your Minecraft server is now run by a service set up to never stop and restart automatically in the event of problems.
So it’s accessible 24/7, without you having to keep your SSH access open!
Conclusion #
In this article I show you how to create your own free Minecraft game server for life!
The aim was to share useful knowledge while introducing you to the world of IT.
As I myself fell into the world of computing thanks to video games and in particular Minecraft, it seemed logical to start this series of articles with a complete tutorial on this iconic game.
I hope you’ve enjoyed reading the article, if you have, please feel free to like it and share it with your friends.
Keep an eye on this blog, as I’ll be publishing many more articles in this style in the near future!