Skip to content
Login
Sable Servers Sable Servers
    • Game ServersMinecraft, Rust, ARK, Palworld and more
    • Cloud Compute (VPS)Linux, Windows and HomeLab, full root
    • Object StorageS3-compatible buckets, kept in Canada
    • Web HostingWebsites with SSL, email and backups
    • Managed ServersWe patch, manage and secure your server
    • Managed ITHelp desk, remote support and device management. Quoted per business.
    • Networks & On-siteNetwork installs, Wi-Fi, cameras and security reviews.
    • Web Design & AppsWebsites and custom business software
  • Locations
  • Guides
  • Status
  • Contact
Customer Portal

Guides / Game Servers

How to Host a Minecraft Server on a Linux VPS

Set up a Minecraft Java server on Ubuntu, open the right port, and keep it running 24/7, even after a reboot.

Game ServersBeginner20 minUbuntu 24.04Minecraft Java

In this guide

  1. What you’ll need
  2. Connect to your server
  3. Update the server and install Java
  4. Open the Minecraft port
  5. Create a Minecraft user and download the server
  6. Accept the Minecraft rules (EULA)
  7. Start it, join, and make yourself admin
  8. Keep it running 24/7
  9. Change settings and manage your server

You’ll need a Linux VPS. A 4 GB plan, CA$12.99/mo in Halifax, runs a server for a group of friends.

See VPS plans

By the end of this guide you’ll have your own Minecraft: Java Edition server running on a Linux VPS. Your friends can join from anywhere, it keeps running after you close your laptop, and it starts itself again if the server ever reboots. No experience needed — you’ll copy and paste every command, and after each one we’ll show you exactly what you should see.

You & your friends Minecraft: Java Edition connect Internet port 25565 Your Sable VPS Ubuntu 24.04 Minecraft server · :25565 running 24/7
How it fits together: you set up the server once on your VPS, and everyone connects to it over the internet.

What you’ll need

  • A Linux VPS running Ubuntu 24.04. 4 GB of RAM comfortably fits a group of friends; pick 8 GB for lots of mods or a bigger crowd. Don’t have one yet? Grab one above — it’s ready in a couple of minutes.
  • Your server’s IP address and root password. Both are in your welcome email and in the Customer Portal.
  • A terminal on your own computer — just a window where you type commands:
    • Windows: open PowerShell (press Start, type PowerShell, press Enter).
    • Mac: open Terminal (press Cmd + Space, type Terminal, press Enter).
    • Linux: open your Terminal app.
  • Minecraft: Java Edition on your computer, to join and test. (The phone/console “Bedrock” edition uses different server software and won’t connect to this one.)
The Server Information panel in the SableServers Customer Portal, showing the hostname, IP address, operating system, masked root password and SSH port.
In the Customer Portal, open your VPS and the Server Information panel shows your IP address and root password (click the eye icon to reveal it).

One rule for the whole guide: wherever you see your_server_ip, type your own IP address instead (it looks like 203.0.113.42).

1Step 1: Connect to your server

Open your terminal (PowerShell on Windows, Terminal on Mac/Linux), type the line below with your own IP in place of your_server_ip, and press Enter:

Your computer
$ ssh root@your_server_ip

The very first time, it asks if you trust this server:

What you’ll see
The authenticity of host '203.0.113.42' can't be established.
...
Are you sure you want to continue connecting (yes/no/[fingerprint])?

Type yes and press Enter. Next it asks for your password — type or paste your root password and press Enter.

The screen stays blank while you type the password — that’s normal.

For security the terminal shows nothing, not even dots. Just type it and press Enter.

You’re in when the start of the line changes to something like this — it means you’re now typing commands on your server:

What you’ll see
root@your-server:~#

2Step 2: Update the server and install Java

Minecraft: Java Edition runs on Java. First, bring the server up to date. Copy this, press Enter, and give it a minute:

Your server
$ apt update && apt upgrade -y

