For Creators & Hosts

How to Make a Minecraft Server (Java): Set It Up, Let Friends Join, Keep It Running

Your own Java server, your rules, and friends actually able to connect, from the first eula.txt to the last port-forwarding headache.

Want a Java world for you and a few friends that runs on a machine you control? Here's how to make a Minecraft server without wading through the Minecraft Wiki's full reference manual or a YouTube tutorial filmed three versions ago.

The short version: install the Java version your Minecraft release needs, download the official server jar from minecraft.net, run it once, set eula=true in eula.txt, tweak server.properties, and run it again. Friends on your Wi-Fi can join right away. Friends anywhere else need you to forward port 25565 on your router, or use a tunnel like playit.gg if you can't. Then make yourself op, turn on the whitelist, and back up the world folder.

Three ways to host a Minecraft server

Before you download anything, decide where the server actually lives.

RouteCostThe catchWho it suits
Your own PCFree (Mojang's server software costs nothing)It's only up while your PC is on, and outside friends need port forwarding or a tunnelA few friends, someone happy to tinker, a PC that can spare the RAM
A free host (Aternos, Minehut)FreeYou play by their limits, not yoursAnyone who wants to skip the networking entirely
Paid hostingA recurring billYou're paying for itBigger or public servers that need to stay up without your PC

The free hosts get their own write-up: my guide to free Minecraft server hosting compares them properly, sleep timers and all. If you're running it yourself, read on.

What your PC needs

Minecraft servers are mostly single-threaded, so a fast core matters more than lots of cores. The Minecraft Wiki's guidance is at least 2GB of RAM for a small server and 4GB or more for bigger ones, plus at least 5GB of disk space so the world has room to grow. Plug the host machine in with a cable if you can. Wi-Fi is fine until it isn't, and when the host drops, everyone drops.

How to set up a Minecraft server on PC, step by step

1. Install the Java your Minecraft version needs

The server is a Java program, so you need Java, and which version depends on which Minecraft release you're running. You only need the runtime (the JRE), not the full JDK. Here's the Minecraft Wiki's mapping as of its August 2026 update:

Minecraft versionJava version required
26.1 and newerJava 25
1.20.5 and newerJava 21
1.18 and newerJava 17
1.17Java 16
1.12 and newerJava 8

Older Minecraft versions generally run fine on newer Java (1.16 runs on Java 17, for example). A new Minecraft release can bump the requirement again, so check the version you're actually running against this list rather than grabbing whatever Java a random tutorial names.

2. Download the official server jar

Get it from Mojang's own download page, minecraft.net/en-us/download/server, and nowhere else. It's free. The filename changes with every release, so rename it to server.jar and drop it in its own empty folder. The server spits a lot of files out the first time it runs, so give it a folder of its own.

3. First run, and the eula.txt step

Open a terminal in that folder and run:

java -jar server.jar nogui

It'll stop almost immediately. That's normal. It has just created eula.txt. Open it, change eula=false to eula=true, save, and run the same command again. This time the server actually starts and generates a world in a folder called world. The nogui bit skips the little server window. Leave it off if you'd like the window.

4. Give it some memory

Memory flags go between java and -jar. -Xmx is the most RAM the server may use, -Xms is what it starts with:

java -Xmx4G -Xms1G -jar server.jar nogui

The Wiki reckons 2GB is plenty for a home server with five players on the default simulation distance, so -Xmx2G is a fine start for a small group. Scale it up if you raise view distance or add players. Mojang's own quick-start command uses -Xmx4G -Xms4G, which is fine if your PC can spare 4GB.

5. The server.properties settings that matter

Stop the server and open server.properties. Most of it you can ignore. These are the settings worth changing:

How to make a Minecraft server for friends to join

Friends on the same network

Anyone on your router or Wi-Fi can join using your PC's internal IP and the port, something like 192.168.1.2:25565. No port forwarding needed. You can test it yourself on the host machine by connecting to localhost.

Friends over the internet: port forwarding

For friends outside your house, the Wiki puts it simply: for most people, port forwarding is enough. Port forwarding tells your router "traffic arriving on port 25565 goes to this PC." Every router's admin page looks different, but the steps are the same:

  1. Allow port 25565 (TCP and UDP) through the host PC's firewall.
  2. Log in to your router's admin page, usually by typing its gateway IP into a browser.
  3. Find the port-forwarding section.
  4. Add a rule sending port 25565 to your PC's internal IP on port 25565, protocol TCP/UDP (or "both").

Then give your friends your public IP, not the 192.168 one. That's your server address.

Two things trip people up here. If your ISP gave you a modem/router combo, or you've got one router plugged into another (double NAT), you might be forwarding on the wrong box. And if your public IP keeps changing, the address you handed out goes stale. The fixes are a dynamic DNS (DDNS) service, or paying your ISP for a static IP. While you're in the router, give the host PC a fixed internal IP too, so the forwarding rule doesn't break when your PC gets a new local address.

Can't port forward? Tunnels and VPNs

Some networks just won't let you. You've got two kinds of workaround:

Keeping your Minecraft server running

Ops and the whitelist

Make yourself operator from the server console with /op <yourname>. Be stingy with op for everyone else. An op can stop the server, de-op you, hand out Creative and grief to their heart's content. Add friends with /whitelist add <username>. You can also edit whitelist.json and ops.json by hand. Entries there are keyed by each player's Mojang UUID.

Back up the world folder

Your whole world lives in the world folder. Copy it somewhere else regularly. The Wiki recommends regular backups, and anyone who's lost a base to a corrupted save will tell you the same, louder.

Keep versions matched

Your server's Minecraft version and your friends' game versions should match. When they don't, connections fail or things get weird. When a new release lands, update the server jar (and check the Java table above), then have everyone update together. Keep the server itself updated, too. The Wiki counts it as basic security.

Want mods or plugins?

Everything above is plain vanilla. If you want plugins, you'll swap the official jar for something like Paper. If you want mods, you'll want a loader like Fabric or Forge. My Minecraft server software comparison lays out the options with official download links, Paper vs Fabric settles the plugins-or-mods question, and if you already have a modpack in mind, go straight to how to make a modded Minecraft server.

Player hosting, somewhere new

Folly is an upcoming standalone multiplayer voxel game, free with no purchases required, entering early access on October 16, 2026. Player-hosted servers are planned to roll out during early access, with founding creators first in line. That's a plan, not a shipped feature yet. Details are on the hosting and creators page.