Skip to main content
← All guides

Creating a Minecraft server (Java Edition, Paper and vanilla)

Here's how to install a Minecraft Java Edition server on an Ubuntu server and play on it with your friends.

Before you start

  • Specs: Even for a few friends playing vanilla, we recommend 8GB of memory or more; if you use lots of mods/plugins or have many players, 16GB or more. Low specs lag as soon as players or plugins increase a little. How to choose VPS specs (recommended specs by use case)
  • Network: If your server will be open to the public, consider the Security Zone to be ready for DDoS attacks. Each Security Zone plan includes a set amount of base traffic and you buy more if it runs short, so check traffic usage too.

1. Install Java

Minecraft 26.1 and above needs Java 25. (Per PaperMC's guidance, 1.20–1.21.11 need Java 21, so to run an older version, change openjdk-25-jre-headless in the command below to openjdk-21-jre-headless.)

sudo apt update
sudo apt install -y openjdk-25-jre-headless screen
java -version

2. Download the server file

Create a folder for the server and download the server executable (.jar).

  • Vanilla (official): Copy the server.jar link from the "Minecraft: Java Edition server download" page on minecraft.net.
  • Paper (supports plugins, lighter): Copy the link for the version you want from the download page on papermc.io.
mkdir ~/minecraft && cd ~/minecraft
wget -O server.jar "copied download link"

3. First run and agreeing to the EULA

java -Xms1G -Xmx3G -jar server.jar nogui

On the first run, it exits right away and creates an eula.txt file. Change it to the setting that agrees to Minecraft's terms of use.

sed -i 's/eula=false/eula=true/' eula.txt

-Xmx3G is the maximum memory given to the server. Set it leaving 1–2GB of the server's total memory for the operating system. (e.g., 4GB server → -Xmx3G, 8GB server → -Xmx6G)

4. Keep it running after closing the window (screen)

Closing the SSH window shuts the server down too, so run it inside screen.

screen -S mc
java -Xms1G -Xmx3G -jar server.jar nogui
  • Leave while keeping the server running: press Ctrl + A, then D
  • Go back to the server console: screen -r mc
  • Stop the server: type stop in the server console

5. Open the firewall

If you've turned on the firewall (ufw), open the Minecraft port. (Opening firewall ports)

sudo ufw allow 25565/tcp

6. Connect

In Minecraft → Multiplayer → Add Server, enter the server IP as the Server Address. If you're using the default port (25565), you can leave the port out.

On a server whose detail page shows a service port (a private-IP server), set server-port in server.properties to the service port number and enter IP:service port as the server address. See What is a port? for details.

Common problems

  • I can't connect — Check that Done (...)! For help, type "help" has appeared in the server console, and that 25565 is open in the firewall.
  • It's really laggy — Increase the -Xmx memory, switch to a Paper server, or consider a plan with higher specs.
  • The server suddenly shut down — It may have been forcibly shut down because it ran out of memory. Check that you set -Xmx lower than the server's memory.
  • World backups — With the server stopped, download the world folder to your PC. Uploading and downloading files

If your problem isn't solved, open a ticket on our Discord.

Creating a Minecraft server (Java Edition, Paper and vanilla) - Nevv Guides