Our news See more of us on Google? Add
Discord
How to set up a Minecraft server
Wiki - Servers

How to set up a Minecraft server

A complete step-by-step guide, from hardware requirements and configuration to the first launch and inviting your friends.

Reading time: ~12 min Level: Intermediate

Hardware requirements

Before you start setting up a Minecraft server, make sure your hardware is up to the job. The requirements depend on the number of players, the plugins you install and the size of the world. A Minecraft server is single-threaded in its key operations (the main game loop), so the performance of a single CPU core matters more than the number of cores.

Minimum requirements (1-5 players)

  • CPU: Intel Core i3 or AMD Ryzen 3 (3.0 GHz+ clock speed)
  • RAM: 4 GB (2 GB for the server + the operating system)
  • Storage: 10 GB of free space (SSD recommended)
  • Internet: 5 Mbps upload, a stable connection
  • Java: Java 21 (for Minecraft 1.20.5 to 1.21.11) or Java 17 (older versions)

Recommended requirements (10-30 players)

  • CPU: Intel Core i5/i7 or AMD Ryzen 5/7 (3.5 GHz+ clock speed)
  • RAM: 8-16 GB (4-8 GB for the server)
  • Storage: an NVMe SSD, which loads chunks much faster
  • Internet: 20 Mbps upload, ideally a wired (Ethernet) connection

Tip: An SSD is one of the best investments you can make for a Minecraft server. Loading chunks, saving the world and other I/O operations are much faster on an SSD than on a traditional HDD. The difference is especially noticeable when more players are online.

Java: the foundation of your server

A Minecraft Java Edition server needs a Java Runtime Environment (JRE) installed. Minecraft 1.20.5 to 1.21.11 require Java 21. Older versions of the game (1.17-1.20.4) need Java 17, and even older ones (up to 1.16.5) need Java 8 or 11. We recommend getting Java from Adoptium (Eclipse Temurin), a free, high-performance OpenJDK distribution. You'll find a detailed guide to downloading and setting it up on our Java download page.

Once Java is installed, check that it works by typing this in a terminal (cmd/PowerShell on Windows, Terminal on Mac/Linux):

java -version

You should see a version number (for example openjdk version "21.0.2"). If your system doesn't recognize the command, make sure Java is added to the PATH environment variable.

Downloading the server software

You have several options, depending on whether you want to run a pure Vanilla server or a server with plugins. These are the most common choices:

