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
- Ubuntu 24.04
- AlmaLinux / Rocky
- Debian 13
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
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: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:
- Ubuntu / Debian (ufw)
- AlmaLinux / Rocky (firewalld)
How to check it worked
*: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 withjava -version.
Can friends join without my IP?
Point a domain such asmc.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 ofserver.jar.
Related guides
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:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026