You want your own Minecraft server. Not a laggy public lobby. Not a managed host charging you monthly for something you could run yourself. That sounds simple until you start asking questions.
Which specs do you need? Which operating system? What happens when you close your laptop and the server dies with it? One wrong firewall rule and nobody can join.
This guide skips the guesswork. It gives you the exact specs and the exact commands. It also covers the one step most tutorials forget: keeping your server running after you disconnect.
By the end, you will have a live Minecraft server on a VPS. Your friends can join tonight.
What You Need Before You Start
| RAM | Setup | Player Count |
|---|---|---|
| 1 to 2GB | Vanilla, minimal plugins | 5 to 10 players |
| 4GB | Vanilla or Paper with light plugins | 10 to 20 players |
| 6 to 8GB | Paper with more plugins or light modpacks | 20 to 30 players |
| 16GB+ | Heavy modpacks or large communities | 50+ players |
A VPS gives you a private slice of a physical server, with your own resources and root access. Before you touch a terminal, gather a few things.
Minimum viable spec: 2GB RAM and 1 vCPU will run a small vanilla server for 5 to 10 players. For anything beyond a quick test, aim higher. A 4GB RAM and 2 vCPU plan is a safer starting point for most groups.
Operating system: Pick Ubuntu 22.04 or 24.04 LTS, or Debian 12. LTS releases get security patches for years. That keeps your server stable without forcing constant upgrades.
Access requirements: You will need root or sudo access, plus the VPS IP address and your SSH login credentials. Your VPS provider gives you all three once the plan is set up.
Java Edition or Bedrock Edition: This guide covers Java Edition. It is the version most PC players use, with the widest support for plugins and mods. Bedrock uses a different setup path entirely.
Connect to Your VPS via SSH

With your VPS ready, the next step is logging in. SSH is the standard way to reach a remote server from your own computer.
On Mac or Linux, open Terminal and type this command, swapping in your actual IP address:
ssh root@your_vps_ip
On Windows, use PuTTY or the built-in Windows Terminal with the same command format. Enter your password when prompted, and you are in.
Once connected, update your packages right away. This closes known security gaps and keeps your system current:
apt update && apt upgrade -y
If your provider gave you a default root password, change it now. Or switch to SSH key authentication before going further.
Install Java on Your VPS

Minecraft server software runs on Java, so this step cannot be skipped for Java Edition. Bedrock servers do not need Java at all.
Java version requirements change with each major Minecraft release. Check what your target version needs before installing anything. Newer Minecraft releases mostly require Java 17 or 21.
Install OpenJDK with a command like this, adjusting the version number to match your needs:
apt install openjdk-21-jre-headless -y
Once installed, confirm it worked:
java -version
If the terminal returns a version number, you are ready to move on.
Download and Configure the Minecraft Server

