To host a Minecraft server on your PC, install Java 25, download Mojang’s free server file, run it once, accept the EULA and start it again. The hard part comes after: letting friends outside your home connect. You forward a port on your router, or you use a tunnel service when forwarding is not possible. This guide covers Java Edition 26.3, the current release as of October 2026, on Windows, macOS and Linux.
Hosting a Minecraft server on your PC: what you gain and give up
| You gain | You give up |
|---|---|
| No cost beyond electricity | The server is online only while your PC is on and awake |
| Every file is on your own disk | The server shares memory and processor time with your own game |
| No renewal timer and no host’s rules | The network setup is yours to do and to fix |
| As much RAM as your PC can spare | With port forwarding, players learn your home IP address |
What you need
- A 64-bit computer running Windows, macOS or Linux.
- Java 25. Minecraft 26.1, 26.2 and 26.3 all require it, according to Mojang’s own version data. Older releases need older Java: 1.20.5 to 1.21.11 use Java 21 (full table).
- Spare memory. Mojang’s example command gives the server 4 GB. See how much RAM a Minecraft server needs.
- A Minecraft: Java Edition account for each player. Bedrock players need extra software: see Java and Bedrock crossplay.
- Your router’s admin login, if you plan to forward a port.
Step 1: install Java 25
Any OpenJDK 25 build runs the server. This guide uses Amazon Corretto, which is free and is the build Paper’s install guide walks through. The Corretto 25 downloads page has an installer for each system.
- Windows: the Windows x64
.msifile. Open it and click through. - macOS: a
.pkgfile. Pickaarch64for a Mac with Apple silicon andx64for an Intel Mac. - Linux: the
.debfile (Debian, Ubuntu) or the.rpmfile (Fedora). Paper’s Java install guide lists the repository commands.
Then open a new terminal (Command Prompt on Windows) and check:
java -version
The first line should show version 25.
Step 2: download the official server file
- Make an empty folder for the server, for example
minecraft-serverin your home folder. The server writes all its files into the folder it runs from. - Download the server from Mojang’s server download page. It is free. Do not get it from any other site.
- Move the file into your folder. Mojang’s example command uses a file name with the version number in it, but the download is saved as
server.jar. If yours has another name, rename it toserver.jarso the commands below match.
Want plugins? Download Paper instead and rename its file to server.jar: the steps are the same. See Paper vs Spigot vs Purpur.
Step 3: write a start script
Windows. Open Notepad, paste the two lines below and save the file in the server folder as start.bat. In the save window, set the file type to All files so it does not become start.bat.txt.
java -Xmx4G -Xms4G -jar server.jar nogui
pause
macOS and Linux. Save this in the server folder as start.sh, as plain text. In TextEdit on a Mac, choose Format, then Make Plain Text, before you save.
#!/bin/sh
cd "$(dirname "$0")"
java -Xmx4G -Xms4G -jar server.jar nogui
Then make it executable. Change the path if your folder is somewhere else.
cd ~/minecraft-server
chmod +x start.sh
-Xmx and -Xms set the server’s memory. 4G is the value in Mojang’s example. On a PC with 8 GB in total, use 2G so the system and your game keep some. Leave out nogui if you want the server’s own window. The start script generator writes this file for your memory size and server software.
Step 4: run it once and accept the EULA
- Start the server. On Windows, double-click
start.bat. On macOS and Linux, run./start.shin the terminal. - The first run creates
eula.txtandserver.properties, then stops. - Open
eula.txtin a text editor, read the Minecraft EULA it links to, changeeula=falsetoeula=trueand save. - Start the server again. It generates a world, then the console reports that it is done.
- If Windows asks whether Java may use the network, allow it. Otherwise no other device can connect.
Now add yourself. Type these in the server console, with no slash and with your own player name:
whitelist add YourName
op YourName
To shut down, type stop in the console. It saves the world first. Do not just close the window.
How friends join a server hosted on your PC
On the same PC or the same network
On the PC that runs the server, add a server in Minecraft’s Multiplayer screen with the address localhost. Other devices on your home network use the PC’s local IP address. No port forwarding is needed.
- Windows: run
ipconfigand read the IPv4 address under your Wi-Fi or Ethernet adapter. - macOS: open the network settings and read the IP address of your connection.
- Linux: run
ip addr.
The address looks like 192.168.1.50. Friends type it as the server address, with no port: 25565 is the default. See how to join a Minecraft server.
Over the internet with port forwarding
Port forwarding tells your router to pass incoming Minecraft connections to your PC. Menu names differ on every router, so check your model’s manual.
- In your router’s admin page, reserve the PC’s local IP address so it does not change. Routers call this a DHCP reservation or a static lease.
- Find the port forwarding page and add a rule: external port
25565, internal port25565, protocol TCP, destination your PC’s local IP address. Some routers only offer “TCP/UDP” or “Both”, which also works. - Find your public IP address by searching for “what is my IP”. Friends type that as the server address. Many home connections get a new one from time to time, so check it again when friends suddenly cannot connect.
- Test from outside your home, for example with the server status checker or a phone on mobile data. A test from inside your own network can fail on some routers even when the rule is correct.
Why port forwarding fails behind carrier-grade NAT
Some internet providers put many customers behind one shared public IP address. This is carrier-grade NAT, or CGNAT. Your router then has no public address of its own, so a forwarding rule on it does nothing: the provider’s equipment sits in front, and you cannot configure that.
To check, find the WAN or internet IP address on your router’s status page. You are behind CGNAT, or behind a second router, if that address:
- starts with
100.64through100.127(the block100.64.0.0/10, which RFC 6598 reserves for this), or - differs from the address a “what is my IP” site shows you.
Your options: ask your provider for a public IPv4 address (some charge for it), use a tunnel, or use a host.
Without port forwarding: a tunnel service
A tunnel connects outward from your PC, so the router needs no rule. There are two kinds. The services named are examples, not recommendations.
- A relay. You run a small program next to your server, and players connect through the service’s network. playit.gg works this way. Its site says no port forwarding is required and that you do not share your home IP. As of October 2026 it lists Minecraft Java and Bedrock on its free tier, with a paid tier at $3 a month. The trade-off: all traffic passes through the company’s servers, which can add ping.
- A private network. You and your friends install the same VPN app. Tailscale is one example: its sharing docs describe sharing one machine with another person’s account without putting it on the public internet. As of October 2026 its free Personal plan allows up to 6 users. The trade-off: every player needs the app and an account.
Security basics
- Keep
online-mode=true, the default. The server then checks every player against Minecraft’s account database. - Keep the whitelist on and add only people you know.
- Forward one port only. Never put the PC in your router’s DMZ, and leave RCON off, as it is by default.
- Run the server from a normal user account, not as administrator or root.
- Download plugins and mods from their official pages. They run with the same access to your PC as you have.
- Back up the world. Stop the server and copy the
worldfolder somewhere else.
If it does not work
- The server stops right after starting.
eula.txtstill sayseula=false, or Java is older than 25. More causes: Minecraft server won’t start. - A friend cannot connect. If the game says they are not whitelisted, run
whitelist addwith their exact name. If it times out, check the firewall, the forwarding rule, your public IP and CGNAT, in that order. More causes: can’t connect to a Minecraft server.
When a free host is the easier choice
Hosting on your PC makes sense when the PC can stay on, your connection can forward a port and everyone who has the address is a friend. If one of those is missing, a hosted server is less work: it has its own address, so there is no router to configure and nobody learns your home IP.
On Severoo, a free server gets up to 6 GB of RAM and up to 20 GB of NVMe SSD storage with no credit card. It stays online 24/7 as long as you renew it and does not sleep when it is empty. The catch is the renewal. Renewing is one click, paid for with account credits that are free to collect. It is due on a schedule that depends on your plan (every few hours on some plans). You collect credits by claiming them daily, using the site and running your server, and completing small tasks. Credits cannot be bought, and collecting them this way is enough to keep one server online all the time, as long as you renew it on schedule. A server that is not renewed is suspended first, and if it is not re-enabled within 7 days it is removed permanently. Your own PC has no such timer. See what free Minecraft server hosting includes. A world you built at home can move with you: upload the world to the server.