Desert Forge IT — Game Hosting from $2/weekGet a Server →

How to Host a Minecraft Server on Windows

Beginner 20 min — Run your own Minecraft Java Edition server on Windows 10 or 11 so you and your friends can play together.

What You Need

Before you start, make sure you have the following:

  • Windows 10 or 11 — either Home or Pro edition works fine
  • Java 21 — we'll install this in the next step
  • At least 4 GB of free RAM — the server itself will use about 2 GB, and Windows needs the rest. 8 GB total system RAM is a comfortable minimum.
  • A stable internet connection — if you want friends outside your home network to join
  • Minecraft Java Edition — to actually connect and play (Bedrock Edition cannot connect to Java servers)

You do not need any Linux knowledge. Everything in this guide happens on Windows using tools you can click on or type into Command Prompt.

1. Install Java 21

Minecraft servers need Java to run. We'll install Adoptium Temurin 21, which is a free, reliable version of Java used by most server hosts.

  1. Go to adoptium.net
  2. Click the big "Latest LTS Release" download button. It should automatically detect Windows and offer you an .msi installer.
  3. Run the downloaded .msi file. During installation, make sure the option "Add to PATH" is enabled (it should be by default). This lets you run Java from Command Prompt.
  4. Click through the installer and let it finish.

To verify it installed correctly, open Command Prompt (press Win + R, type cmd, press Enter) and run:

java -version

You should see output that includes openjdk version "21 followed by a version number. If you see 'java' is not recognized, restart your computer and try again — the PATH change sometimes needs a reboot to take effect.

2. Download the Server

We'll use Paper instead of the vanilla Minecraft server. Paper is a drop-in replacement that runs significantly faster, uses less RAM, and supports plugins if you ever want them. Your players won't notice any difference — it's the same Minecraft.

  1. Go to papermc.io/downloads/paper
  2. Download the latest build for the current Minecraft version. The file will be named something like paper-1.21.4-123.jar.
  3. Create a new folder for your server. A simple path works best — for example:
    C:\MinecraftServer
  4. Move the downloaded .jar file into that folder.
  5. Rename it to paper.jar to keep commands simple.

Your folder should now contain one file: C:\MinecraftServer\paper.jar

3. First Run

The first time you start the server, it will create its configuration files and then stop immediately. This is normal — it needs you to accept the Minecraft EULA first.

Open Command Prompt and navigate to your server folder:

cd C:\MinecraftServer

Now start the server:

java -Xmx2G -Xms2G -jar paper.jar

Here's what the flags mean:

  • -Xmx2G — maximum RAM the server can use (2 gigabytes)
  • -Xms2G — starting RAM allocation (2 gigabytes)
  • -jar paper.jar — tells Java to run the Paper server file

The server will generate some files, print a message about the EULA, and stop. You'll see something like: You need to agree to the EULA in order to run the server.

Open the file eula.txt that appeared in your server folder. You can double-click it to open in Notepad. Change this line:

eula=false

To:

eula=true

Save and close the file.

4. Configure Your Server

After the first run, a file called server.properties appeared in your server folder. Open it with Notepad to customize your server. Here are the most important settings:

# The port players connect on (default is fine for most people)
server-port=25565

# The message shown in the server list
motd=My Minecraft Server

# Maximum number of players at once
max-players=10

# Game difficulty: peaceful, easy, normal, hard
difficulty=normal

# Default game mode: survival, creative, adventure, spectator
gamemode=survival

# Only allow players you've approved (true/false)
white-list=false

# Verifies players own Minecraft (KEEP THIS true)
online-mode=true

A few tips:

  • Keep online-mode=true unless you have a specific reason to change it. This verifies that players actually own Minecraft and prevents unauthorized access.
  • white-list is great if you only want specific friends to join. After enabling it, you can add players in the server console with whitelist add PlayerName.
  • You can change any of these settings later. Just edit the file, save it, and restart the server.

5. Start the Server

