Our shop is closed while we rebuild it. Get an email when it opens
  1. Home
  2. Guides
  3. Your first Minecraft server, step by step

Your first Minecraft server, step by step

Put server.jar in an empty folder, run java -Xms1024M -Xmx2048M -jar server.jar --nogui, set eula=true in eula.txt, run it again, then join with localhost. Friends outside your house need port 25565 forwarded.

What you will end up with

A Minecraft Java Edition server running on your own Windows, Mac or Linux PC, which you can join yourself and, with one more step, your friends can join too. It costs nothing, and it is a good way to see how a server works before you decide whether you want to rent one. Everything here is for Java Edition. Bedrock Edition has its own server program and its own settings.

Before you start

  • Java. The server is a Java program, so the PC needs Java installed. The Minecraft wiki lists which Java version each Minecraft version needs (newer Minecraft versions need newer Java), so check its table before you install.
  • Memory. The wiki recommends at least 2 GB of RAM for small servers, and 4 GB for larger ones, plus at least 5 GB of disk space for the world. See slots and RAM.
  • The server file. Download the Java Edition server file from Minecraft's official website. The wiki's examples call it server.jar.

Step by step

  1. Make a folder just for the server, for example MinecraftServer on your desktop, and put server.jar in it. The server creates its files in whatever folder it starts from, so a clean folder keeps them tidy.
  2. Start it once. Open a command window in that folder and run the wiki's example line:
    java -Xms1024M -Xmx2048M -jar server.jar --nogui
    -Xmx2048M is the most memory the server may use and -Xms1024M is how much it starts with, so raise them together if you want more. --nogui is optional: it stops a small window opening, and you type commands into the command window instead.
  3. Accept the licence. The first run creates a file called eula.txt and stops. Open it in Notepad and change eula=false to eula=true. The wiki says the server shuts down at once if you do not.
  4. Start it again with the same line. This time it makes your world, in a folder called world. When the console says it is done, the server is running.
  5. Join it yourself. Open Minecraft Java Edition, choose Multiplayer, then direct connection, and type localhost. If you can walk around, it works.
  6. Stop it properly. Type stop in the server window. The wiki says this saves all changes to disk and then shuts the server down. Use it every time, instead of just closing the window.

Settings worth changing

Everything lives in server.properties, a plain text file in the server folder. Stop the server, edit the file in Notepad, save, and start again. These are the ones a first server cares about, with the defaults from the Minecraft wiki:

SettingDefaultWhat it does
max-players20How many can play at once (slots)
motdA Minecraft ServerThe line shown under the server's name in the server list
difficultyeasyHow tough mobs are and how hunger works
gamemodesurvivalThe default game mode
level-nameworldThe name of the world folder
view-distance10How much world the server sends your game
server-port25565The port players connect to

Leave online-mode at true. The wiki says it only lets in players verified with the Minecraft account database.

Getting your friends in

  1. Same home network: they use your PC's home-network address and the port, like 192.168.0.168:25565, which is the wiki's example.
  2. Over the internet: you need port forwarding (and to allow the port through your PC's firewall). Our guide, hosting on your own PC or renting, explains it in plain words. The port is 25565 unless you changed it.

Whichever route, send them the address and port, and read how to join a game server if they get stuck.

Making it yours

  • Keep it private. Set up a whitelist and make yourself an operator with /op yourname. Both are in RCON, whitelist and admin rights.
  • Protect your world. Read how to back up a game server before you build anything you would hate to lose.
  • Mods and plugins are add-ons that change the game. A modded server is a separate project, so get the basics working first.

Prefer not to leave a PC running? Our Minecraft page explains how a rented server works.

Game pages that go with this guide

Quick answers

How do I start a Minecraft server on my PC?

Put server.jar in an empty folder and run java -Xms1024M -Xmx2048M -jar server.jar --nogui. Change eula=false to eula=true in eula.txt, then run the same line again.

What is eula.txt?

It is a file the server creates on its first run. You must change eula=false to eula=true in it, or the server shuts down straight away.

Sources (read 2 December 2026):

Want a server of your own one day?

Our shop is closed while we rebuild it. If you would like an email when it opens, leave your address here.

More guides

All guides