Free Minecraft Server on Oracle Cloud Free Tier
The commands listed below were used in the video above:
Add the line below to “/etc/iptables/rules.v4”
-A INPUT -p tcp -m state --state NEW -m tcp --dport 25565 -j ACCEPT
Reload iptables config
iptables-restore < /etc/iptables/rules.v4
Install Java Runtime 17
add-apt-repository ppa:openjdk-r/ppa
apt update
apt install openjdk-17-jre-headless
Create installation/home directory for Minecraft Server
mkdir /opt/minecraft && cd /opt/minecraft
Download Minecraft Server (v1.19 at time of the recording replace version with latest)
wget https://launcher.mojang.com/v1/objects/e00c4052dac1d59a1188b2aa9d5a87113aaf1122/server.jar
mv server.jar minecraft_server.1.19.jar
To avoid server shutdown when ssh connection to the server is closed start screen session named “Minecraft”
screen -S "Minecraft"
Start Minecraft Server (Will fail, need to accept EULA)
java -Xmx8G -Xms2G -jar minecraft_server.1.19.jar nogui
To accept EULA go to “/opt/minecraft/eula.txt” set eula=true
Start Minecraft Server.
java -Xmx8G -Xms2G -jar minecraft_server.1.19.jar nogui
Detach from screen session Minecraft Ctrl + A + D
To list open screen sessions run
screen -list
To attach to screen session run. Replace SessionID with your session id
screen -r SessionID