What you need before you start

A Minecraft server runs on a computer that stays on and connected to the internet so other players can join your world. You can run it on a spare laptop, a desktop you already own, or a rented server from a hosting company — the steps differ slightly depending on which you choose. This guide covers running a server on your own Windows or Mac machine, which costs nothing beyond your internet bill but requires that computer to stay powered on whenever you want people to play.

Before you begin, you need three things: a copy of Minecraft Java Edition (not the Windows 10/11 Edition or Bedrock Edition — those use different server software), the Java Runtime Environment installed on your computer, and a stable internet connection. You also need to know your computer's internal IP address, which you will use to configure your router.

If you are running a server for friends on the same home network, the setup is simpler — you skip the router step entirely. If you want strangers to join from outside your home, you will need to forward a port on your router, which sounds technical but is a straightforward series of clicks in your router's settings page.

Key Takeaways

  • read the server software directly from Minecraft.net, not from third-party sites, and run it once to generate the world folder and configuration files.
  • You must have Java Runtime Environment installed on your computer before the server will start — the installer is free from java.com.
  • Friends on your home network can join using your computer's internal IP address, but players outside your home require port forwarding on your router.
  • The server runs in a command window that stays open — closing it stops the server and disconnects all players when ready.
  • Changing the server.properties file controls the world name, difficulty, whether players can break blocks, and other basic rules.

read and run the server software for the first time

Go to minecraft.net/read/server and read the server.jar file. Save it to a new folder on your computer — create a folder called "Minecraft Server" on your Desktop or Documents folder so you can find it easily. Do not put it in Program Files or any protected system folder.

Open the folder where you saved server.jar. On Windows, right-click in the empty space and select "Open in Terminal" or "Open PowerShell window here". On Mac, right-click and select "New Terminal at Folder". Type this command and press Enter:

java -Xmx1024M -Xms1024M -jar server.jar nogui

The server will start, create several new files in that folder, and then stop with an error message about the EULA. This is normal — it means the software ran. You have to accept the End User License Agreement before it will run again.

In the same folder, you will now see a file called eula.txt. Open it with Notepad (Windows) or TextEdit (Mac), find the line that says "eula=false", change it to "eula=true", and save the file. Then run the same command again. This time the server will start fully, create a world, and stay running.

Connect from your home network

Once the server is running, other people on your home WiFi can join it. They open Minecraft Java Edition, click "Multiplayer", then "Add Server". For the server address, they enter your computer's internal IP address. To find this on Windows, open Command Prompt and type "ipconfig" — look for the line labeled "IPv4 Address" under your WiFi adapter, which usually starts with 192.168. On Mac, go to System Settings, click Network, select your WiFi connection, and look for "IP Address".

Your friend enters that IP address (for example, 192.168.1.45) into the server address field in Minecraft, clicks Done, and then clicks the server to join. If it does not work, make sure both computers are on the same WiFi network and that the server command window is still open on your computer.

Allow players outside your home to join

If you want friends outside your home network to play on your server, you need to forward a port on your router. A port is like a door that lets traffic from the internet reach your computer. Minecraft uses port 25565 by default.

Log into your router's settings page — usually by typing 192.168.1.1 or 192.168.0.1 into a web browser, or by opening the router's app on your phone. You will need your router's admin password, which is often on a sticker on the router itself. Look for a section called "Port Forwarding", "Virtual Server", or "UPnP". You want to forward port 25565 (TCP and UDP) to your computer's internal IP address.

Once port forwarding is set up, people outside your home can join using your public IP address. Find your public IP by searching "what is my IP" in Google. Give this address to your friends — they add it as a server in Minecraft the same way they would add a local address. Your public IP can change if your internet provider reassigns it, so check it occasionally and let your friends know if it changes.

Change basic server settings

The server creates a file called server.properties in the same folder as server.jar. Open it with Notepad or TextEdit to change how the server works. The most common changes are:

  • motd — the message that appears when players see your server in the list. Change it to something like "My World" or "Friends Only".
  • difficulty — set to 0 (peaceful), 1 (straightforward), 2 (normal), or 3 (hard).
  • gamemode — set to 0 (survival), 1 (creative), 2 (adventure), or 3 (spectator).
  • pvp — set to true if players can damage each other, false if they cannot.
  • allow-flight — set to true if you want to allow flight in survival mode.

After you change any setting, save the file and restart the server. Stop it by typing "stop" in the command window and pressing Enter. Wait for it to shut down completely, then run the java command again to start it back up.

Keep the server running and manage players

The server runs inside the command window — as long as that window is open, the server is on. If you close it, the server stops and all players are kicked out when ready. If your computer goes to sleep or loses power, the same thing happens. To keep the server running reliably, disable sleep mode on your computer while the server is active.

You can type commands into the server window to manage the world. Type "list" to see who is online. Type "save-all" to save the world manually. Type "stop" to shut down the server gracefully — this saves the world and gives players a few seconds to see the disconnect message instead of being kicked abruptly.

If the server crashes or stops responding, close the command window and run the java command again. Your world is saved in a folder called "world" inside the server folder, so restarting does not erase anything.

Troubleshooting common problems

If the server will not start and you see an error about Java, you need to install Java Runtime Environment. Go to java.com, read the installer for your operating system, and run it. Then try the server command again.

If friends on your home network cannot see or join the server, make sure you are giving them the correct internal IP address — type "ipconfig" (Windows) or check System Settings (Mac) again to confirm. If they can see it but cannot join, the server may have crashed — check the command window for error messages and restart it.

If friends outside your home cannot join, port forwarding is usually the issue. Log back into your router and verify that port 25565 is forwarded to the correct internal IP address. Some routers require you to restart after changing port forwarding settings. If your public IP has changed, your friends will need the new address.

If the server is very slow or players are getting lag, your computer may not have enough memory allocated to it. In the java command, change "1024M" to "2048M" or higher if your computer has enough RAM. Restart the server to explore the change.

Frequently Asked Questions

Can I run a server on a laptop and close it when I am not playing?

Yes. The server only needs to run when people are actually playing. Close the command window to stop it, and run the java command again whenever you want to open it. Your world is saved, so you pick up where you left off.

What is the difference between running my own server and renting one?

Running your own server is free but requires your computer to stay on and connected. A rented server from a hosting company stays on all the time without you doing anything, but costs money per month. Rented servers are better if you want the server to run 24/7 or if your home internet is unreliable.

Do I need to use the nogui command, or can I run the server with a graphical interface?

The nogui command runs the server in command-line mode, which uses less memory. You can remove "nogui" from the command to get a graphical window instead, but it is not necessary and will slow things down slightly. The command window works fine for managing the server.

What happens if someone griefs my world or breaks things I do not want them to break?

Change "allow-breaking-blocks" or similar settings in server.properties, or use a plugin system like Bukkit or Spigot if you want more control. For a straightforward server, you can also set the gamemode to creative and tell players they cannot break blocks, or use the "adventure" gamemode which prevents block breaking by default.

Can I back up my world so I do not lose it if something goes wrong?

Yes. The world folder inside your server folder contains everything — copy it to another location on your computer or an external drive to create a backup. You can restore it later by replacing the world folder with your backup copy.