> ## Documentation Index
> Fetch the complete documentation index at: https://docs.highmark.it/llms.txt
> Use this file to discover all available pages before exploring further.

# Local Minecraft Server

> Complete guide to create and configure a Minecraft server on your PC to play with friends.

<Warning>
  This guide is generic. The author HighMark assumes no responsibility for any errors or PC issues. None of the mentioned services (e.g., ngrok) are sponsored.
</Warning>

### **1. System Requirements**

Before starting, make sure you have:

* A computer with at least **4 GB of RAM** (8 GB recommended for larger servers).
* A stable internet connection.
* **Java** installed (required to run the server). Make sure to have the correct version for the Minecraft version you want to use (e.g., Java 17 for 1.18+, Java 21 for 1.20.5+).

### **2. Download Server Software**

1. Go to the official Minecraft website and download the server file.
   [Download here](https://www.minecraft.net/en-us/download/server)
   *Recommended alternative:* Use **PaperMC** or **Purpur** for better performance compared to the vanilla server.

2. Save the `server.jar` file in a dedicated folder (e.g., `C:\MinecraftServer`).

### **3. Configure the Server**

1. Open the folder where you saved `server.jar`.

2. Create a text file named `start.bat` (on Windows) or `start.sh` (on macOS/Linux) in the same folder.

3. Insert the following code in the file:
   ```batch theme={null}
   java -Xmx4G -Xms4G -jar server.jar nogui
   pause
   ```
   *(Replace "server.jar" with the exact name of your file if different)*.

4. **RECOMMENDED**: Use an optimized script created directly by me: [OptimizedServerMC.bat](https://github.com/HighMark-31/OptimizedServerMC.bat)

### **4. Start the Server for the First Time**

1. Run the `start.bat` file (or `start.sh` on macOS/Linux).

2. The server will generate some files and folders and close. Look for the `eula.txt` file.

3. Open `eula.txt` and change the line `eula=false` to `eula=true`. This confirms that you accept the Minecraft EULA.

4. Restart the server by running `start.bat` again.

### **5. Configure the `server.properties` File**

1. Open the `server.properties` file with a text editor.

2. Modify the main settings according to your needs:
   * `server-port=25565`: Server port.
   * `max-players=20`: Maximum number of players.
   * `online-mode=true`: Set to `false` if you want to allow access to those without a premium account (SP).
   * `difficulty=easy`: Game difficulty.

3. Save changes and restart the server.

### **6. Connect Players to the Server**

1. Start Minecraft on your computer.

2. Go to **Multiplayer** > **Add Server**.

3. Enter the IP address:
   * **For you (Host):** use `localhost` or `127.0.0.1`.
   * **For those on your same Wi-Fi network:** use your local IP address (e.g., `192.168.1.x`).
   * **For online friends:** You will need to open router ports (Port Forwarding) or use services like **Playit.gg** or **Ngrok** if you cannot access the router.

### **7. Advanced Configurations**

#### **A. Add Mods**

1. Download **Forge** or **Fabric** instead of vanilla server.
2. Install the loader and copy mods into the `mods` folder generated in the server.

<Note>
  Guide created by HighMark - All information and contacts on my [official website: Highmark.it](https://highmark.it)
</Note>