Go back to Command Prompt (make sure you're still in C:\MinecraftServer) and run the same command again:

java -Xmx2G -Xms2G -jar paper.jar

This time the server will fully start. You'll see it loading chunks and preparing the world. When you see a line like:

[Server thread/INFO]: Done (12.345s)! For help, type "help"

Your server is running. This Command Prompt window is now the server console — you can type commands here like op YourName to give yourself operator privileges.

To make starting easier, let's create a batch file. Open Notepad, paste the following, and save it as start.bat in your server folder:

@echo off
title Minecraft Server
java -Xmx2G -Xms2G -jar paper.jar
pause

Now you can double-click start.bat to start your server instead of typing the command every time. The pause at the end keeps the window open if the server crashes, so you can read the error message.

6. Connect Locally

With the server running, open Minecraft Java Edition:

  1. Click Multiplayer
  2. Click Direct Connection
  3. Type localhost in the Server Address box
  4. Click Join Server

You should connect immediately and spawn into your new world. If it works, congratulations — your server is running!

Anyone on the same Wi-Fi or home network can also connect by using your computer's local IP address instead of localhost. To find your local IP, open Command Prompt and type:

ipconfig

Look for the IPv4 Address under your active network adapter (usually Wi-Fi or Ethernet). It will look something like 192.168.1.50. Other people on your home network can use that address to connect.

7. Port Forwarding (for Friends Outside Your Network)

If you want friends who aren't on your home Wi-Fi to join, you need to open a port on your router so traffic from the internet can reach your server. This is called port forwarding.

  1. Find your local IP address — open Command Prompt and run ipconfig. Note the IPv4 Address (e.g. 192.168.1.50) and the Default Gateway (e.g. 192.168.1.1).
  2. Log into your router — open a web browser and go to the Default Gateway address (usually 192.168.1.1 or 192.168.0.1). You'll need your router's admin password. This is often printed on a sticker on the router itself, or it may be the default admin/admin or admin/password.
  3. Find the Port Forwarding section — this is in different places depending on your router brand. Look under Advanced, NAT, Firewall, or Port Forwarding. If you can't find it, search your router's model number + "port forwarding" online.
  4. Create a new rule with these settings:
    • Name: Minecraft (or anything you want)
    • Protocol: TCP
    • External Port: 25565
    • Internal Port: 25565
    • Internal IP: Your computer's IPv4 address (e.g. 192.168.1.50)
  5. Save the rule.

Now find your public IP address by visiting whatismyip.com. Share this IP with your friends — they enter it in the Minecraft Server Address box to connect.

Important: Your public IP may change if your ISP uses dynamic addresses. If your friends suddenly can't connect, check if your IP changed. For a permanent solution, look into a free dynamic DNS service like No-IP.

8. Windows Firewall

Windows Firewall may block incoming connections to your server. If friends can't connect even after port forwarding, you need to allow Java through the firewall:

  1. Open Settings (press Win + I)
  2. Go to Privacy & Security > Windows Security > Firewall & network protection
  3. Click "Allow an app through firewall"
  4. Click "Change settings" (you may need admin permission)
  5. Click "Allow another app..."
  6. Click "Browse" and navigate to your Java installation. The file you need is typically at:
    C:\Program Files\Eclipse Adoptium\jdk-21...\bin\javaw.exe
  7. Add it, and make sure both Private and Public checkboxes are ticked.
  8. Click OK.

Alternatively, if Windows shows a firewall popup the first time you start the server, click "Allow access" on both Private and Public networks.

9. Keep It Running

Your server only runs while the Command Prompt window (or start.bat) is open. If you close it or shut down your PC, the server stops and nobody can connect.

The start.bat file we created earlier is the simplest approach — just double-click it whenever you want the server up. If you want the server to start automatically when your computer boots:

  1. Press Win + R, type taskschd.msc, and press Enter to open Task Scheduler.
  2. Click "Create Basic Task" in the right panel.
  3. Name it Minecraft Server and click Next.
  4. Choose "When the computer starts" and click Next.
  5. Choose "Start a program" and click Next.
  6. Browse to your start.bat file in C:\MinecraftServer.
  7. Set "Start in" to C:\MinecraftServer.
  8. Finish the wizard.

Now the server will launch every time your PC boots. Remember that your computer must be on and awake for the server to be reachable.

10. Backups

Your entire world is stored in the world folder inside C:\MinecraftServer. If something goes wrong — a corrupted chunk, an accidental lava disaster, or a failed update — you'll want a backup to restore from.

The simplest backup method:

  1. Stop the server (type stop in the server console and press Enter).
  2. Copy the entire world folder to another location (an external drive, a different folder, or cloud storage).
  3. Name the copy with the date, like world-backup-2026-04-01.
  4. Restart the server.

Do this before every major update and at least once a week if your server is active. If you also have the Nether and End dimensions, back up world_nether and world_the_end as well.

Back up your world files automatically

Desert Forge Backup handles Minecraft world backups on a schedule with AES-256 encryption and zero egress fees. Never lose a build again.

Set up Backup

11. Troubleshooting

  • "java" is not recognized: Java isn't in your system PATH. Reinstall Adoptium and make sure the "Add to PATH" option is checked during installation. Restart your computer after installing.
  • Can't connect from outside your network: Double-check that port forwarding is set up for port 25565 TCP pointing to your computer's correct local IP. Verify your public IP hasn't changed. Make sure Windows Firewall allows Java (see section 8).
  • Friends get "Connection refused": The server probably isn't running, or the port isn't forwarded. Ask them to make sure they're using your public IP (from whatismyip.com), not your local IP. Also confirm the server console shows the "Done" message.
  • Server is laggy: Allocate more RAM by changing -Xmx2G to -Xmx4G in your start command (only if your PC has enough free RAM). You can also reduce view-distance in server.properties from the default 10 to 7 or 8. Fewer players and fewer loaded chunks means less lag.
  • Server crashes on start: Make sure you're using Java 21 (not Java 8 or 17) and that you have enough free RAM. Check the logs/latest.log file in your server folder for error details.
  • "Failed to bind to port": Something else is using port 25565, or you have another Minecraft server already running. Close any other servers and try again. You can also change the port in server.properties.
Don't want to leave your PC running 24/7?

Desert Forge Game Hosting gives you a Minecraft server that's always online and DDoS protected — from $2/week. No setup, no port forwarding, no firewall headaches.

Get a server

← Back to all guides