What you need to set up a Minecraft server

A Minecraft server runs on your computer and lets other players join your world over the internet or local network. You need three things: a computer that stays on while people play, the server software (which is free from Minecraft), and enough internet bandwidth so multiple players don't lag. Most home internet connections work fine for 2 to 10 players, but performance drops if you try to host 20+ people simultaneously.

Your computer doesn't need to be powerful, but it should have at least 2 gigabytes of RAM available for the server software alone, plus whatever your operating system needs. If you're playing on the same computer while running the server, you'll need 4 to 6 gigabytes total. A dedicated machine — an old laptop or desktop you leave running — works better than your main gaming computer because the server will use CPU and memory constantly.

You'll also need Java installed on your computer. Minecraft's server software runs on Java, and you can read it free from java.com. Windows, Mac, and Linux all support Java and the Minecraft server software equally well.

Key Takeaways

  • read the server software directly from minecraft.net/read/server, which is free and official.
  • The server runs as a Java program on your computer, so you need Java installed and at least 2 gigabytes of RAM available.
  • You control who joins by sharing your IP address with friends, or by using a service like Ngrok to create a tunnel if your internet provider blocks direct connections.
  • The server creates a world folder on your computer where all player data and the map are stored — back this up regularly if you care about the world.
  • Port forwarding on your router is optional; without it, only people on your home network can join, but with it, friends anywhere can play.

Downloading and starting the server software

Go to minecraft.net/read/server and read the server.jar file. This is the official Minecraft server software and it's free. Save it to a folder on your computer where you want to keep all the server files — create a new folder called "Minecraft Server" to keep things organized.

Open the folder where you saved server.jar. On Windows, right-click in the empty space and select "Open in Terminal" or "Open PowerShell here". On Mac or Linux, open Terminal and navigate to that folder using the cd command. Then type this command and press Enter:

java -Xmx1024M -Xms1024M -jar server.jar nogui

The server will start and create several new files in that folder, including a world folder and a file called server.properties. The first time you run it, the server will stop and ask you to agree to the End User License Agreement. Open eula.txt in that folder, change eula=false to eula=true, save it, and run the command again. The server is now running and ready for players to join.

Connecting players on your home network

If everyone playing is on the same WiFi or ethernet network as your server computer, they don't need your internet IP address — they need your local network IP. On Windows, open Command Prompt and type ipconfig, then look for "IPv4 Address" under your network adapter. On Mac or Linux, open Terminal and type ifconfig, then look for the inet address. It usually starts with 192.168 or 10.0.

Tell your friends to open Minecraft, click "Multiplayer", then "Add Server". For the server address, they enter your local IP address followed by :25565 (the default port). For example: 192.168.1.50:25565. They can now join your world.

This method only works if everyone is on the same network. If you want friends outside your home to join, you need to set up port forwarding or use a tunneling service.

Opening your server to the internet with port forwarding

Port forwarding tells your router to send Minecraft traffic from the internet to your server computer. Log into your router's settings — usually by typing 192.168.1.1 or 192.168.0.1 into a web browser. The login details are often on a sticker on the router itself, or in your router's manual.

Look for a section called "Port Forwarding" or "Virtual Server". You'll forward port 25565 (Minecraft's default) to your server computer's local IP address on port 25565. The exact steps vary by router, but most routers have a help section that walks you through it. If you're not comfortable changing router settings, skip this step and use Ngrok instead.

Once port forwarding is set up, find your public IP address by searching "what is my IP" in a web browser. Give this IP address to your friends — they add it as a server in Minecraft the same way as the local address. Your public IP may change if your internet provider assigns you a new one, so check it occasionally or use a dynamic DNS service to keep it stable.

Using Ngrok to tunnel without port forwarding

Ngrok is a free tunneling service that creates a find connection to your server without touching your router. Go to ngrok.com, create a free account, and read the Ngrok process. Extract it to your server folder.

Open Terminal or Command Prompt in your server folder and run this command:

ngrok tcp 25565

Ngrok will display a forwarding address that looks like tcp://0.tcp.ngrok.io:12345. The part before the colon is the address your friends use, and the number after is the port. They add it to Minecraft as a server address: 0.tcp.ngrok.io:12345. Every time you restart Ngrok, you get a new address, so you'll need to tell your friends the new one each session. This is simpler than port forwarding if you only play occasionally.

Managing the server and player data

While the server is running, you can type commands directly into the Terminal or Command Prompt window. Type /stop to shut down the server cleanly — never close the window without stopping first, or you risk corrupting the world. Type /save-all to save the world when ready. Type /say followed by a message to broadcast text to all players.

The server.properties file controls game rules. Open it in any text editor to change the difficulty, enable PvP, set the world spawn point, or change the maximum number of players. Changes take effect after you restart the server. Common settings include difficulty=3 for hard mode, pvp=false to disable player combat, and max-players=10 to limit how many people can join at once.

Back up your world folder regularly. The world folder contains all the maps and player data — if something goes wrong, a backup is your only way to recover it. Copy the world folder to an external drive or cloud storage every week or after major building projects.

Troubleshooting common problems

If players can't connect, first check that the server is actually running — you should see "Done" and a message about how long it took to start in your Terminal window. If the server crashed, the Terminal will show an error message. The most common error is "Could not reserve enough space for object heap", which means you don't have enough RAM. Lower the 1024M numbers in the startup command to 512M and try again.

If local network players can't connect, make sure they're using your local IP address, not your public IP. If internet players can't connect, test port forwarding by going to canyouseeme.org and entering port 25565 — it should say the port is open. If it says closed, port forwarding isn't working. Check your router settings or switch to Ngrok.

If the server is slow or players are lagging, reduce the view-distance setting in server.properties from 10 to 8 or lower. This makes the server render less terrain at once and frees up CPU. You can also reduce the number of players allowed to join, or move the server to a dedicated computer.

Frequently Asked Questions

Do I need to keep my computer on all the time for people to play?

Yes. The server only runs while your computer is on. If you want a server that stays up 24/7, you'd need to rent a server from a hosting company like Aternos or Nitrado, which costs money but handles everything for you. For casual play with friends, keeping your computer on during play sessions is normal.

Can I play on my own server while other people are playing?

Yes, but it will use more of your computer's resources. If you're playing and hosting at the same time, increase the RAM in the startup command to 2048M or higher. If the game feels laggy, you're probably running out of memory.

What happens if my internet goes down?

Everyone gets disconnected when ready. When your internet comes back, players can rejoin. The world is saved, so no progress is lost — they just have to log back in.

Can I use a Minecraft Realms world as a server instead?

Realms is a different product that Minecraft hosts for you in the cloud. It costs money per month but requires no setup and stays online automatically. A local server is free but requires your computer to stay on. Both work, but they're different tools for different situations.

How many players can join before the server gets too slow?

Most home internet and computers handle 5 to 10 players smoothly. Beyond that, lag increases noticeably. If you want to host 20+ players, you need either a dedicated server computer with more RAM, faster internet, or a paid hosting service.