How to make a Minecraft server on a Linux VPS
To make a Minecraft server for Java Edition, you need a Linux machine with a public IP address, the Java version your Minecraft release expects, and the server software: Paper or the vanilla server.jar from minecraft.net. You accept the EULA, run it under systemd and open TCP port 25565, and players join with your IP address. The steps below assume Ubuntu 24.04 on a VPS, but any recent Debian or Ubuntu release works the same way.
Minecraft server setup: quick checklist
- Secure the VPS first: SSH key login, updates, a non-root sudo user.
- Install Java 25 (needed from Minecraft 26.1 onwards).
- Create a dedicated
minecraftuser to run the server. - Download Paper or the vanilla server jar.
- Run it once, then set
eula=trueineula.txt. - Write a start script with matching
-Xmsand-Xmxvalues. - Run it under systemd so it starts on boot and restarts after a crash.
- Open TCP 25565 in ufw and in your provider's firewall.
- Turn on the whitelist, add operators, and schedule backups.
Requirements for a Minecraft server on VPS hosting
Minecraft Java Edition 26.1 and later needs Java 25. Releases 1.20.5 to 1.21.11 need Java 21, 1.18 to 1.20.4 need Java 17, and 1.17 needs Java 16, so match Java to the version you plan to run. Memory matters more than CPU count: a small vanilla or Paper server for a group of friends runs comfortably on 4 GB of RAM, while modpacks need far more. Our guide on how much RAM a VPS needs covers sizing in more detail.
Before installing anything, follow Ubuntu VPS initial setup and switch to SSH key login.
Install Java and create a server user
On Ubuntu 24.04 the OpenJDK 25 runtime is in the standard repositories. The headless package is enough, since a server needs no graphics:
sudo apt update
sudo apt install openjdk-25-jre-headless jq tmux
java -version
Never run the server as root. A plugin bug or exploit would then have full control of the machine. Create a system user that owns only the game files:
sudo adduser --system --group --home /opt/minecraft minecraft
sudo -u minecraft -H bash
cd /opt/minecraft
How to create a Minecraft server: download Paper or vanilla
Paper is a widely used, faster fork of the vanilla server that also loads Bukkit and Spigot plugins. Fetch the latest stable build through PaperMC's download service. It asks for a User-Agent that identifies you, so replace the example below with your own name or contact URL:
UA="my-mc-server/1.0 (admin@example.com)"
VER=$(curl -s -H "User-Agent: $UA" https://fill.papermc.io/v3/projects/paper | jq -r '.versions | to_entries[0] | .value[0]')
URL=$(curl -s -H "User-Agent: $UA" "https://fill.papermc.io/v3/projects/paper/versions/$VER/builds" | jq -r 'first(.[] | select(.channel == "STABLE") | .downloads."server:default".url) // empty')
echo "$VER $URL"
[ -n "$URL" ] && curl -fL -H "User-Agent: $UA" -o paper.jar "$URL"
If URL comes back empty, that Minecraft version has no stable Paper build yet; pick the previous version or wait. For the vanilla server, copy the server.jar link from the official download page on minecraft.net and fetch it with curl -fL -o server.jar followed by the link. The rest of this guide uses paper.jar; swap the file name if you chose vanilla.
Accept the EULA and write a start script
Run the server once. It creates its folders and an eula.txt file, then stops:
java -Xms2G -Xmx2G -jar paper.jar --nogui
Read the Minecraft EULA at minecraft.net, especially if you plan to charge players for anything, then accept it:
sed -i 's/eula=false/eula=true/' eula.txt
Now create /opt/minecraft/start.sh. PaperMC's docs set -Xms and -Xmx to the same value. Leave roughly 1 to 1.5 GB for the operating system, so on a 4 GB VPS give the server 3 GB:
#!/bin/sh
cd /opt/minecraft
exec java -Xms3G -Xmx3G -jar paper.jar --nogui
Make it executable with chmod +x start.sh, then type exit to leave the minecraft user's shell.
Run the server under systemd or tmux
tmux is the quickest way to get going and gives you the live server console. Start a session with sudo -u minecraft tmux new -s mc /opt/minecraft/start.sh, detach with Ctrl+B then D, and reattach later with sudo -u minecraft tmux attach -t mc. Use it for the first run so you can type console commands such as op.
For a server that should stay up, systemd is better: it starts the server at boot and restarts it after a crash. Create /etc/systemd/system/minecraft.service:
[Unit]
Description=Minecraft server
After=network-online.target
Wants=network-online.target
[Service]
User=minecraft
WorkingDirectory=/opt/minecraft
ExecStart=/opt/minecraft/start.sh
Restart=on-failure
RestartSec=10
SuccessExitStatus=0 1 143
TimeoutStopSec=90
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now minecraft
journalctl -u minecraft -f
On stop, systemd sends SIGTERM: the server saves the world and exits with code 143, which SuccessExitStatus treats as a clean stop. Do not run the tmux session and the service at the same time; two copies on one world folder will corrupt it.
Minecraft server port 25565: open the firewall
Java Edition listens on TCP 25565 by default. Allow SSH before enabling ufw so you do not lock yourself out, then open the game port:
sudo ufw allow OpenSSH
sudo ufw allow 25565/tcp
sudo ufw enable
sudo ufw status
Many providers also run a network firewall in front of the VPS. If that firewall blocks inbound traffic by default, add a rule for TCP 25565 there as well, or players will time out even though ufw is open. If you change server-port, open the new port instead.
server.properties basics
Stop the server before editing server.properties, then start it again. The settings that matter most on a public server:
| Setting | Recommended | Why |
|---|---|---|
online-mode | true | Only players with a verified Minecraft account can join, so nobody can impersonate your username. |
white-list | true | Only listed players can join. Recent versions (from the 26.3 snapshots) enable it by default; set it explicitly. |
enforce-whitelist | true | Kicks anyone removed from the list when it reloads. |
view-distance | 8 to 10 | Chunks sent to each player (3 to 32). Lower it first if the server lags. |
simulation-distance | 6 to 10 | How far from players the world keeps ticking. |
max-players | Your real group size | Default is 20. |
Operators and the whitelist
From the server console (the tmux session), add players and make yourself an operator:
whitelist add YourName
whitelist add FriendName
op YourName
Operators can run admin commands in game, so give it only to people you trust. After that, manage the whitelist in game and run the server under systemd.
Backups and updates
Back up the whole /opt/minecraft folder, not just the world. The simplest consistent backup stops the server for a moment:
sudo systemctl stop minecraft
sudo tar -czf /root/mc-$(date +%F).tar.gz -C /opt minecraft
sudo systemctl start minecraft
Run it nightly from cron and copy the archives off the server. To update, take a backup, stop the service, replace paper.jar with the new build, check that your plugins support the new Minecraft version, and start again. Check whether the new release needs a newer Java first. Opening a world in an older version after a newer one has converted it is not supported, so the backup is your only way back.
Bedrock players: Bedrock Dedicated Server or Geyser
Bedrock Edition (phones, consoles, Windows Bedrock) cannot join a Java server directly. You have two options:
- Bedrock Dedicated Server: Mojang's separate server for Bedrock only. It listens on UDP 19132 (and 19133 for IPv6), and Ubuntu 22.04 or later is the officially supported Linux.
- Geyser: a Paper plugin that lets Bedrock players join your Java server for crossplay. Put the jar in
plugins, restart, and open its port (19132 by default). Geyser's setup docs ask for that port on both TCP and UDP, for examplesudo ufw allow 19132. The optional Floodgate plugin lets Bedrock players join without a Java account.
How players connect
In Minecraft Java, players choose Multiplayer, then Add Server, and enter your VPS IP address. On the default port, no :25565 suffix is needed. To use a name such as play.example.com, create a DNS A record pointing at the server IP with your DNS provider. Bedrock players add the same address with port 19132.
How to host a Minecraft server at home in India
If you are working out how to make a Minecraft server on a home PC instead, you must forward port 25565 on your router to that PC. That only works if your connection has a public IPv4 address, and many Indian broadband ISPs, and every mobile network, put customers behind CGNAT. If the WAN address in your router's status page does not match the public IP that websites show you, you are behind CGNAT and port forwarding cannot work. Home connections also change IP and lose power. A VPS avoids all of this.
Running a Minecraft server on Bigdomainhost
A Bigdomainhost KVM VPS gives you full root access, NVMe storage and out-of-band console access, with servers in Mumbai (BOM-1) and Delhi NCR (DEL-1) so Indian players get low ping. Every server sits behind a panel firewall that denies inbound traffic except SSH on port 22, so add a rule for TCP 25565 (and 19132 if you use Bedrock) in the control panel as well as in ufw. The networking docs explain how. To skip the manual work, Minecraft server hosting plans are the same kind of VPS with the Pterodactyl panel pre-installed on request, and support Java and Bedrock. For sizing help, call +91 75994 50220 during IST hours, WhatsApp the same number at any time, or email support@bigdomainhost.com.
Sources (checked )
- PaperMC Docs: Getting started with Paper
- PaperMC Docs: Downloads service (Fill API)
- PaperMC Docs: server.properties reference
- GeyserMC Wiki: Geyser setup