Skip to main content
To host a Minecraft Java server on a Linux VPS, install Java 25 (sudo apt install openjdk-25-jre-headless on Ubuntu 24.04), download server.jar from minecraft.net, run it once, set eula=true in eula.txt, then start it with java -Xms2G -Xmx2G -jar server.jar nogui inside tmux. Allow TCP port 25565 in your firewall and join with your server’s IP. FREAKHOSTING also offers managed Minecraft servers on its Game Panel, if you’d rather not run the server yourself: see the Minecraft server hosting guide.

Before you start

  • Log in over SSH as root or a sudo user. Root users can leave out sudo.
  • Running the Minecraft server software means you accept the Minecraft End User License Agreement. You accept it yourself in step 5.
  • Plan memory: leave about 1 GB for the operating system. On a 4 GB VPS, give Minecraft 2–3 GB.

Which Java version does Minecraft need?

How to set up the Minecraft server

1

Install Java

Check it with java -version. The first line shows a version starting with 25, for example openjdk version "25.0.4.1". If an older Java is still the default, pick Java 25 with sudo update-alternatives --config java (Ubuntu/Debian) or sudo alternatives --config java (AlmaLinux/Rocky).
2

Create a user for the server

Don’t run Minecraft as root. Create a user with its own home folder:
The rest of the steps run as minecraft.
3

Download server.jar

On minecraft.net/download/server, right-click the server.jar link and copy the address. Then:
4

Run it once

The server stops straight away and creates eula.txt and server.properties.
5

Accept the EULA

After reading the EULA, set eula=true:
6

Start the server in tmux

tmux keeps the server running after you close SSH:
Wait for Done (…)! For help, type "help". Press Ctrl+B, then D to detach. Reattach later with tmux attach -t minecraft. See tmux and screen.

How to open port 25565

Minecraft Java uses TCP port 25565 by default (server-port in server.properties). Exit the minecraft user (exit) and run:
If ufw is not active yet, allow SSH first (sudo ufw allow OpenSSH) before you run sudo ufw enable, or you lock yourself out. See set up a firewall with UFW. If it happens, use the VNC console.

How to check it worked

You see a line with *:25565 and java. In Minecraft, open Multiplayer > Add Server and enter 203.0.113.10 (your server’s IP). Add :port only if you changed server-port.

How to manage the server

To start Minecraft automatically at boot, run it as a systemd service.

Frequently asked questions

How much RAM does a Minecraft server need?

It depends on players, view distance and mods. A few players on vanilla run in 2 GB. Watch real use with htop and raise -Xmx if the server is short of memory, keeping about 1 GB free for the system.

Why do I get UnsupportedClassVersionError?

Your Java is too old for that Minecraft version. Install the Java version from the table above and check with java -version.

Can friends join without my IP?

Point a domain such as mc.example.com at your server with an A record. See point a domain to your server.

Should I use Paper instead of vanilla?

Paper is a popular server with better performance and plugin support. Install it the same way, with the Paper jar instead of server.jar.

VPS and dedicated server guides

Every guide in this section.

Tune Linux for game servers

Lower lag on your VPS.

Host game servers with LinuxGSM

Scripts for 100+ game servers.

Install Pterodactyl Panel

Manage game servers in a web panel.

Keep sessions running with tmux

Detach and reattach the console.

Checked against Minecraft Java Edition 26.1 release notes (Java 25 requirement) and the Adoptium install docs on 4 November 2026; Java 25 install tested on Ubuntu 24.04 LTS; the RHEL 9 / 10 package name checked in the vendor repositories. Commands can differ on other distributions or releases.

Need Extra Help?

If you encounter any issues, our support team is ready to assist:

Save on Your Hosting

Ready to upgrade your hosting? Use code KB20 at checkout for 20% off your first order!

Last Updated: November 2026