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 1.21+
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.

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 21 or newer (we'll install this)

Step 1: Install Java

Minecraft servers require Java to run. You'll need Java 21 or newer for the latest versions of Minecraft. Follow the instructions for your operating system below.

Download Java

Visit the Adoptium website and download the latest LTS version of Eclipse Temurin (Java 21+).

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

You should see output showing Java 21 or higher.

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 -Xmx1024M -Xms1024M -jar server.jar nogui

The server will stop and create several files including eula.txt.

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
difficulty=normal

# Enable command blocks
enable-command-block=false

# 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

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.

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 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-21\bin\java.exe), and add it.

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 -Xmx2G -Xms1G -jar server.jar nogui
pause

Memory settings: -Xmx is max memory, -Xms is starting memory. Always leave at least 2GB for your 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

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

"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

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