Minecraft needs a matching version of Java. The download in the next step gives you the latest Minecraft (26.x right now), which needs Java 25 — so most people pick the first option below. Only choose the older one if you specifically want a 1.20.5–1.21.x server (for example, for mods or plugins that haven’t updated yet).

Your server
$ apt install -y openjdk-25-jre-headless
Your server
$ apt install -y openjdk-21-jre-headless

Check it installed:

Your server
$ java -version
What you’ll see (numbers may differ)
openjdk version "25.0.3" 2026-10-21
OpenJDK Runtime Environment (build 25.0.3+9-Ubuntu)
OpenJDK 64-Bit Server VM (build 25.0.3+9-Ubuntu, mixed mode)

As long as you see openjdk version and the number you installed, you’re good.

3Step 3: Open the Minecraft port

A firewall decides what’s allowed to reach your server. We’ll switch it on and allow two things: SSH (so you can still log in) and port 25565 (the door Minecraft uses). Run these:

Your server
$ apt install -y ufw
$ ufw allow OpenSSH
$ ufw allow 25565/tcp
$ ufw enable

When it warns that this may disrupt existing connections, type y and press Enter.

Allow OpenSSH first — don’t skip it.

If you turn the firewall on without allowing SSH, you’ll lock yourself out of your own server.

Check what’s now allowed:

Your server
$ ufw status
What you’ll see
Status: active

To                         Action      From
--                         ------      ----
OpenSSH                    ALLOW       Anywhere
25565/tcp                  ALLOW       Anywhere

4Step 4: Create a Minecraft user and download the server

For safety we won’t run the game as the all-powerful root user. We’ll make a separate minecraft user with its own folder, then switch to it:

Your server
$ useradd -m -d /opt/minecraft -s /bin/bash minecraft
$ su - minecraft

Your prompt changes to minecraft@your-server:~$ — you’re now acting as the minecraft user. Next, grab the official server download link:

  1. On your own computer, open minecraft.net/download/server.
  2. Right-click the minecraft_server.….jar link and choose Copy link (or “Copy link address”).
The minecraft.net server download page, showing the minecraft_server download link and the java run command.
The official download page at minecraft.net — right-click the minecraft_server link and choose “Copy link”.

Back in the terminal, type wget -O server.jar then a space, then paste your link (right-click to paste, or Ctrl + V), and press Enter:

Your server (as minecraft)
$ wget -O server.jar PASTE_YOUR_LINK
What you’ll see (it ends with)
'server.jar' saved [58720256/58720256]

5Step 5: Accept the Minecraft rules (EULA)

Start the server once so it creates its files. It stops right away and asks you to accept Mojang’s End User License Agreement:

Your server (as minecraft)
$ java -Xms1G -Xmx3G -jar server.jar nogui
What you’ll see — this is expected
[ServerMain/WARN]: Failed to load eula.txt
[ServerMain/INFO]: You need to agree to the EULA in order to run the
server. Go to eula.txt for more info.

That’s normal. Accept it with this one command:

Your server (as minecraft)
$ sed -i 's/eula=false/eula=true/' eula.txt
What’s -Xmx3G?

It’s the most memory Minecraft may use. Leave about 1 GB for the system: use -Xmx1G on a 2 GB VPS, -Xmx3G on 4 GB, and -Xmx6G on 8 GB.

6Step 6: Start it, join, and make yourself admin

Start the server again:

Your server (as minecraft)
$ java -Xms1G -Xmx3G -jar server.jar nogui

The first start takes a minute while it builds the world. It’s ready when you see a line like this:

What you’ll see
[Server thread/INFO]: Done (41.238s)! For help, type "help"

Now open Minecraft on your computer and join:

  1. Click Multiplayer, then Add Server.
  2. In Server Address, enter your server’s IP address (your_server_ip).
  3. Click Done, then double-click your server to join. 🎉
