How to Set Up a Minecraft Server

Learn how to create your own Minecraft Java Edition server and play with friends. This guide covers installation on Windows, macOS, and Linux with step-by-step instructions.

Updated
~30 minutes
Beginner friendly
Java Edition 26.2
Contains affiliate links

Not sure how much RAM you need?

Use our RAM calculator to get a personalized recommendation based on your player count and setup.

Overview

Running your own Minecraft server gives you full control over your gaming experience. You can customize game rules, install mods and plugins, manage who can join, and create a private space for you and your friends to build and explore together.

This guide will walk you through setting up a vanilla Minecraft Java Edition server. The process involves installing Java, downloading the server software, configuring settings, and setting up port forwarding so others can connect.

Minecraft version numbers changed in 2026

Since March 2026, Java Edition releases are numbered by year and drop instead of 1.x. The release after 1.21.11 was 26.1, and the current version is 26.2 (June 2026). This guide targets 26.x. The steps are the same for 1.21 servers, except that those still run on Java 21.

Requirements

Minimum System Requirements

  • CPU: Intel Core i3-3210 / AMD A8-7600 or equivalent
  • RAM: 4GB minimum, 8GB+ recommended for multiple players
  • Storage: 1GB for server files, more for world saves
  • Network: Stable internet connection with upload speed of at least 5 Mbps
  • Java: Java 25 or newer (we'll install this)

Step 1: Install Java

Minecraft servers require Java to run. Minecraft 26.1 and newer need Java 25. Java 25 also runs older 1.20.5 to 1.21.11 servers, so install it either way. Follow the instructions for your operating system below, or see the full Java 25 guide for switching from an older Java and fixing version errors.

Download Java

Visit the Adoptium website and download Eclipse Temurin 25 (LTS) for Windows x64 as an .msi installer.

Prefer the command line? Open PowerShell and run:

winget install EclipseAdoptium.Temurin.25.JDK

Run the installer

Double-click the downloaded .msi file and follow the installation wizard. Make sure to check the option to set JAVA_HOME and add Java to PATH.

Verify installation

Open Command Prompt and verify Java is installed correctly:

java -version

The first line should start with openjdk version "25. If it shows 21 or older, the server will refuse to start.

Step 2: Download the Minecraft Server

Pro Tip: Consider PaperMC for Better Performance

The vanilla Minecraft server can be laggy, especially with multiple players. For significantly better performance, consider downloading PaperMC instead. It's a drop-in replacement that's fully compatible with vanilla clients and includes many optimizations.

Create a server folder

Create a new folder for your server. A good location is somewhere easy to find:

mkdir C:\MinecraftServer

Download server.jar

Visit the official Minecraft server download page and download server.jar. Save it to your MinecraftServer folder.

Step 3: Configure Your Server

Before your server can run properly, you need to accept the EULA and configure basic settings.

First run (generates files)

Run the server once to generate configuration files:

java -Xms2G -Xmx2G -jar server.jar nogui

The server will stop and create several files including eula.txt. Minecraft 26.x needs at least 2 GB of heap even for a first run, so do not go lower than -Xmx2G.

Accept the EULA

Open eula.txt in a text editor and change eula=false to:

eula.txtbash
eula=true

By changing this to true, you agree to the Minecraft EULA.

Configure server.properties

Open server.properties to customize your server. Here are some key settings:

server.propertiesbash
# Server name shown in the server list
motd=A Minecraft Server

# Maximum players allowed
max-players=20

# Game mode: survival, creative, adventure, spectator
gamemode=survival

# Difficulty: peaceful, easy, normal, hard (default: easy)
difficulty=normal

# How far players can see, in chunks (default: 10)
# Lower this to 8 or 6 on a slow machine
view-distance=10

# How far away entities and crops keep ticking (default: 10)
simulation-distance=10

# Port the server runs on (default: 25565)
server-port=25565

# Whitelist - only allow specific players
white-list=false

# Online mode - verify players with Mojang
online-mode=true

Some settings moved out of this file. Since 1.21.9, command blocks, PvP, monster spawning, and Nether access are game rules, not server.properties keys. Set them from the server console (no leading slash) or in game as an operator:

gamerule commandBlocksEnabled true
gamerule pvp false
gamerule spawnMonsters false
gamerule allowEnteringNetherUsingPortals false

Step 4: Set a Static IP Address

Before setting up port forwarding, you need to assign a static IP address to your server computer. Without this, your router may assign a different IP address after a restart, breaking your port forwarding rules.

Open Network Settings

Press Windows + I to open Settings, then go to Network & Internet > Ethernet (or Wi-Fi) > Edit next to IP assignment.

Switch to Manual

Change from "Automatic (DHCP)" to Manual, then enable IPv4.

Find your current network info

Before changing settings, open Command Prompt and run:

ipconfig

Note down your current Default Gateway (usually ends in .1) and Subnet Mask. You'll need these values.

Enter your static IP details

Fill in the following using the info from the previous step:

  • IP address: Use your gateway but change the last number (e.g., if gateway is 192.168.1.1, use 192.168.1.100)
  • Subnet mask: Use the value from ipconfig (usually 255.255.255.0)
  • Gateway: Enter the Default Gateway from ipconfig
  • Preferred DNS: 8.8.8.8 (Google) or 1.1.1.1 (Cloudflare)

Save and verify

Click Save, then open Command Prompt and run ipconfig again to confirm your IPv4 address matches what you set.

Step 5: Port Forwarding

For players outside your local network to connect, you need to set up port forwarding on your router. This allows external connections to reach your server. The port forwarding guide goes further, with router-specific menu names, a fix for double NAT and CGNAT, and a no-port-forwarding option.

Access your router settings

Open a web browser and go to your router's admin page. Common addresses are:

  • 192.168.1.1
  • 192.168.0.1
  • 10.0.0.1

You'll need your router's admin credentials (often found on a sticker on the router).

Create a port forwarding rule

Navigate to the Port Forwarding section and create a new rule:

  • Name: Minecraft Server
  • Internal IP: The static IP you set in Step 4
  • Internal Port: 25565
  • External Port: 25565
  • Protocol: TCP (or Both/TCP+UDP)

Find your public IP

Your friends will need your public IP address to connect. You can find it by searching "what is my ip" on Google.

Step 6: Configure Firewall

Your operating system's firewall may block incoming connections to your server. This is often the main reason friends can't connect.

Open Windows Firewall Settings

Press Windows + S and search for "Allow an app through Windows Firewall", then click it.

Click Change Settings

Click the Change settings button (requires administrator access).

Find and enable Java

Scroll down and find OpenJDK Platform binary (older Oracle installs show it as Java(TM) Platform SE binary). Check both the Private and Public boxes.

If Java isn't listed, click Allow another app, browse to your Java installation (usually C:\Program Files\Eclipse Adoptium\jdk-25.x-hotspot\bin\java.exe), and add it.

Windows usually shows a firewall prompt for OpenJDK Platform binary the first time the server starts. Allowing it there does the same thing.

Alternative: Allow by port

You can also create a rule specifically for port 25565:

  1. Open Windows Defender Firewall with Advanced Security
  2. Click Inbound Rules > New Rule
  3. Select Port, click Next
  4. Select TCP, enter 25565, click Next
  5. Select Allow the connection, apply to all profiles
  6. Name it "Minecraft Server" and finish

Step 7: Start Your Server

Now it's time to start your server! You can create a script to make this easier in the future.

Create a start script

Create a file called start.bat in your server folder:

start.batbash
@echo off
java -Xms2G -Xmx2G -jar server.jar nogui
pause

Memory settings: -Xms is the starting heap and -Xmx is the maximum. Keep them equal, which is what PaperMC recommends, and never hand the server all of your RAM: leave at least 2 GB for the operating system.

Not sure how much RAM to allocate? Use our RAM Calculator to get a personalized recommendation.

Run the server

Double-click start.bat to launch your server. You'll see the console output as the world generates.

Step 8: Connect to Your Server

Your server should now be running! Here's how to connect:

Local connection (same network)

If you're on the same network as the server:

  1. Open Minecraft Java Edition
  2. Click Multiplayer
  3. Click Add Server
  4. Enter localhost or your local IP as the server address
  5. Click Done, then join!

Remote connection (different network)

For friends connecting from outside your network:

  1. Share your public IP address with them
  2. They enter your public IP in the server address field
  3. If you changed the port, they need to add it: yourip:port

Security note: Your public IP address reveals your approximate location and exposes your home network. Only share it with people you trust, and consider using a VPN or a paid hosting service for public servers.

Troubleshooting

"Connection refused" or "Can't reach server"

  • Verify the server is running (check console output)
  • Check that port forwarding is configured correctly
  • Make sure your firewall allows Java or port 25565
  • Try disabling your firewall temporarily to test

Full list of causes, in order: the connection refused guide.

"UnsupportedClassVersionError" or "class file version 69.0"

The server jar was built for Java 25 but an older Java is running it. This is the most common failure since Minecraft 26.1.

  • Run java -version and confirm it reports 25 or newer
  • Windows: uninstall older Java versions, or re-run the Temurin 25 installer and enable the PATH option
  • Linux: run sudo update-alternatives --config java and pick Java 25
  • macOS: run /usr/libexec/java_home -V to see installed versions and remove old ones from /Library/Java/JavaVirtualMachines

Upgrading an existing 1.21 world to 26.x

  • Back up the whole server folder first. 26.1 rewrote the save layout, and a converted world cannot be opened by 1.21 again. The 26.2 update guide walks through the whole process
  • Install Java 25 before swapping in the new server jar
  • On Paper, update every plugin to a build that supports 26.x before starting, or move it out of the plugins folder
  • The first start takes longer than usual while the world is converted

Server crashes or runs out of memory

  • Increase the -Xmx value in your start script
  • Reduce view-distance in server.properties (try 8 or 6)
  • Limit max-players to reduce load
  • Pregenerate chunks using a plugin like Chunky

How to read the crash and size the heap: the out of memory guide.

"Failed to verify username"

  • Make sure online-mode=true in server.properties
  • Players must own a legitimate copy of Minecraft
  • Check that Mojang's authentication servers are online

Player and server fixes: the failed to verify username guide.

High latency or lag

  • Use a wired ethernet connection instead of WiFi
  • Close bandwidth-heavy applications
  • Check your upload speed (5-10 Mbps total is usually sufficient for a small group)
  • Consider using a server optimization mod like Paper or Purpur