How to make a Minecraft Java server

Running your own Java server takes about twenty minutes and no money if you host it yourself. This is the whole process, including the two steps that trip up almost everybody the first time.

Install the right Java version first

The server is a Java program, so the machine needs a Java runtime. Modern Minecraft releases require a recent long term support build, and a jar refusing to start with an UnsupportedClassVersionError means your Java is older than the jar expects.

Install a current LTS JDK, then check it from a terminal with java -version. If you have several installed, note the full path to the one you want, because you will point at it explicitly in the start script.

Pick vanilla or a plugin capable server

The official jar from minecraft.net runs the game exactly as Mojang ships it and supports no plugins. That is the right choice for a small private world and the wrong choice for anything public.

For a public server, use a Paper build instead. It is a drop in replacement that runs Bukkit plugins, performs better under load and fixes a long list of exploits. Everything else in this guide is identical either way. If you want mods rather than plugins, you want a Fabric or NeoForge server, which is a different jar and a different ecosystem.

First run, and the EULA step everybody hits

Put the jar in its own empty folder. Never put it in a folder with other files, because it will create a dozen of its own. Then start it once:

java -Xms2G -Xmx2G -jar server.jar nogui

It will exit immediately and write eula.txt saying you have not accepted the licence. Open that file, change eula=false to eula=true, save, and start it again. The second run generates the world and takes a minute or two.

Keep that start command in a script rather than typing it. On Windows a .bat file with the same line plus pause at the end will show you the error instead of closing the window.

Settings worth changing in server.properties

Stop the server with stop in the console before editing anything, or your changes get overwritten on shutdown.

  • motd is the line players see in their server list. It supports colour codes.
  • max-players should reflect your RAM and upload bandwidth, not your ambition.
  • view-distance is the single biggest performance lever. Ten is generous, six or seven is plenty for a busy server.
  • simulation-distance controls how far entities and redstone keep ticking. Lower it before you lower view distance.
  • online-mode must stay true unless the server sits behind a proxy you control. Turning it off lets anyone log in as any username.
  • enable-command-block is off by default. See our command block guide.

Letting other people in

On your own network, other players need your public IP and an open port. Java servers default to TCP 25565, so forward that port on your router to the machine running the server, and allow it through the machine's firewall.

Two things to know. Your home IP usually changes, so use a dynamic DNS hostname rather than telling people a number. And exposing a home connection puts your address in the hands of strangers, which is the main practical reason people move to rented hosting. Our hosting cost guide covers what that actually costs.

If you want a memorable address without the port, an SRV record lets play.example.com point at any port. You can check what your address resolves to with our SRV and address lookup tool.

Back it up before you need to

Stop the server, copy the world folders somewhere else, start it again. That is the whole minimum viable backup, and doing it weekly by hand is better than the automated system you keep meaning to set up.

For a public server, add a plugin that snapshots on a schedule and writes off the machine. The failure you are protecting against is a disk dying, so a backup on the same disk is not a backup.

Frequently asked questions

How much RAM does a Minecraft server need?

Two gigabytes is enough for a handful of friends on vanilla. Plugins, bigger view distances and more players push that up quickly, and modded servers start at four. See our RAM guide.

Can I run a server on the same PC I play on?

Yes, for a few players. Give the server a fixed amount of RAM well below your total, and expect frame drops when the server is doing heavy work like generating chunks.

Why can my friends not connect?

Almost always the port. Check that the server is listening on 25565, that your router forwards it, and that the machine firewall allows it. Test from outside your network rather than from another device at home.

Do I need Paper or is vanilla fine?

Vanilla is fine for a private world. Use Paper for anything public: you get plugins, better performance and a lot of exploit fixes, with no change to how the game plays.

Next steps

All guides · Free owner tools · List your server