Running everything as root is a bad habit that carries real risk. Create a dedicated user first, then a working directory for your server files:
adduser minecraft
mkdir -p /home/minecraft/server
cd /home/minecraft/server
Now download the official server jar. Pull it from the official Minecraft server download page, not a third-party mirror. Unofficial files can carry malicious code:
wget https://path-to-official-server-jar
Run the jar once to generate the initial files, then open eula.txt. Change the line to eula=true.
The server refuses to start without this step. That line counts as your agreement to Minecraft’s terms.
Before your first real launch, open server.properties and adjust a few settings:
- max-players sets your player cap
- Difficulty controls how tough the game feels
- View distance affects how far the world renders for each player
- Motd is the message shown in the server list
Set the Right JVM Memory Flags
The -Xms and -Xmx flags tell Java how much memory to reserve for your server.
Setting them to the same value avoids mid-session resizing, which can cause noticeable pauses.
Match your flags to the RAM table from earlier. On a 4GB VPS, you might give the server 3GB and leave the rest for the operating system:
java -Xms3G -Xmx3G -jar server.jar nogui
If you run Paper with more than a handful of plugins, look into Aikar’s flags. They are a well-tested set of JVM arguments built for Minecraft server performance.
Keep Your Server Running After You Disconnect
Here is the step almost every beginner misses. Close your SSH session the normal way, and your Minecraft process dies with it. That is default Linux behavior, not a bug.
You have three common options to fix this.
Screen lets you start the server inside a virtual terminal session, detach from it, and reattach later. It is simple and quick to learn.
Tmux works much like screen but offers more flexibility for managing several sessions at once.
Systemd is the strongest option for anything permanent. It runs your server as a background service and restarts it automatically if it crashes. It also starts the server on boot, with no manual step needed.
A basic systemd setup involves creating a service file at /etc/systemd/system/minecraft.service. Point it to your Java command and working directory.
Once saved, you can start, stop, and enable the service with a few short commands.
For a server you plan to keep running for weeks or months, systemd is worth the small extra setup time.
Open the Right Port and Configure Your Firewall
Minecraft listens on port 25565 by default, using TCP. Without this port open, no player can reach your server, no matter how well everything else is configured.
If your VPS uses UFW, open the necessary ports like this:
ufw allow 22/tcp
ufw allow 25565/tcp
ufw enable
This allows SSH access on port 22 and Minecraft traffic on 25565. Everything else stays blocked by default.
One detail trips up people coming from home server setups.
A VPS already has a public IP address, so there is no router or NAT to configure. The firewall rule above is the only piece you need on the network side.
Secure Your Minecraft VPS
A public VPS sits directly on the internet. A few security habits go a long way toward keeping it safe.
Run the Minecraft process under the non-root user you created earlier, never as root. If a plugin or mod has a flaw, this limits what damage it can do.
Once you confirm SSH works with your normal login, disable password-based SSH access.
Switch to key-based authentication instead. Keys are far harder to brute-force than passwords.
For private servers, turn on the in-game whitelist. This restricts joining to approved players only, reducing random visitors and potential griefing.
Most VPS providers include some baseline DDoS protection, though coverage varies widely.
Check what your plan actually includes rather than assuming full protection by default.
Test the Connection and Join Your Server
Start your server and watch the console for a “Done” message. That confirms your server loaded correctly.
From there, open your Minecraft client, go to Multiplayer, and add a new server using your VPS IP address.
If everything is set up correctly, your server should appear in the list within a few seconds. If it does not, the troubleshooting section below covers the most common causes.
Troubleshooting Common Minecraft VPS Setup Problems
Even a careful setup can hit a snag. Here are the issues most people run into, and how to fix each one.
The server won’t start at all. Check three things first. Confirm eula=true is set in eula.txt, since this is the most common first-run failure.
Next, verify your installed Java version matches what your Minecraft release needs. Finally, check whether your -Xmx value exceeds the actual RAM on your VPS.
That mismatch causes an immediate crash. Reading logs/latest.log will usually point you straight to the real error, instead of leaving you guessing.
“Connection Refused” when joining. This message means the client reached your IP but got no response back.
The server may not be running. It may be listening on a different port. Or a firewall may be blocking the connection.
Check both the operating system firewall (ufw) and your VPS provider’s own firewall panel. Many providers apply a second layer beyond the server itself.
A free tool like canyouseeme.org can confirm whether port 25565 is actually open to outside traffic.
“Connection Timed Out.” Unlike a refused connection, a timeout means the request never reached your server at all.
This usually points to routing problems, or a firewall silently dropping packets rather than rejecting them outright.
Double-check the IP address for typos first, since even one wrong character causes this error.
If you set a custom port, players need to include it in the address, like yourip:25566.
Server starts but crashes after a few minutes. This nearly always traces back to memory.
Cross-check your usage against the RAM sizing table from earlier in this guide. If your server’s MSPT, or milliseconds per tick, stays above 50 for long stretches, the main thread cannot keep up.
Setting up automatic restarts through your systemd service adds a safety net. It will not fix an underlying memory shortage on its own.
Players on different Minecraft versions can’t connect. Client and server versions need to match exactly. A 1.21 client cannot join a 1.20 server, and the reverse is also true.
Update your server jar to match the version your players run, without wiping your existing world folder.
Server is up and joinable but laggy. This falls under performance tuning, not setup. It deserves its own deep coverage.
For a full walkthrough on tick rate, network compression, and Java tuning, see our guide on fixing Minecraft server lag on a VPS.
FAQs
How much does it cost to run a Minecraft server on a VPS?
Pricing depends on your RAM and CPU tier. Small VPS plans built for a handful of players typically start at a few dollars per month. Larger plans built for bigger communities or modpacks cost more, scaling with RAM and CPU.
Can I install mods or plugins like Forge, Spigot, or Paper on this setup?
Yes. A VPS gives you full root access. You can swap in Paper, Spigot, Forge, or Fabric server jars in place of vanilla at any point. Each option comes with its own resource needs, so revisit the sizing table before switching.
Is a VPS better than a dedicated Minecraft hosting plan?
It depends on what you want. A VPS gives you full control over the operating system, Java version, and configuration. You handle the setup yourself. A managed Minecraft host handles that setup for you, but limits how deep you can customize things.
How do I update my Minecraft server to a new version later?
Download the new official server jar. Stop your current server, replace the old jar file, and restart. Your world folder and player data stay intact through the update, as long as you do not delete them.
Can I run more than one Minecraft server on the same VPS?
Yes, as long as your RAM and CPU can support it. Each server needs its own directory and its own port. Two servers cannot share port 25565 at the same time.
Get Your Minecraft Server Live Today
You now have a right-sized VPS, with Java installed and your server secured.
It survives a closed SSH session, and the port is open for friends to join. That covers the full path from a blank VPS to a live, playable world.
The last step is picking the plan sized to your player count from the table above.
Check out Truehost’s USA-based VPS plans and get your Minecraft server deployed in minutes.
Domain RegistrationFind and register the perfect domain for your website.
.COM DomainChoose a widely recognized domain to build global credibility.
Domain TransferSeamless domain transfers with zero downtime and complete control.
All TLDsFind and register your perfect domain. Choose from local and global extensions.
whoisCheck domain ownership details, expiration dates, and registrar information.
US DomainRegister a .US domain and build trust in the USA.
Web HostingEverything your website needs to run smoothly
WordPress HostingWordPress hosting that just works
Windows HostingReliable hosting for Windows environments
Reseller HostingTurn hosting into your business
Email HostingEmail that looks professional and works anywhere
cPanel HostingFull control of your hosting with cPanel
Affiliate ProgramJoin as a partner and earn commissions on every referral you send our way.
Vps HostingScalable virtual servers that expand as you need.
Dedicated ServersGet complete access and full control over your dedicated physical server.
Managed vpsNot tech-savvy? We will take care of everything with our fully managed VPS hosting for you.







