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
- Make a folder just for the server, for example
MinecraftServeron your desktop, and putserver.jarin it. The server creates its files in whatever folder it starts from, so a clean folder keeps them tidy. - Start it once. Open a command window in that folder and run the wiki's example line:
java -Xms1024M -Xmx2048M -jar server.jar --nogui-Xmx2048Mis the most memory the server may use and-Xms1024Mis how much it starts with, so raise them together if you want more.--noguiis optional: it stops a small window opening, and you type commands into the command window instead. - Accept the licence. The first run creates a file called
eula.txtand stops. Open it in Notepad and changeeula=falsetoeula=true. The wiki says the server shuts down at once if you do not. - 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. - Join it yourself. Open Minecraft Java Edition, choose Multiplayer, then direct connection, and type
localhost. If you can walk around, it works. - Stop it properly. Type
stopin 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:
| Setting | Default | What it does |
|---|---|---|
max-players | 20 | How many can play at once (slots) |
motd | A Minecraft Server | The line shown under the server's name in the server list |
difficulty | easy | How tough mobs are and how hunger works |
gamemode | survival | The default game mode |
level-name | world | The name of the world folder |
view-distance | 10 | How much world the server sends your game |
server-port | 25565 | The 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
- 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. - 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
25565unless 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):
- Minecraft Wiki: Setting up a Java Edition server: Start command, eula.txt, 2 GB RAM, 5 GB disk, port 25565, world folder, connecting, Java requirements
- Minecraft Wiki: server.properties: Defaults for max-players, motd, difficulty, gamemode, level-name, view-distance, server-port, online-mode
- Minecraft Wiki: /stop: Saves then shuts down
Our shop is closed while we rebuild it. If you would like an email when it opens, leave your address here.
More guides
What is a game server, and do you need one?
A game server explained in plain English: what it does, the three ways to share a world, and how to tell whether you need your own.
How to join a game server by its address
How to join a game server with an IP address and port, game by game: Minecraft, Terraria, Rust, ARK and 7 Days to Die, plus what to try when it will not connect.
How many slots and how much RAM does a game server need?
What slots and RAM mean, how to count the slots you need, and what the games' own documentation says about memory for Minecraft, Rust and ARK.
Host on your own PC or rent a server?
An honest comparison of hosting a game server at home and renting one, with port forwarding explained in plain words and when each one makes sense.