Minecraft’s Multiplayer screen with the Add Server button highlighted.
In Minecraft, open Multiplayer and click Add Server (highlighted), then enter your server’s IP as the Server Address.

While you’re connected, make yourself an admin (“operator”) so you can run commands. Type this in the terminal window where the server is running, using your exact Minecraft username:

Minecraft server console
op YourMinecraftName
What you’ll see
[Server thread/INFO]: Made YourMinecraftName a server operator

Now stop the server cleanly and return to the root user:

Server console, then your server
stop
$ exit

7Step 7: Keep it running 24/7

Right now the server stops the moment you close the terminal. Let’s turn it into a service so it runs in the background and restarts itself after a reboot. Open a new, empty file:

Your server (as root)
$ nano /etc/systemd/system/minecraft.service

nano is a simple text editor right in the terminal. Paste the block below into it (right-click, or Ctrl + V). Only change -Xmx3G if you chose a different memory size earlier:

/etc/systemd/system/minecraft.service
[Unit]
Description=Minecraft Server
After=network-online.target
Wants=network-online.target

[Service]
User=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/usr/bin/java -Xms1G -Xmx3G -jar server.jar nogui
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Save and close nano: press Ctrl + O then Enter to save, then Ctrl + X to exit. Now switch the service on and set it to start at boot:

Your server (as root)
$ systemctl daemon-reload
$ systemctl enable --now minecraft
$ systemctl status minecraft
What you’ll see
● minecraft.service - Minecraft Server
     Loaded: loaded (/etc/systemd/system/minecraft.service; enabled)
     Active: active (running) since ...

Seeing active (running) (usually in green) means it’s live. Press Q to leave that screen. You can close your terminal now — the server keeps running.

8Step 8: Change settings and manage your server

Settings like the name shown in the server list (motd), max-players, difficulty and gamemode live in server.properties. Edit it, then restart to apply:

Your server (as root)
$ nano /opt/minecraft/server.properties
$ systemctl restart minecraft

Handy commands to keep somewhere:

  • systemctl stop minecraft — stop the server (it saves the world first).
  • systemctl start minecraft — start it again.
  • systemctl restart minecraft — restart after changing settings.
  • journalctl -u minecraft -f — watch the live server log. Press Ctrl + C to stop watching.
Give someone else admin later?

Run systemctl stop minecraft, start the server by hand as in Step 6, type op TheirName, then stop and systemctl start minecraft.

Protect your world

One bad mod or a griefer shouldn’t cost you your world. Turn on daily automatic backups for your VPS in the Customer Portal — they’re 20% of your plan, from CA$1.40/mo.

That’s it — your Minecraft server is live, locked down, and running around the clock. Have fun, and if you get stuck on any step, our team in Nova Scotia is on the help desk and Discord.

Ready to build your world?

Canadian VPS in Halifax and Montreal, set up in minutes. Prefer no setup at all? Our Minecraft servers are one click.

See VPS plans

More guides

Prices shown in your currency are approximate. We bill in Canadian dollars.

Newsletter

New locations, deals and service news. About once a month.

Marketing email from Sable Servers Ltd. Confirm by email, unsubscribe any time. Privacy

Sable Servers Sable Servers

Built stable. That’s Sable.

Hosting

  • Game Servers
  • Cloud Compute (VPS)
  • Object Storage
  • Web Hosting
  • Managed Servers

Business

  • Managed IT
  • Networks & On-site
  • Web Design & Apps

Company

  • About Us
  • Locations
  • Status
  • Customer Portal

Contact

  • Email Us
  • Help Desk
  • Guides
  • FAQ
  • Discord

© 2026 Sable Servers Ltd. All rights reserved.

Terms of Service | Acceptable Use Policy | Privacy Policy |

Cookies

Necessary cookies keep this site running. If you allow it, we also use analytics and ad cookies and share visit and order data with Google and Meta, also from our servers, to measure our ads, here and in our store. They may process it outside Canada.

Privacy policyCookie details