How to Set Up a Local Server for Modded Minecraft

How to Set Up a Local Server for Modded Minecraft

Elias VanceBy Elias Vance
How-ToGaming & Hobbiesminecraftmoddingpc gamingserver setupsandbox games
Difficulty: intermediate

This guide provides a technical walkthrough for setting up a dedicated local Minecraft server capable of running heavy modpacks. You will learn how to configure Java environments, manage server files, handle port forwarding, and optimize system resources to ensure your friends experience low latency and stable frame rates regardless of how many complex machines or entities are active in your world.

Hardware and Software Requirements

Before downloading a single file, you must understand that a modded Minecraft server is a resource hog. Unlike a vanilla server, a modded environment requires significant overhead for CPU single-core performance and RAM allocation. If you attempt to run a heavy pack like All the Mods 9 or RLCraft on a laptop with 8GB of total system RAM, the server will crash or stutter constantly.

Minimum and Recommended Specifications

  • CPU: A high clock speed is more important than high core counts. Minecraft's main logic loop is largely single-threaded. Aim for a processor with a boost clock of at least 3.5GHz (e.g., Intel Core i5-12600K or AMD Ryzen 5 5600X).
  • RAM: For a basic modpack, allocate 4GB to 6GB. For heavy industrial or magic-based packs, you will need to allocate 8GB to 12GB. Ensure your physical machine has at least 16GB of total RAM to prevent the OS from swapping to the disk.
  • Storage: An NVMe SSD is non-negotiable. Modded Minecraft involves constant read/write operations as chunks load and mod data is accessed. An HDD will cause massive "Can't keep up!" warnings in your console.
  • Network: A wired Ethernet connection is required for the host. Do not attempt to host a server over Wi-Fi; the packet loss will result in "rubber-banding" for your players.

Step 1: Installing the Correct Java Development Kit (JDK)

The most common reason a Minecraft server fails to launch is a version mismatch between the game and the Java Runtime Environment. You cannot simply use whatever version of Java is currently installed on your Windows or Linux machine. You must match the JDK to the Minecraft version you intend to play.

  • Minecraft 1.12.2 and below: Requires Java 8.
  • Minecraft 1.16.5: Requires Java 11 or Java 16.
  • Minecraft 1.17 to 1.18: Requires Java 16 or 17.
  • Minecraft 1.19 and 1.20+: Requires Java 17 or Java 21.

I recommend using Adoptium (Temurin) builds rather than the standard Oracle JDK. They are open-source, highly stable, and frequently used in professional server environments. Once installed, verify your installation by opening a terminal or Command Prompt and typing java -version. If the output does not match your target version, you must point your startup script to the specific executable path.

Step 2: Selecting and Downloading a Server Core

A standard Minecraft server file from Mojang cannot run mods. You need a "server core" that acts as a mod loader. The three industry standards are Forge, Fabric, and Quilt. If you are playing a specific modpack, you must use the specific loader that the pack was built for.

Installing Forge or Fabric

  1. Visit the official Forge or Fabric website.
  2. Download the "Installer" version, not the "Client" version.
  3. Run the installer and select the "Install Server" option.
  4. Specify a new, empty folder for your server files. This keeps your installation clean and prevents file clutter.
  5. Once the installation completes, you will see a forge.jar or a similar executable in that folder.

If you are using a pre-made modpack from CurseForge or FTB (Feed The Beast), check if they provide a "Server Pack" download. These are much easier to use because they come with the mods and configuration files pre-configured for server-side stability.

Step 3: Initializing the Server and EULA Agreement

You cannot run the server until you have accepted the End User License Agreement (EULA). To do this, you must run the server file once to generate the necessary configuration files.

  1. Open your terminal/command prompt.
  2. Navigate to your server folder using the cd command (e.g., cd C:\MinecraftServer).
  3. Run the initial command: java -Xmx2G -Xms2G -jar forge-server-file.jar nogui.
  4. The process will immediately terminate and return you to the command prompt. This is normal.
  5. Look in your folder for a file named eula.txt. Open it with Notepad.
  6. Change eula=false to eula=true and save the file.

Step 4: Creating a Robust Startup Script

Running the server via a simple double-click is a mistake. You need a batch file (.bat for Windows) or a shell script (.sh for Linux) to control memory allocation and ensure the server runs with the correct parameters. This is where you prevent the "out of memory" errors that plague amateur hosts.

Create a new text file in your server folder, name it start.bat, and paste the following code. I have optimized this to allocate a specific amount of RAM and use the nogui flag to save system resources:

@echo off
java -Xmx8G -Xms8G -jar forge-version-name.jar nogui
pause

Technical Breakdown:

  • -Xmx8G: This sets the maximum heap size to 8GB. Adjust this based on your hardware.
  • -Xms8G: This sets the initial/starting heap size. Setting this equal to your maximum prevents the JVM from constantly resizing the heap, which causes lag spikes.
  • nogui: This disables the graphical interface, freeing up CPU cycles for the actual game logic.
  • pause: This ensures that if the server crashes, the command window stays open so you can actually read the error log.

Step 5: Port Forwarding and Network Access

By default, your server is only visible to your local network (LAN). To allow friends to join from their homes, you must open a "door" in your router. This is called Port Forwarding.

The Port Forwarding Process

  1. Find your Local IP: Open Command Prompt, type ipconfig, and look for your "IPv4 Address" (usually something like 192.168.1.XX).
  2. Access your Router: Type your "Default Gateway" IP into a web browser. Log in with your router credentials.
  3. Locate Port Forwarding: Look for a section named "Port Forwarding," "Virtual Server," or "Applications & Gaming."
  4. Create a New Rule:
    • Protocol: TCP/UDP (Select "Both" if possible).
    • Internal Port: 25565
    • External Port: 25565
    • Internal IP: The IPv4 Address you found in step 1.
  5. Save and Apply.

To let your friends join, they will need your Public IP address. You can find this by searching "What is my IP" on Google. If you want to avoid giving out your home IP address for security reasons, consider using a tool like Tailscale or Ngrok, though these can sometimes introduce more latency than direct port forwarding.

Step 6: Optimization and Troubleshooting

Once the server is running, you will likely encounter performance issues as the world expands. A modded world with many automated farms can quickly overwhelm even a high-end CPU. Use these professional-grade optimizations to keep the experience smooth.

Essential Optimization Mods

If you are building your own mod list, ensure you include these server-side performance mods. They are designed to optimize the way the game handles entities and chunk loading:

  • FerriteCore: Reduces memory usage significantly.
  • Starlight: Optimizes the lighting engine (crucial for reducing chunk loading lag).
  • Lithium (for Fabric) or Canary (for Forge): Optimizes general game physics and AI logic.

Common Error Messages

If your server fails to start, check the logs/latest.log file. This is the most important document in your server folder. Look for "FATAL" or "ERROR" entries. Common issues include:

  • "Exception in thread 'main' java.lang.UnsupportedClassVersionError": You are using the wrong Java version for your Minecraft version.
  • "Out of Memory": You have allocated more RAM than your physical system has available, or your -Xmx value is too high.
  • "Missing Dependency": A mod requires another mod to function. The log will explicitly state which mod is missing.

Running a local server is a technical endeavor, but it is the best way to ensure total control over your gaming environment. By prioritizing hardware specifications and proper Java management, you can host a stable, high-performance world for your community.

Steps

  1. 1

    Install Java and Download the Server Files

  2. 2

    Configure the EULA and Server Settings

  3. 3

    Add Your Mod Files to the Folder

  4. 4

    Port Forward Your Router for External Access