
How Set Up a Free Vanilla Minecraft Server in 2024
You can get a powerful Minecraft server for absolutely free!
I'm talking serious server hardware with performance that rivals high end servers at hosting providers like Bisect,
By using Oracle Cloud's Free Tier service and your own elbow grease and self-service administration, you can operate your own top-performing server for absolutely free.
You can use this server to host a vanilla Minecraft server, or install any modpack server pack. In this tutorial, we'll set up a Vanilla Minecraft Server. I'll create tutorials for specific modpacks. Here's one for how to set up Prominence II RPG for Free on Oracle Free Tier.
Why does Oracle provide this service for free? They want people to experience and learn their services (which competes with other cloud hosting services like AWS and Microsoft Azure).
By the end of this tutorial, you can have your very own Minecraft server running on a powerful server of your very own!
Let's walk through it step by step...
I've gone through this step by step myself. But things change. If there's anything in this process that isn't correct, please comment and let me know!
1. Sign up for Oracle Cloud Free Tier
Sign up for Oracle Cloud's Free Tier here: https://www.oracle.com/cloud/free/
Click Start for Free and enter in your Account Information.
You'll get a verification email. I had to refresh the page to start over because it spun forever. Keep at it if it doesn't work the first time.
Click the Verify Email button.
Continue filling out the form. Pick a secure password and an account name.
Choose your home region close to where your users are. If they're all over the world, choose a location that's central to them. Honestly, I've played on Oracle servers all over the world and performance was always solid.
Finish filling out this page, including reading the Terms of Use and accepting them.
Next enter your address info
After you click continue, you'll need to add Payment/Identify Verification. This is where you may get stuck, like if you're a minor and don't have any valid payment methods, like a credit card. This will not charge anything to your card. In fact, they don't even save this card in your account for billing. The purpose of this is to keep people from signing up over and over again. If you try to get a second account with this card, or even one that matches the address, it will stop you.
Don't ask how I know this.
After that, you just need to accept the agreement
At the bottom of this form is the Oracle Cloud Services agreement. I've read through it, and here's the summary. Again, I'm not a lawyer...
Running a free Minecraft server on Oracle's free cloud service is feasible without incurring charges, provided you adhere to the constraints of their Always Free tier.
Free Tier Details
Oracle Cloud Free Tier offers a range of Always Free services that are available indefinitely. These include:
- Compute Instances: Up to 2 AMD-based VMs with 1/8 OCPU and 1 GB of memory each, or Arm-based instances with up to 4 OCPUs and 24 GB of memory.
- Storage: 200 GB of Block Volume storage and 10 GB each of Object Storage (Standard and Infrequent Access) and Archive Storage.
- Networking and Other Services: Includes a flexible load balancer, site-to-site VPN, and up to 10 TB of outbound data transfer per month.
These resources are sufficient for running all but the most taxing Minecraft servers, especially on the Arm-based instances which offer more resources. You want to ensure that the server configuration remains within the provided limits to avoid service disruption or charges.
Billing and Charges
- Always Free Services: As long as you stay within the limits of the Always Free services, you will not incur any charges. This includes not exceeding the allocated compute instances, storage, and data transfer limits.
- Free Trial Credits: Oracle provides $300 of cloud credits for 30 days when you first sign up, which can be used to explore additional services. After the trial period, any resources beyond the Always Free tier will be deactivated unless you upgrade to a paid account.
After you click start my free trial, you'll just need to wait a few minutes for the provisioning.
When it's finished, we'll end up on the login page.
This part gets a bit messy. The cloud account is, I think, your username you chose. The cloud account is sort of like the umbrella account in which there can be more than one user. I had to use my username I selected on this screen after this, the login screen users your email and password. Check your email for hints on what these account names are if you don't remember.
I set up Multi-factor-authentication, I think you don't have a choice about this. Note that you can check a box to use a different authenticator than Oracle's app. I use Google Authenticator, and was able to add my account there.
The first time in, there's an option to Customize the Console. I'm going to skip that. If you choose any options here, your console may look a little different than mine. But all the features should be there somewhere.
You can skip the tour if you want. That's what I'm here for!
2. Set up our server!
First, let's set up a VM Instance. Note that it is marked with "Always Free Eligible"
Give your Compute Instance a name and choose the compartment.
You can call it anything you want. Descriptive is, of course, better! You can use the root compartment, or create a child compartment. I made a child compartment called jangro.com, but you can just use the root. This is for organizing resources and controlling access. If you do choose a child compartment, it does get just a little more complicated later when you're setting up the network and firewall.
You can leave the Placement alone. Any of them are fine for this server. As you can see, you can create Ampere A1 instances in any availability domain.
Skip past Security to the Image and Shape section.
Click Edit and you'll see something like this. Keep Oracle Linux 8 as the image, though if you prefer a different Linux distro, you can change to Ubuntu, CentOS, etc.
Change the Shape
Select:
- Virtual machine,
- Ampere,
- VM.Standard.A1.Flex,
For the configuration, you have some choices here. The Always Free-eligible service allows for up to 4 OCPUs and 24GB of RAM. I'm only using this for my one server, and I'm planning on adding a bunch of mods, so I'm going to max it out.
Depending on how you're going to set up your server, you may be able to get by with only 2 OCPUs and 12GB RAM, which would allow you to run two servers! We run heavily modded servers over here, so we're just going to max it out right away. You can always delete your instances and start again. Some instances cannot be resized.
When I click save, here's what my Shape looks like. Just make sure it says "Always Free Eligible"
Next we must set up the networking to set up a public subnet so you and your friends can reach the server from the Internet.
On the primary VNIC information panel, click the Edit button on the top right:
All of my settings were correct already. Just make sure that Create new virtual cloud network, Create new public subnet, Automatically assign private IPV4 and public IP address are selected. Note: if you're going through this a second time, like if there's an error later, you may already have a subnet set up. If so, just select that.
To connect to and manage our server, we'll need to create (or assign) SSH keys.
You may have already done this for another purpose, in which case you can just upload your keys, but I'll assume you haven't done this before.
Make sure Generate a key pair for me is selected, and then "Save private key" and "Save public key". Depending on your operating system and SSH software, we'll need to put these key files in special places. Make sure you have a file that ends in .key
and .key.pub
We'll do something with them in a later step.
Leave the rest of the options as they are and click "Create"!
After you click Create, one of two things will happen. Either your instance will get created and you can proceed to connnecting.
Or, something that is very common is that you'll get an "Out of Capacity error":
Possible Errors/Issues with Oracle Cloud Free Tier
There are a few issues you may run into when setting up your Oracle Cloud Free Tier Instance.
Out of Capacity for Shape VM.Standard.A1.Flex in Availability Domain
Out of capacity for shape VM.Standard.A1.Flex in availability domain AD-1. Create the instance in a different availability domain or try again later. If you specified a fault domain, try creating the instance without specifying a fault domain. If that doesn’t work, please try again later. Learn more about host capacity.
If you get this error, go to the top and try a new Availability Domain in the Placement section (there are typically three). If after trying the others, there are no options available in the region you selected (this happened to me!) try waiting and try again later. When someone deletes an instance, that'll free up resources. Or Oracle may add more.
Remember we chose a home region when we created the account? That cannot be changed.
If you can't get past this step, there is a workaround.
If you upgrade your account to a Pay As You Go account, apparently you aren't subject to the restrictions of the free tier and can create instances in your region, even free ones. As long as you keep your server to the free eligible services, you still won't be charged anything!
Now you need to enter a credit card.
To do this navigate to the Billing section, and "Upgrade and Manage Payment". You'll need to add a Payment Method, then upgrade your account to Pay As You Go (PAYG). After you choose the options and click the "Upgrade your account" button, it will take some time for your account to be upgraded. I did this and it took mine about 4 hours. I've seen people wait for days.
Again, as long as you keep the services under the always free-eligible limits, you should not be charged. As a precaution, you can set up a budget of $1 to get warned of any spend. Under Cost Management > Budgets, you can set a monthly budget of $1, which will alert you of any forecasted spend that will exceed $1.
Why is there a Fee for Boot Volume Storage on Oracle Free Tier?
You may have noticed this message at the bottom right of the screen where there's an estimated total for the Boot volume. This is just an estimate, and not a charge. If you keep the boot volume within the 200GB limit (the default for an instance is 47GB), you shouldn't be charged.
Oracle customer support says this about it: "The cost shown in the attachment is from the cost estimator tool, and it is imperative that the API only checks what resources are selected and estimates the price based on those resources. It does not take into account the available free boot volume storage or scan the resources available in your tenancy. Therefore, an estimated price is displayed for the boot volume. However, the actual cost for the volume is $0.0/month if the storage is within the always-free limits."
After you create the server, you'll see that it is in a provisioning status.
After just a minute or two it will change to Running. Your public IP address is available in the interface information. This is what you'll use to connect to your server!
3. Accessing your new Server
Connect to your Server with SSH
Windows Powershell Instructions
- Open Command Prompt or PowerShell:
- Press
Win + R
, typecmd
orpowershell
, and press Enter.
- Press
- Connect Using SSH:
- Run the following command, replacing
<Public-IP>
with your instance's public IP address,<YourUsername>
with your Windows username, and oracle_key with the filename of your private key:ssh -i C:\Users\<YourUsername>\.ssh\oracle_key opc@<Public-IP>
- For example:
ssh -i C:\Users\JohnDoe\.ssh\oracle_key opc@192.0.2.1
- You will likely be prompted to continue connecting. Enter 'yes'
- Run the following command, replacing
I've got my IP address blocked out...
OSX/Linux Instructions
Step 1: Open Terminal:
- On macOS, you can find Terminal in Applications > Utilities > Terminal.
- On Linux, open your terminal emulator.
Step 2: Connect to Your Instance Using SSH
- Open Terminal:
- Ensure you are in the terminal where you have access to the private key.
- Connect Using SSH:
- Run the following command, replacing
<Public-IP>
with your instance's public IP address:ssh -i ~/.ssh/oracle_key opc@<Public-IP>
- For example:
ssh -i ~/.ssh/oracle_key opc@192.0.2.1
- Run the following command, replacing
Once you have logged into your server, you can start the admin functions.
Update the Server and Install Java
Step 1: Update the server with the command: sudo yum update
This may not be strictly necessary, but when I started to install Java, it felt like the yum command was doing this stuff anyway. So let's just get it out of the way. It can take a very long time to complete (like over an hour), including long stretches of time where it seems to do nothing. Be patient! It can be interesting to watch at least...
Step 2: Install Java with the following commands:yum list jdk*
This command will tell you the available Java versions, which change often. This process can also take a very long time.
You'll get a list back that looks something like this. You can install the most recent version, which in my case is version 22. Just install the headless version if you have a choice, which is all you need.
I'm installing java with this command:sudo yum install jdk-22-headless.x86_64
When that's finished, verify the installation by running:java --version
Upload and Run the Minecraft Server (the first time)
First you need to get the Minecraft Java (.jar) file for the version of Minecraft you want to run. You can always get the latest version from Minecraft here. Or check these pages for recent versions of Minecraft Server Files:
Copy the URL to the server file you want to install, and copy it to your clipboard. It'll look something like this, which is the 1.20.6 Server file:
https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar
In your SSH window, use the following command. I'm doing everything in the server root directory, but it is probably better to isolate it into a directory, like ~/minecraft-server
. But since we're literally doing nothing else with this server, I'll just keep it in my user root directory.
wget https://piston-data.mojang.com/v1/objects/145ff0858209bcfc164859ba735d4199aafa1eea/server.jar
That will save a file called server.jar to your current working directory. Then you can run it with a command like this:
java -Xmx1024M -Xms1024M -jar server.jar nogui
Side Note: What these -Xmx and =Xms parameters?
-Xmx1024M
:- Purpose: Sets the maximum heap size to 1024 megabytes (1 GB).
- When to Change: Increase this value if your application requires more memory. For a Minecraft server, increasing this value can help handle more players and more complex mods. Common values are 2G, 4G, or higher, depending on your server's resources and needs.
-Xms1024M
:- Purpose: Sets the initial heap size to 1024 megabytes (1 GB).
- When to Change: Adjust this to ensure that the server starts with enough memory allocated. Typically, you set this to the same value as
-Xmx
for consistent memory allocation, but it can be lower if you want the heap size to grow dynamically as needed.
- Server with More Players or Mods: If you are running a heavily modded Minecraft server or expect a large number of players, you might increase the memory allocation:
java -Xmx4096M -Xms4096M -jar server.jar nogui
- How much to allocate: Your server will likely have more memory than this available, since you can allocate up to 24GB on an free instance. As a rule of thumb, allocate about 50-75% of the total RAM to the Minecraft server, while leaving enough for the system and other applications. Though since these servers won't be doing much else, you can probably allocate the higher end of that.
It'll run for a long time while it installs all the files, but it will end like this...
It fails by design on the first run because the End User License Agreement needs to be accepted, which is created by the first run of the server.
You do that by editing the eula.txt file that got created by the server file, and changing false
to true
.
If you're familiar the nano
or vi
commands, you can edit it manually. But this command does it easily:sed -i 's/false/true/' eula.txt
Now you can run the server again for real. But before we do that, let's make sure all the firewall ports are open so we can connect to it from Minecraft.
Open the Server Firewall to the Minecraft ports
go back to the Oracle web interface and locate your instance. In the Instance information, locate the Subnet.
Click the subnet link and on the next page, locate the Security Lists
Click on the Default Security List.
Here we Add two Ingress Rules
Set them up like above both with Source CIDR 0.0.0.0/0 and the Port 25565. One will be TCP for the protocol and ther other UDP. The button on the bottom right will add the second rule form.
Click Add Ingress Rules and you should see the following:
On the server, you need to open the same ports in its firewall. Run these commands back in the SSH terminal:sudo firewall-cmd --permanent --zone=public --add-port=25565/tcp
sudo firewall-cmd --permanent --zone=public --add-port=25565/udp
sudo firewall-cmd --reload
These commands only need to be run once and they will stick even after restarting the server.
Start the Minecraft Server (For Real)
Once again, run the command/home/opc/minecraft java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
This time, your server will start up cleanly and create a world!
Connect to your Server!
In Minecraft go to Play Multiplayer and add a server with your new server IP.
Since we used the default port for Minecraft, you don't need to enter the port. After adding the IP to a server, you should see it available to join. Look at that Ping!
Click the play button and you and your friends are good to go!
This is a lot of work, right?
And that's not all. You should probably set up backups, a startup script, etc. to keep your server running. And then you'll need to update it when Minecraft updates, or if your mod pack you're playing on updates. See below for instructions on setting up example startup scripts and backups.
Or, if this is too much, consider getting a hosted minecraft server...
How to set up a Startup Script for your Oracle 8 Linux Minecraft Server
Up until here, we've got a running Minecraft server. But if it restarts, you need to start it up manually. Here's how to set up your Minecraft server to start up when your server boots up.
Step 1: Create a Start Script
First, create a script to start your Minecraft server. This ensures that all necessary commands are executed correctly.
- Create the script file
sudo nano /home/opc/start_minecraft.sh
- Add the Minecraft server start command:
#!/bin/bash cd /home/opc/minecraft java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
- Make the script executable
sudo chmod +x /home/opc/start_minecraft.sh
Step 2: Create a Systemd Service File
Next, create a systemd service file to manage the Minecraft server.
- Create the service file
sudo nano /etc/systemd/system/minecraft.service
- Add the following content to the service file
[Unit]
Description=Minecraft Server
After=network.target
[Service]
User=opc
WorkingDirectory=/home/opc/minecraft
ExecStart=/home/opc/start_minecraft.sh
Restart=on-failure
[Install]
WantedBy=multi-user.target
Step 3: Enable and Start the Service
- Reload systemd to apply the new service:
sudo systemctl daemon-reload
- Enable the service to start on boot
systemctl enable minecraft.service
- Start the Minecraft server service
sudo systemctl start minecraft.service
- Check the status of the service
sudo systemctl status minecraft.service
How to Set Up a Daily Backup for Your Minecraft Server
You don't want to be the server admin that's responsible for losing your friends' world! Make sure you have backups. Nothing is backed up automatically on a self-hosted VPS server!
Step 1: Create a Backup Script
- Create the script file
sudo nano /home/opc/backup_minecraft.sh
- Add the backup commands to the script
#!/bin/bash
TIMESTAMP=$(date +'%Y-%m-%d_%H-%M-%S')
BACKUP_DIR="/home/opc/minecraft_backups"
WORLD_DIR="/home/opc/world"
BACKUP_FILE="$BACKUP_DIR/world_backup_$TIMESTAMP.tar.gz"
# Create backup directory if it doesn't exist
mkdir -p $BACKUP_DIR
# Create a compressed tarball of the world directory
tar -czvf $BACKUP_FILE $WORLD_DIR
# Optionally, remove backups older than 7 days to save space
find $BACKUP_DIR -type f -mtime +7 -name "*.tar.gz" -exec rm {} \;
- Make the script executable
sudo chmod +x /home/opc/backup_minecraft.sh
Step 2: Set Up the Cron Job
- Open the cron job editor
crontab -e
- Add the cron job entry to run the backup script daily
0 2 * * * /home/opc/backup_minecraft.sh
This cron job is set to run the backup script every day at 2 AM. You can adjust the timing as needed.
Step 3: Verify the Cron Job
- List the cron jobs to verify the new entry
crontab -l
You should see the entry you added:0 2 * * * /home/opc/backup_minecraft.sh