How to create free Minecraft server hosted in the cloud and setting up a panel for it
This guide covers setting up a free Minecraft server and then using Pterodactyl to create a panel for it. Everything will be hosted in the cloud for free by using Oracle Cloud. All the steps in this guide can be followed for free but be sure to check the Prerequisites.
I will use the Curseforge modpack Craft to Exile 2 as an example in this guide, you can also follow along with any other type of server (such as Vanilla).
If you are using Linux or Mac you can probably skip this because this is already integrated with your PC. Windows users should install the following programs.
In this section, we set up the Minecraft server using Oracle Cloud. If you prefer watching a video instead of reading, I'd suggest this video which covers everything in this section.
[!Note] Oracle Cloud does not always load properly on Google Chrome, so I suggest using a different browser like Microsoft Edge or Firefox.
Netherlands Northwest (Amsterdam)
After signing up head to the Oracle Cloud dashboard and scroll down to Create a VM instance
.
Minecraft VM
.Ubuntu
, you want to use the latest Ubuntu version that is not Minimal. At the time of writing that is Canonical Ubuntu 22.04
Shape series
to Ampere
, this will give you one option for Shape name
which should be VM.Standard.A1.Flex
. Then for the number of OCPUs
set it to 4 and the Amount of memory (GB)
should be set to 24.Save private key
, this is necessary for later steps where we access the files of the server.Create
at the bottom left of the page.If you get an error that the VM is not available, then change your settings to Pay As You Go
. You can do this in the Billing settings, under the tab Upgrade and Manage Payment
. Just like registering this change will reserve about 100 dollars on your credit card and instantly give it back after confirming the credit card.
After creating the VM you will see the overview of the instance. On the tab Instance information
you will see the Subnet under Primary VNIC
, click on it.
This will bring you to the overview of the subnet information, here you want to click on the only option under Security Lists
.
Click on Add Ingress Rules
and fill in the following:
0.0.0.0/0
TCP
+ Another Ingress Rule
and fill in the following for that:0.0.0.0/0
UDP
Destination Port Range
with the port you want to forward.This can be done using PuTTY or using the command line if you have SSH set up.
If you are unsure if you have SSH set up on your PC, then open a terminal and write ssh
. If there is no error then you can use SSH and following the steps of Command line.
If you would like to use the command line method on Windows, then follow these steps.
Start by locating the private key file that you saved previously. Copy the location of this file for instance, C:\Users\Stephan\Downloads\oracle\private.key
. Next, find the IP address of your Oracle VM.
Use the following syntax to SSH into it:
ssh -i "{private key location}"ubuntu@{your VM ip address}
For example, I use the following command:
ssh -i "C:\Users\Stephan\Downloads\oracle\private.key"[email protected]
The second method of accessing the terminal of your VM is by using PuTTY.
PuTTYgen
in your Windows applications and open itLoad
and search for your private key and open it
All Files (*.*)
otherwise you won't be able to find your key.Save private key
ubuntu@{your ip address}
for the hostnameBrowse...
behind the text box for Private key file for authentication
Open
Open
and it will start the connectionPuTTY Security Alert
, press Accept
Now we need to update the software that the VM uses. Use the following commands.
sudo -s
apt update
apt upgrade
After the upgrade, you will see the following screen. You can press Tab
to select <Ok>
and then enter to exit it.
There might be multiple services that need to be restarted, just leave them on their default settings and select <Ok>
.
apt install firewalld
firewall-cmd --permanent --zone=public --add-port=25565/tcp
firewall-cmd --permanent --zone=public --add-port=25565/udp
firewall-cmd --reload
If you get the following screen after installing Firewalld then restart the VM. You can restart it by simply heading over to the overview of instances and clicking reboot.
If you get an error Error: DBUS_ERROR: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
then use the following commands.
sudo apt-get install dbus
sudo systemctl start dbus
sudo systemctl enable dbus
sudo systemctl status dbus
sudo systemctl restart firewalld
sudo firewall-cmd --state
Then try the same commands for Firewalld again.
The following commands are handy to know if you plan on not using the Pterodactyl panel or any other panel. These commands are for Screen, which you can use to run something in the background such as your server. If you are following this guide and plan to use the panel then you can skip this section.
To list all attached and detached screen
screen -ls
To stop a screen session
screen -XS <session-id> quit
To run the server in a screen session (be sure to be in the same directory as the run.sh
file)
screen ./run.sh
To exit a screen session: CTRL A + D
To reattach to a session
screen -r <session-id>
If you do not plan to use the Pterodactyl panel, then follow this section. Otherwise, you can skip it since it will be covered in the following section.
sudo chown -R ubuntu:ubuntu .
This section covers the process of how to set up the Pterodactyl panel, which is very useful for managing your server. If you prefer watching a video over reading, then I suggest watching this video which covers almost everything in this section.
Create a VM instance
.panel
or any other name that reminds you that this is not the Minecraft server VMUbuntu 22.04
, just like previouslySpecialty and previous generation
VM.Standard.E2.1.Micro
(or any other with Always Free-eligible
)Select shape
Head to the website where you bought your domain.
minecraft
and panel
. We will be using this to be able to connect with the Pterodactyl panel.This is an example of someone that uses the host name connect
for their Minecraft server and control
for their Pterodactyl panel.
apt install firewalld
firewall-cmd --permanent --zone=public --add-port=25565/tcp
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --permanent --zone=public --add-port=443/tcp
firewall-cmd --permanent --zone=public --add-port=2022/tcp
firewall-cmd --permanent --zone=public --add-port=22/tcp
firewall-cmd --permanent --zone=public --add-port=5657/tcp
firewall-cmd --permanent --zone=public --add-port=56423/tcp
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload
Paste the following command in the terminal of the panel VM
bash <(curl -s https://raw.githubusercontent.com/pterodactyl-installer/pterodactyl-installer/master/install.sh)
This will do a Q&A session with you where you need to fill in the following answers.
[0] Install the panel
admin
{panel host name}.{domain}.{suffix}
panel.akkerman.ai
is what I useN
y
y
y
Paste the following command in the terminal of the Minecraft VM (this is the same command we used for the panel)
bash <(curl -s https://raw.githubusercontent.com/pterodactyl-installer/pterodactyl-installer/master/install.sh)
[1] Install Wings
N
y
y
{panel host name}.{your domain}.{suffix}
panel.akkerman.ai
is what I usey
{minecraft server host name}.{domain}.{suffix}
y
y
Now you can access your Pterodactyl website. Head to {panel host name}.{domain}.{suffix}
and sign in.
Before creating the node we need to create a location.
node
, and save itNow that we got the location we can create a new node.
Main
{minecraft server host name}.{domain}.{suffix}
Behind Proxy
Create Node
Allocation
hostname -I | awk '{print $1}'
Assign New Allocations
25565
for PortsUse this image as an example.
To start wings on the Minecraft VM we need a token.
Generate Token
.sudo wings
CTRL+C
in the console to exit wingssystemctl start wings
Minecraft
Forge Minecraft
in the options for Nest EggsJava Eclipse Temurin [AMD64/ARM64]
ghcr.io/software-noob/pterodactyl-images:java_17
Create New
22000
but you can go for a lower number if you are using a vanilla server43000
Forge Minecraft
Forge Version
under Service Variables. You can find this in the Curseforge app by clicking on the modpack you want to have as a server.1.20.1-47.2.18
During the starting of your server, you can run into this error.
Error Event [a42aeaba-5a57-4b31-b888-f76257c1ab0f]: environment/docker: failed to start container: Error response from daemon: driver failed programming external connectivity on endpoint 1ba18bdc-05e9-4b6a-be5e-9a2df92f965e (7ed1002d6be9d188a6400cf5b06d94ac04cd0940a9c3e60b991f639eb0e0c6f0): failed to bind port 10.0.0.236:25565/tcp: Error starting userland proxy: listen tcp4 10.0.0.236:25565: bind: address already in use
This means that a Minecraft server is currently running on your Minecraft VM, be sure to stop it.
Additional Files
click on it..bat
or .sh
file, depending on your OS. This will start the server locally and create some necessary files.[main/INFO] [minecraft/Main]: You need to agree to the EULA in order to run the server. Go to eula.txt for more info.
Files
tab and delete the following files from the containersftp://bad.47fd94fc@localhost:2022
and the password is the same as to access the panel. You can also press the Launch SFTP
button and it will open WinSCP or any other client that you have installed.Unarchive
. This will unpack the zip file.-XX:+AlwaysPreTouch
-Xms8G -Xmx8G
Startup
tab and paste the copied content in Startup Command
after -XX:MaxRAMPercentage=95.0
Save modifications
This is advised by the wiki of Craft to Exile 2.
Create schedule
.6 hourly restart
0
*/6
*
*
*
New Task
for the created schedule
Send command
/say The server will be restarted in 1 minute
Continue on failure
Send power action
Terminate the server
60
Continue on failure
Send power action
Start the server
70
Run Now
button on the Schedules overview.If you are afraid of spending money on the virtual machines hosted in Oracle Cloud then you can set a budget.
Budget Amount
to 1
Threshold Type
to Absolute Amount
Threshold Amount
to 1