Note details

How to Host a Minecraft Server on your PC

BY h6wcb
May 9, 2025
Public
Private
4928 views

Minecraft Server Setup Guide

Introduction

Learn how to set up your Minecraft server on your PC, allowing you to play with friends even if they're on a different network. This guide uses the Minecraft Java edition and is completely free.

Steps to Set Up Minecraft Server:

  1. Download the Server:

    • Go to the official Minecraft server download website.
    • Download the Java edition server file, server.jar.
  2. File Management:

    • Move server.jar from the Downloads folder to a new folder named "Minecraft Server" on your desktop.
  3. Command Prompt Setup:

    • Open Command Prompt in the "Minecraft Server" directory by typing CMD in the address bar.
    • Ensure Java is installed by typing java -version.
    • If Java is not installed, install it using:
      winget install microsoft.openjdk.21
      
  4. Agree to EULA:

    • Run the server once, then edit eula.txt and set eula=false to true.
  5. Create a Batch File:

    • Right-click in the folder, create a new text file, and rename it to start.bat.
    • Edit start.bat and add code to specify RAM allocation and server launch:
      @echo off
      java -Xms2G -Xmx4G -jar server.jar nogui
      pause
      
  6. Modify Server Properties:

    • Open Server.Properties with Notepad to set game details such as game mode and difficulty.
  7. Start the Server:

    • Double-click start.bat to launch your server.
  8. In-Game Commands:

    • Use /op [your_in-game_name] to make yourself a server operator for executing in-game commands.

Connecting to Your Server

  • From the Same Computer:

    • In Minecraft, go to Multiplayer > Direct Connection > and type localhost.
  • From Another Computer on the Same Network:

    • Type ipconfig in Command Prompt to get your IPv4 address.
    • Share this IP with added default port :25565 with others on your network.
  • From an External Network:

    • Access your router settings using the default gateway IP.
    • Set up Port Forwarding with:
      • WAN IP as your external IP.
      • Forward port as 25565.

Final Steps

  • Share your WAN IP with port :25565 to allow external players.
  • Add your server in Minecraft for easy access by going to Add Server option in the Multiplayer section.

Conclusion

Congratulations on setting up your Minecraft server. Remember, your external IP may change, so keep your friends updated. If this tutorial was helpful, consider subscribing for more content!

    How to Host a Minecraft Server on your PC