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 have three main routes: rent server space from a hosting company, run the server software on a computer you own, or use Minecraft Realms, which Microsoft runs for you. This guide covers the second option — installing and running the server software yourself on Windows, Mac, or Linux.

Before you begin, you need a computer that can stay powered on continuously (or at least when you want players online), a stable internet connection, at least 1 GB of free storage space, and Java installed on that computer. You also need to know your computer's public IP address, which you can find by searching "what is my IP" in any browser. If your internet service provider assigns you a new IP address periodically, you may need to use a dynamic DNS service so players can always find your server.

Check your internet plan's terms first — some residential plans prohibit running servers, and some have upload speed limits that make multiplayer laggy. If your plan allows it and your upload speed is at least 5 Mbps, you can proceed.

Key Takeaways

  • Download the server software from minecraft.net, install Java if you do not have it, and run the server file to generate your world folder and configuration files.
  • Edit the server.properties file to set your world name, difficulty, and player limit before starting the server for real.
  • Forward port 25565 on your router to your computer's local IP address so players outside your home network can connect.
  • Give players your public IP address and port number to join, or use a dynamic DNS service if your IP changes regularly.
  • Running a server uses electricity and internet bandwidth continuously, so factor in the cost and whether a hosting company might be cheaper for your situation.

Download and install the server software

Go to minecraft.net/download/server and download the server.jar file. This is the actual server program. Save it in a new folder on your computer — create a folder called "Minecraft Server" on your desktop or in your Documents folder, and put server.jar inside it.

Before you can run the server, you need Java installed. Open a terminal or command prompt on your computer and type java -version. If Java is installed, you will see a version number. If not, download the latest Java Runtime Environment from oracle.com/java/technologies/downloads. Install it and run the version check again to confirm.

Once Java is installed, open a terminal or command prompt, navigate to your Minecraft Server folder, and type java -Xmx1024M -Xms1024M -jar server.jar nogui. This starts the server with 1 GB of memory. The server will run, create a world folder, and then stop with a message saying you need to accept the EULA. This is normal.

Accept the EULA and configure your server

The server created a file called eula.txt in your Minecraft Server folder. Open it in any text editor (Notepad on Windows, TextEdit on Mac). Change the line that says eula=false to eula=true and save the file. This confirms you accept Minecraft's End User License Agreement.

Now open the server.properties file, also in your Minecraft Server folder. This file controls how your server works. The most important settings are motd (the message players see when they join), difficulty (0 for peaceful, 1 for easy, 2 for normal, 3 for hard), max-players (how many people can join at once), and gamemode (0 for survival, 1 for creative, 2 for adventure, 3 for spectator). Edit these to match what you want, save the file, and close it.

If you want to use a specific world you already created in single-player Minecraft, copy that world's folder into your Minecraft Server folder and change the line level-name=world to match your world's folder name. Otherwise, the server will create a new world called "world" when you start it.

Start the server and test it locally

Open a terminal or command prompt in your Minecraft Server folder again and run java -Xmx1024M -Xms1024M -jar server.jar nogui. The server will start and print messages to the terminal. Wait until you see "Done! For help, type 'help'" — this means the server is running and ready for players.

Open Minecraft on the same computer, go to Multiplayer, and click Add Server. Type "localhost" as the server address and give it any name you want. Click Done and try to join. If you can connect and see your world, the server software is working correctly.

If you cannot connect, check that the server is still running in the terminal (you should see new messages as you play). If the server crashed, the terminal will show an error message — common ones are "out of memory" (increase the 1024M numbers to 2048M or higher) or "port already in use" (another program is using port 25565, or you already have a server running).

Set up port forwarding so remote players can join

Players outside your home network cannot reach your server until you forward port 25565 on your router. Log into your router's admin panel — usually by typing 192.168.1.1 or 192.168.0.1 into a browser, or by using your router's app. You will need your router's admin password, which is often on a sticker on the router itself.

Find the Port Forwarding section (names vary by router — it might be called "Port Mapping" or "Virtual Server"). Create a new rule that forwards external port 25565 to your computer's local IP address on port 25565. Your local IP address is different from your public IP — find it by opening a terminal and typing ipconfig (Windows) or ifconfig (Mac/Linux). Look for an address that starts with 192.168 or 10.

Save the port forwarding rule and restart your router. Wait a few minutes, then test by having a friend join using your public IP address (the one you found earlier) as the server address. If they can connect, port forwarding is working.

Share your server address and manage players

Give players your public IP address and port number in the format 123.45.67.89:25565 (replace with your actual IP). They add this as a server in their Multiplayer menu and join like any other server.

If your internet service provider changes your public IP address periodically, you will need to tell players the new address each time. To avoid this, use a dynamic DNS service like No-IP or DynDNS. These services give you a permanent domain name (like yourname.ddns.net) that automatically points to your current IP address. Set up the service on their website, then download their client software and run it on the computer hosting your server. Players can then use your domain name instead of your IP address.

While the server is running, you can type commands in the terminal to manage it. Type say [message] to broadcast a message to all players, stop to shut down the server gracefully, or op [playername] to give a player admin permissions. Type help to see all available commands.

Understand the ongoing costs and maintenance

Running a server on your own computer uses electricity continuously, which adds to your power bill. A typical gaming computer uses 100 to 300 watts, so running it 24/7 for a month costs between $3 and $20 depending on your local electricity rates. Your internet bandwidth also counts — a server with four active players uses roughly 1 to 2 Mbps upload, which is usually within a residential plan's limits but worth checking with your provider.

You are also responsible for keeping the server running. If your computer crashes, loses power, or needs updates, the server goes offline and players cannot join. A hosting company handles this for you, which is why many people find it simpler to rent server space even though it costs money each month.

Periodically, Minecraft releases updates that add new features and fix bugs. To update your server, stop it, download the new server.jar file from minecraft.net, replace the old one, and start the server again. Your world and player data stay intact.

Frequently Asked Questions

Can I run a server on a laptop or Mac?

Yes, but laptops are not ideal because they overheat if left on constantly and drain battery power. A Mac works fine if you leave it plugged in and do not put it to sleep. For the best experience, use a desktop computer or a dedicated machine you can leave on all the time.

What if I want to use mods or plugins?

The vanilla server.jar does not support mods or plugins. To use them, you need to download a different server software like Spigot, Paper, or Fabric. These are drop-in replacements for server.jar and work the same way — download, run once to generate files, edit configuration, and start. Each has its own plugin or mod ecosystem, so research which one supports the mods you want before switching.

How many players can my server handle?

The max-players setting in server.properties controls how many can join at once, but your computer's actual limit depends on its processor and memory. Most home computers can handle 4 to 10 players smoothly. More than that usually causes lag unless you have a very powerful machine. Start with max-players set to 5 or 10 and increase it only if your computer stays responsive.

What if my router does not have a port forwarding option?

Some older or very basic routers lack port forwarding. Check your router's manual or contact your internet provider's support. If port forwarding truly is not available, you can use a service like Ngrok to tunnel traffic to your server, though this adds latency and is slower than direct port forwarding.

Can I run a server and play on it at the same time?

Yes, you can run the server and join it from the same computer using "localhost" as the address. However, this uses your computer's resources for both the server and the game client, which can cause lag. For the smoothest experience, run the server on one computer and play on another.