How Set Up A Minecraft Java Edition Server (2025)

A full guide on how to download and install a Minecraft Java Edition server.

How Set Up A Minecraft Java Edition Server (2025)

A full guide on how to set up a Minecraft Java Edition server on both Windows and Linux (Debian 12)! This includes installing Java, basic server configuration, and launching the server via startup scripts or using tools like screen on Linux.

Whether you're looking to host a small survival server for your friends or create a public modded world, this guide will walk you through what you need to start out!

Table Of Contents

Requirements

Before setting up your server, here's what you'll need:

  • A PC with 4GB or more RAM
  • A Minecraft Java Edition account
  • Java 17 or newer (depending on Minecraft version)
  • If you want other players to be able to join the server, you will need to ensure you have a stable Internet connection and TCP port 25565 port forwarded on your network. Here's a guide on how to port forward!

Additionally here's a list of nice haves.

  • A basic understanding of how to run scripts and commands (Batch for Windows, Bash/Shell for Linux).
  • Familiarity with your terminal or command prompt.

Download Minecraft Server JAR

You'll need the official Minecraft Server .jar file:

C:\MinecraftServer

or on Linux:

~/minecraft/server

Setting Up On Windows

Install Java On Windows

  1. Download Java 17+ from Adoptium
  2. Run the installer
  3. (Optional) Add Java to your system PATH:
    setx PATH "%PATH%;C:\Program Files\Eclipse Adoptium\jdk-17\bin"
    

Create A Startup Script (Windows)

Inside the folder where your server.jar is located:

  1. Right-click → New → Text Document

  2. Rename it to start.bat

  3. Edit it and paste the following:

    @echo off
    java -Xmx4G -Xms2G -jar server.jar nogui
    pause
    
  4. Save the file and double-click start.bat to launch your server.

If it's your first run, a eula.txt file will appear. Open it and change:

eula=false

to:

eula=true

Then re-run start.bat.

Setting Up On Linux (Debian 12)

Install Java On Linux

Open a terminal and type:

sudo apt update
sudo apt install -y openjdk-17-jdk

Verify it installed:

java -version

Create A Startup Script (Linux)

Create a new folder and move into it:

mkdir -p ~/minecraft/server
cd ~/minecraft/server

Move your server.jar here, then create start.sh:

nano start.sh

Paste this:

#!/bin/bash
cd "$(dirname "$0")"
java -Xmx4G -Xms2G -jar server.jar nogui

Save and make it executable:

chmod +x start.sh

Run it with:

./start.sh

Just like Windows, the first time you run it you'll need to accept the EULA:

nano eula.txt

Change eula=false to eula=true, then save and re-run.

Using screen On Linux

If you want your server to keep running after you close the terminal:

  1. Install screen:
sudo apt install screen
  1. Start a new session:
screen -S minecraft
  1. Run your server:
./start.sh
  1. Detach from screen:
    Press CTRL + A, then D

  2. Reattach later:

screen -r minecraft

This is a great way to keep your server online 24/7 even when you're not SSH'd in.

Basic Configuration

After running your server once, it will generate a server.properties file.

To edit the configuration:

nano server.properties  # Linux
notepad server.properties  # Windows

Some options you may want to change:

motd=Welcome to My Server!
max-players=10
difficulty=normal
pvp=true
enable-command-block=false
allow-nether=true
online-mode=true

You can whitelist users by adding them via the server console or editing whitelist.json:

whitelist on
whitelist add <username>

Conclusion

You now have a basic, but functioning Minecraft Java Edition server running on either Windows or Linux! Whether you're hosting a private world for friends or planning to go public, you should be off to a great start.

See Also

This guide is a work-in-progress and may be updated over time. If you have suggestions or improvements, we'd love your feedback!