How to Make a Minecraft Server (Java Edition, 2026 Guide)

Set up your own Minecraft Java server step by step. Java, the server jar, the EULA, RAM flags, port forwarding and how friends connect.

Updated Sep 30, 2026 · 5 min read

On this page

A Minecraft server is a Java program that runs your world and lets other players connect to it. You can run one on your own PC for free, and this guide walks through every step. At the end there is a quicker option if you would rather skip the setup.

Short on time? You can skip Java, port forwarding and leaving your PC on. GamezServers Minecraft hosting gives you a live server with its own address in about 60 seconds, and our quick start guide shows every step.

What you need

  • A PC that stays on while people play. Windows, macOS and Linux all work.
  • At least 2 GB of RAM free for the server on top of what your PC already uses, and more for mods.
  • The version of Java that matches your Minecraft version. Minecraft 26.1 and newer need Java 25, while 1.20.5 to 1.21.x need Java 21.
  • Access to your router settings, so friends outside your home can connect.

Step 1: Install Java

Download Java 25 (or the version your Minecraft release needs) from a provider such as Eclipse Temurin and install it. Starting a 26.x server on older Java fails with an UnsupportedClassVersionError. Then open a terminal (Command Prompt on Windows) and check it worked:

java -version

If you see a version number, you are ready. If you get "command not found", restart the terminal or reinstall Java with the option to add it to your PATH.

Step 2: Download the server

Make a new folder called minecraft-server somewhere easy to find. Download the official server jar from minecraft.net/download/server and save it into that folder as server.jar.

Want better performance? Paper is a drop in replacement for the official jar that runs faster and supports plugins. The steps below are the same, just use the Paper jar instead.

Step 3: Run it once and accept the EULA

Open a terminal in your folder and start the server:

java -Xms2G -Xmx2G -jar server.jar nogui

It stops straight away and creates a file called eula.txt. Open it, change eula=false to eula=true and save. This confirms you accept the Minecraft EULA.

Run the same command again. The server generates your world, and when you see Done in the console it is ready.

Step 4: Give it the right amount of RAM

The -Xms and -Xmx flags set how much memory the server uses. Keep them equal and use this as a starting point:

Server RAM
Vanilla or Paper, up to 5 friends 2 GB
Paper with plugins, 10 to 25 players 4 GB
Light modpack, up to 10 players 6 GB
Big modpack like All the Mods 8 to 10 GB

For 4 GB the command becomes java -Xms4G -Xmx4G -jar server.jar nogui. Never give the server all of your PC's memory, the operating system needs some too. For a deeper look, read how much RAM a game server needs.

Step 5: Tweak server.properties

Open server.properties in a text editor. The settings most people change:

  • motd: the message shown in the server list.
  • difficulty: peaceful, easy, normal or hard.
  • max-players: how many people can join at once.
  • white-list: set to true so only people you add can join.
  • server-port: leave it at 25565 unless you have a reason to change it.

Restart the server after saving.

Step 6: Let friends connect

Players on your home network can join with your PC's local address, for example 192.168.1.20. Friends elsewhere need two more things:

  1. Port forwarding. Log into your router and forward TCP port 25565 to your PC's local IP address. Every router's menu is different, so search for your router model plus "port forwarding". If your provider uses CGNAT, forwarding cannot work at all, and a hosted server with its own address is the simplest way around it.
  2. Your public IP. Search "what is my IP" and send that address to your friends.

Allow Java through your firewall when Windows asks. Remember the server is only reachable while this PC is on and awake, so turn off sleep mode in your power settings if friends play without you. Your friends then open Minecraft, click Multiplayer, Add Server and paste your public IP.

Common problems

  • "Connection refused" or "timed out": the port is not forwarded correctly, the firewall is blocking Java, or the server is not running. Our getsockopt error guide goes through every fix.
  • UnsupportedClassVersionError on start: your Java is too old for this Minecraft version. Install Java 25 for 26.x servers.
  • "Outdated client" or "outdated server": the player's Minecraft version does not match the server's. Pick the same version in the launcher, or update the server by downloading the new jar, checking your Java version and backing up first. See how to fix outdated server and client errors.
  • Lag with only a few players: the server needs more RAM, or your PC is busy with other things. Paper helps a lot, and the Minecraft server lag fix guide covers the rest.
  • The address stopped working: most home internet connections change their public IP now and then. You have to send friends the new one.

The easy way

Self hosting works, and now you know how. The ongoing part is what wears people down: your PC has to stay on whenever anyone plays, your home IP is shared with everyone who joins, the address breaks when your IP changes, and every Minecraft update means a new jar, maybe a new Java and a manual backup. A hosted server skips all of that. Pick a plan, pay, and your server is live in about a minute with its own address, no port forwarding, Paper, Fabric, Forge or modpacks picked from a menu, whitelist and op as buttons, and one click backups. You can even split the bill with friends. See Minecraft server hosting for plans, or how to host a Minecraft server for the walkthrough.

Skip the setup. Your Minecraft server, live in 60 seconds.

Plans first month from $2.49. No command line, cancel any time.

Deploy Minecraft

Keep reading