How to Set Up and Run a Minecraft Server with Forge and Mods on OCI Free Tier
How to Set Up and Run a Minecraft Server with Forge and Mods on OCI Free Tier
Oracle Cloud Infrastructure (OCI) offers a generous always-free tier, making it a fantastic option to host a modded Minecraft server. This guide will walk you step-by-step through setting up a Minecraft server with Forge and mods, even if you’re a complete beginner.
Step 1: Sign Up for Oracle Cloud Free Tier
- Visit Oracle Cloud’s Free Tier page.
- Click on "Start for Free" and create an account. You’ll need to provide a valid email, phone number, and credit card for verification (no charges will be made).
- Once your account is set up, log in to the Oracle Cloud Console.
Step 2: Create a Virtual Machine Instance
- In the Oracle Cloud Console, go to Compute > Instances.
- Click on "Create Instance".
- Fill in the details:
- Name: Enter "MinecraftServer".
- Image and Shape:
- Click "Edit" next to "Image and Shape".
- Image: Select Ubuntu 22.04.
- Shape: Choose the Ampere A1 instance with 4 OCPUs and 24 GB of RAM.
- Networking:
- Select the default Virtual Cloud Network (VCN) and subnet automatically created by Oracle.
- Add SSH Key: Paste the public SSH key from your local machine. If you don’t have an SSH key:
- Run
ssh-keygen
on your computer to generate a key pair. - Use the public key located at
~/.ssh/id_rsa.pub
.
- Run
- Click "Create" to launch your instance.
Step 3: Connect to Your Instance
- Open a terminal on your computer.
- Connect to the instance using SSH:
Replacessh -i ~/.ssh/id_rsa ubuntu@<instance-public-ip>
<instance-public-ip>
with the public IP address of your instance (found in the OCI Console under your instance details).
Step 4: Install Java and Required Tools
- Update the package list:
sudo apt update && sudo apt upgrade -y
- Install Java:
sudo apt install openjdk-17-jre -y
- Install other tools:
sudo apt install unzip wget -y
Step 5: Download and Set Up Minecraft Server
- Create a directory for the Minecraft server:
mkdir ~/minecraft && cd ~/minecraft
- Download the latest Minecraft Forge installer for the server from Forge’s official website.
- Copy the direct download link for the installer version.
- Use
wget
to download:
Replacewget <forge-installer-url>
<forge-installer-url>
with the copied link.
- Run the Forge installer:
java -jar forge-*.jar --installServer
- Accept the EULA:
echo "eula=true" > eula.txt
Step 6: Set Up Mods
- Download your desired mods from a trusted source like CurseForge.
- Upload the mod files to your server using SCP:
Replacescp -i ~/.ssh/id_rsa <mod-file>.jar ubuntu@<instance-public-ip>:~/minecraft/mods
<mod-file>.jar
with the name of your mod file. - Ensure all mods are compatible with the Forge version you installed.
Step 7: Open the Required Port
- In the Oracle Cloud Console, go to Networking > Virtual Cloud Networks.
- Click on your default VCN.
- Select the Subnet used by your instance.
- Under Security Lists, click on the default security list.
- Add a new ingress rule:
- Source CIDR:
0.0.0.0/0
(to allow connections from anywhere). - IP Protocol: TCP.
- Source Port Range: Leave blank.
- Destination Port Range:
25565
(Minecraft’s default port).
- Source CIDR:
- Save the rule.
Step 8: Start the Server
- Navigate back to the Minecraft server directory:
cd ~/minecraft
- Start the server:
java -Xmx8G -Xms8G -jar forge-*.jar nogui
- Replace
8G
with the amount of RAM you want to allocate (adjust based on your mods and server needs).
- Replace
- Keep the terminal session open to keep the server running, or use a tool like
tmux
to run it in the background:sudo apt install tmux -y tmux java -Xmx8G -Xms8G -jar forge-*.jar nogui
- Detach from
tmux
by pressingCtrl+B
and thenD
.
- Detach from
Step 9: Connect to Your Server
- Open Minecraft on your computer and select the same version as your Forge server.
- Go to Multiplayer and click Add Server.
- Enter your server’s public IP address and click Done.
- Join the server to start playing.
Comments
Post a Comment