What you need to do first
To run a Minecraft server on your PC, you download server software from Mojang, the company that makes Minecraft, run it on your computer, and then connect to it from the Minecraft game client. Your PC becomes the host — it stays on and running whenever you or others want to play together. This is different from joining someone else's world; you control who can join, what rules apply, and when the server runs.
Before you start, check that your PC meets the basic requirements. You need at least 2GB of RAM available for the server software itself, plus whatever your operating system needs. The server software works on Windows, Mac, and Linux. You also need a stable internet connection, because players connect to your PC over the network.
Key Takeaways
- Download the server.jar file directly from minecraft.net/download/server, not from third-party sites, to avoid malware.
- You must have Java installed on your PC; the server software will not run without it, and you can download it free from oracle.com.
- Run the server software once, let it create the necessary files, then edit the eula.txt file to accept the terms before starting again.
- Your friends connect by typing your PC's local IP address (for the same network) or your public IP address (for remote players), followed by the port number.
- Keep your PC on and the server software running whenever you want players to be able to join; closing the program shuts down the server.
Download Java and the server software
The Minecraft server software is written in Java, so your PC must have Java installed first. Go to oracle.com/java/technologies/downloads, download the latest Java Development Kit (JDK) for your operating system, and run the installer. Accept the default installation location. On Windows, this usually puts Java in C:\Program Files\Java. On Mac and Linux, the installer handles the path automatically.
Once Java is installed, go to minecraft.net/download/server. You will see a button labeled "Download minecraft_server.jar". Click it and save the file to a folder you can find easily — your Desktop or a new folder called "Minecraft Server" works well. Do not download the server software from any other website; only use the official Mojang link to avoid malware or outdated versions.
Create the server folder and run the software for the first time
Create a new folder on your PC where all the server files will live. On Windows, right-click on your Desktop, select New > Folder, and name it "Minecraft Server". On Mac, open Finder, go to Desktop, and press Command+Shift+N to create a new folder. Move the minecraft_server.jar file into this folder.
Open a command prompt or terminal window and navigate to your server folder. On Windows, hold Shift and right-click inside the folder, then select "Open PowerShell window here". On Mac or Linux, open Terminal, then type cd followed by the path to your folder — for example, cd ~/Desktop/Minecraft\ Server. Type the command java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui and press Enter. This starts the server with 1GB of RAM allocated to it. If your PC has more RAM and you want more players, you can change 1024M to 2048M or higher.
The server will run for a few seconds, create several new files in your folder, then stop. This is normal. You will see a message saying the EULA (End User License Agreement) has not been accepted.
Accept the EULA and configure basic settings
Look in your server folder for a file called eula.txt. Open it with Notepad (Windows) or TextEdit (Mac). You will see a line that says eula=false. Change it to eula=true and save the file. This tells Minecraft you have read and accepted the license agreement.
While you are in the folder, you will also see a file called server.properties. Open this file in Notepad or TextEdit. This is where you set basic rules for your server. The most useful settings are: motd (the message players see when they join), max-players (how many people can play at once), difficulty (set to 0 for peaceful, 1 for easy, 2 for normal, 3 for hard), and pvp (set to true to allow player-versus-player combat, false to turn it off). Make your changes, save the file, and close it.
Start the server and connect to it
Run the same command again: java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui. This time the server will start fully and stay running. You will see messages in the command window showing players joining and leaving, and other server activity. Leave this window open — closing it shuts down the server.
To join your own server from the same PC, open Minecraft, click Multiplayer, then Add Server. For the Server Address, type localhost and leave the port as 25565 (the default). Click Done, then click the server to join.
If you want friends on the same home network to join, they need your PC's local IP address. On Windows, open Command Prompt and type ipconfig. Look for "IPv4 Address" — it usually starts with 192.168 or 10.0. On Mac or Linux, open Terminal and type ifconfig. Look for "inet" under your active network connection. Your friends add a server with the address your-local-ip:25565 — for example, 192.168.1.50:25565.
Allow remote players to connect from outside your network
If you want friends outside your home network to join, you need to set up port forwarding on your router. This tells your router to send incoming connections on port 25565 to your PC. Log into your router's admin panel — usually by typing 192.168.1.1 or 192.168.0.1 into a web browser. The username and password are often printed on the router itself or in the manual. Look for a section called Port Forwarding, Virtual Server, or Port Mapping.
Create a new rule that forwards port 25565 (TCP and UDP) to your PC's local IP address. Save the rule and restart your router if prompted. Then find your public IP address by searching "what is my IP" in a web browser. Your remote friends add a server with the address your-public-ip:25565. Your public IP can change if your internet provider assigns you a new one, so check it occasionally and let your friends know if it changes.
Keep the server running and manage it
The server only runs when the command window is open on your PC. If you close the window or shut down your computer, the server stops and players cannot join. If you want the server to run all the time, you have two options: leave your PC on continuously, or use a hosting service that runs the server on their computers instead of yours.
While the server is running, you can type commands in the command window to manage it. Type stop and press Enter to shut down the server gracefully — this saves all player data before closing. Type say followed by a message to broadcast text to all players in the game. Type op username to give a player operator status, which lets them use admin commands in the game.
Frequently Asked Questions
Do I need to pay for server software?
No. The server software from minecraft.net is free. You only pay if you want to use a third-party hosting company to run the server on their hardware instead of your own PC. Hosting services charge monthly fees but handle keeping the server running 24/7 without your PC needing to be on.
What if my friends get "Connection refused" or "Connection timed out"?
For local network players, check that you gave them the correct local IP address and that your PC's firewall is not blocking port 25565. On Windows, go to Windows Defender Firewall > Allow an app through firewall and make sure Java is listed. For remote players, verify port forwarding is set up correctly on your router and that you gave them your public IP address, not your local one.
Can I use mods on my server?
The official server software does not support mods. To run mods, you need to use a mod loader like Forge or Fabric, download a modded server version, and follow that mod loader's installation steps. This is more complex than the basic server setup and requires more PC resources.
How much RAM should I give the server?
Start with 1GB (1024M) for a few players. Add 512MB (512M) for every 5 to 10 additional players your server supports. If your PC has 16GB of RAM total, you can safely give the server 4GB to 6GB. Do not give it all your PC's RAM, or your operating system will slow down.
What happens if I restart my PC?
The server stops running, and players are disconnected. When you restart your PC and run the server command again, the server starts fresh. All player data, buildings, and progress are saved and will be there when players rejoin.