Vanilla (Mojang's official server)

You can download the official server from minecraft.net/download/server or from our Vanilla server download page. Click the link to the server.jar file for the latest version. That file is all you need, and it doesn't have to be installed. Vanilla is a good choice if you want to play pure Minecraft without any modifications.

Paper (recommended)

For most servers we recommend Paper, a fork of Spigot with much better performance, patched exploits and full compatibility with Bukkit/Spigot plugins. Download it from papermc.io or from our Paper download page. Choose the Minecraft version you want to run and download the latest build. You can read more about the differences between server software in our article on server optimization.

Spigot

Spigot has to be compiled with BuildTools. Download BuildTools.jar from the SpigotMC website and run:

java -jar BuildTools.jar --rev latest

Compiling takes a few minutes and produces a spigot-X.XX.X.jar file. Paper is easier to get and faster, though, so we recommend it over Spigot.

Other server options

Besides Vanilla, Paper and Spigot, there's other server software worth a look:

  • Purpur: a fork of Paper with hundreds of extra configuration options. It lets you change how practically every aspect of the game behaves. Ideal for admins who want deep customization.
  • Fabric: lightweight server software built for mods. If you're planning a modded server (with mods on both the client and the server side), Fabric is a great choice. It doesn't support Bukkit/Spigot plugins and uses its own mod ecosystem instead.

Preparing the server folder

Create a dedicated folder for the server (for example C:\MinecraftServer on Windows or ~/minecraft-server on Linux/Mac). Put the downloaded .jar file in that folder. Avoid paths with accented letters or other special characters, as they can cause encoding problems.

First launch and the EULA

Starting the server for the first time takes a few steps. The server has to generate its configuration files, and you have to accept the license agreement (EULA).

Step 1: Start the server

Open a terminal or command prompt in the server folder and type:

java -Xmx4G -Xms2G -jar server.jar nogui

What the parameters mean:

  • -Xmx4G: the maximum amount of RAM (4 GB). Adjust it to your needs.
  • -Xms2G: the initial RAM allocation (2 GB).
  • server.jar: the name of the server file (change it if you use Paper, for example paper-1.21.4-123.jar).
  • nogui: starts the server without the graphical interface (recommended).

The server will shut down almost immediately with a message about the EULA. That's normal.

Step 2: Accept the EULA

An eula.txt file appears in the server folder. Open it in any text editor and change the line:

eula=false

to:

eula=true

By accepting the EULA, you agree to the Minecraft license terms. You have to accept it to run the server.

Step 3: Start it again

Run the same command as before. This time the server generates the world, loads its configuration files and after a moment shows the Done! message, which means the server is running and ready for connections. The default port is 25565.

Tip: Create a startup script so you don't have to type the command every time. On Windows, create a start.bat file, and on Linux/Mac a start.sh file, containing: java -Xmx4G -Xms2G -jar server.jar nogui.

Optimal startup flags

For Paper/Spigot servers we recommend Aikar's flags, an extended set of startup flags that optimize how Java manages memory (garbage collection):

java -Xmx4G -Xms4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -jar server.jar nogui

These flags significantly reduce lag caused by garbage collection. Make sure -Xmx and -Xms have the same value to avoid dynamic memory reallocation.

Configuring server.properties

The server.properties file is the main configuration file of a Minecraft server. It's generated automatically on the first launch. Each line holds one option in the key=value format. Here are the most important settings:

Basic settings

motd The message shown in the server list. Supports color codes (for example \u00a76My Server). An online MOTD generator makes it easy to create colorful descriptions.
max-players The maximum number of players online at the same time. Default: 20. Match it to your hardware, since every player adds RAM and CPU load.
difficulty The difficulty level: peaceful, easy, normal (recommended), hard. It affects mob strength, hunger and other mechanics.
gamemode The default game mode: survival, creative, adventure, spectator.
pvp true or false. Whether players can attack each other. Usually true on Survival servers.

Performance settings

view-distance The chunk render distance (default 10). Lowering it to 6-8 noticeably improves performance on weaker hardware. Players can set a higher render distance in their client, but the server still limits it to this value.
simulation-distance The chunk simulation distance (default 10). Chunks beyond this range aren't processed (for example, farms there stop working). Lowering it to 4-6 improves performance.
max-tick-time The maximum tick time in milliseconds (default 60000). If a tick takes longer, the server treats it as a crash. Set it to -1 to turn off the watchdog (not recommended on a live server).
network-compression-threshold The size threshold for compressing network packets (default 256). Lowering it to 64-128 can help on connections with a low upload speed.

World settings

level-name The name of the world folder (default world). Change it to run a different world without deleting the existing one.
level-seed The world generator seed. Leave it empty for a random seed, or enter a specific number or text to get a reproducible world.
spawn-protection The radius of the protected spawn area in blocks (default 16). Only operators can change blocks within this range. Set it to 0 to turn it off.
white-list true or false. Turns on the whitelist, so only approved players can join. Manage it with the /whitelist add PlayerName command.

Note: After every change to server.properties you have to restart the server for the changes to take effect. Some options (such as online-mode) are critical for security: never set online-mode=false on a public server without an authentication plugin.

Port forwarding

If you're running the server on a home computer and want players outside your local network to be able to connect, you have to set up port forwarding on your router. Without it, the server is only reachable from your home network.

Step by step

  1. Find your router's IP address: on Windows, type ipconfig in the command prompt and look for "Default Gateway" (usually 192.168.1.1 or 192.168.0.1). On Linux, use ip route | grep default.
  2. Log in to the router's admin panel: type the router's IP address into your browser. You'll find the login details on a sticker on the router or in its manual (the defaults are often admin/admin or admin/password).
  3. Find the Port Forwarding section: the name varies by manufacturer, for example "Port Forwarding", "Virtual Server" or "NAT". Look in the advanced network settings.
  4. Add a new rule: enter port 25565 (both internal and external) and the TCP protocol, and set the destination IP address to the local IP of the computer running the server (for example 192.168.1.100).
  5. Save and restart the router: after you save the rule, the router may need a restart.

Checking the setup

To check whether port forwarding works:

  • Go to a site such as yougetsignal.com and check whether port 25565 is open (the server has to be running).
  • Ask a friend to connect to your public IP address (look it up at whatismyip.com).
  • Players on your local network can connect through the local IP (for example 192.168.1.100) without port forwarding.

Security: Opening a port on your router means your server is reachable from the internet. Make sure online-mode=true is set in server.properties (account verification through Mojang) and consider an anti-DDoS plugin or a proxy service (such as TCPShield).

Hosting vs your own server

Running a server on your home computer is a good start, but it isn't always the best solution in the long run. Here's how the two approaches compare:

Your own computer (self-hosted)

Pros

  • No monthly costs (apart from electricity)
  • Full control over the hardware and software
  • No bandwidth or storage limits
  • A good option for testing and learning

Cons

  • The computer has to run 24/7 if the server is to stay online all the time
  • Home internet connections have limited upload
  • No protection against DDoS attacks
  • Power outage = server offline
  • Your public IP address may change (dynamic IP)

Hosting (a rented server)

Pros

  • 24/7 availability without tying up your home computer
  • A fast, low-ping connection (data centers)
  • DDoS protection included in the price
  • An admin panel that makes management easier
  • Automatic backups
  • A fixed IP address or domain

Cons

  • A monthly cost (from ~15 PLN/month)
  • Limited resources (RAM, CPU, storage) depending on the plan
  • Less control over the server configuration
  • You depend on the provider

Our recommendation: If you're planning to run a public server for more than 5 players, go with hosting. See our Minecraft hosting guide for a detailed comparison of providers.

Server security

Server security is something you can't ignore, especially on a public server. These are the most important rules:

Basic protection

  • online-mode=true: always keep account verification through Mojang turned on. Turning it off lets players without a legitimate account join, which opens the door to griefing and impersonated accounts.
  • Whitelist: if the server is meant for a closed group, turn on the whitelist (white-list=true).
  • Be careful with OP: don't give operator status to random people. The /op command gives full control over the server.
  • Backups: back up the world folder regularly. Set up automatic backups every few hours with a plugin (such as DriveBackupV2) or a system script.
  • Updates: keep your server software and plugins up to date. Security holes get fixed in new versions.

Protection against griefing

Griefing (deliberately destroying other players' builds) is one of the biggest problems on Minecraft servers. These plugins help protect against it:

  • CoreProtect: logs every player interaction with blocks. It lets you check who broke or placed a block and roll back the changes.
  • GriefPrevention: a claim system that lets players protect their land.
  • WorldGuard: defines regions with flags (for example no block breaking, no PvP, no explosions).

Read more about plugins in our plugin guide.

Next steps

Your server is up and running, congratulations! Next comes customizing and expanding it. Here's what's worth doing: