> How to Create a Modded Minecraft Server with Forge

Step-by-step guide to setting up a Forge modded Minecraft server. Learn to install mods, configure memory, and optimize for performance.

Intermediate
1 hour

How to Create a Modded Minecraft Server with Forge

Want to play with mods like Better Minecraft, RLCraft, or your own custom pack? This guide walks you through setting up a Forge server from scratch.

What is Forge?

Forge is a modding API that allows you to run mods on your Minecraft server. It's required for most popular modpacks and custom modded experiences.

Alternatives:

  • >Fabric - Lighter weight, faster updates
  • >NeoForge - Modern Forge fork (1.20.2+)
---

Prerequisites

Before starting, ensure you have:

  • >Java 17 or newer (Java 21 recommended for 1.20+)
  • >At least 6GB RAM for the server
  • >Basic command line knowledge
  • >A copy of each mod (client and server versions)

Checking Your Java Version

Windows:

java -version

Mac/Linux:

java -version

You should see something like:

openjdk version "21.0.2" 2024-01-16

If you need to install or update Java, download from Adoptium.

---

Step 1: Download Forge

Find the Right Version

  • 1.Go to files.minecraftforge.net
  • 2.Select your Minecraft version (e.g., 1.20.4)
  • 3.Download the Installer version
  • Run the Installer

  • 1.Open the downloaded .jar file
  • 2.Select "Install server"
  • 3.Choose an empty folder for your server
  • 4.Click OK and wait for installation
  • What gets installed:

    • >forge-1.20.4-xxx.jar - The Forge server file
    • >libraries/ folder - Required libraries
    • >run.bat / run.sh - Startup scripts
    ---

    Step 2: First Server Start

    Windows Setup

    Run the run.bat file or create a custom start script:

    start.bat:

    BATCH
    @echo off
    java -Xmx8G -Xms8G -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 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar forge-1.20.4-*-server.jar nogui
    pause
    

    Linux/Mac Setup

    start.sh:

    Bash
    #!/bin/sh
    java -Xmx8G -Xms8G -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 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar forge-1.20.4-*-server.jar nogui
    

    Make it executable:

    Bash
    chmod +x start.sh
    ./start.sh
    

    First Run

  • 1.Run your start script
  • 2.Wait for the server to generate files
  • 3.Stop the server (type stop in console)
  • 4.Edit eula.txt and change eula=false to eula=true
  • 5.Start the server again
  • ---

    Step 3: Install Mods

    Finding Mods

    Download mods from trusted sources:

    Server vs Client Mods

    Server-side only (doesn't need client install):

    • >Performance mods (Spark, Phosphor)
    • >Admin tools (LuckPerms, CoreProtect)
    • >World management (WorldEdit)
    Client-side only (can't go on server):
    • >Shaders (Optifine, Iris)
    • >Minimaps (JourneyMap - server optional)
    • >UI improvements
    Required on both:
    • >Content mods (new items, blocks)
    • >Tech mods (Create, Mekanism)
    • >Magic mods (Botania, Ars Nouveau)

    Installing Mods

  • 1.Download mod files (.jar format)
  • 2.Place them in the mods folder
  • 3.Restart the server
  • Important: All players must have the exact same mods installed!

    ---

    Step 4: Server Configuration

    server.properties

    Key settings for modded servers:

    Properties
    # Basic settings
    server-name=My Modded Server
    server-port=25565
    max-players=20
    
    # Performance for modded
    view-distance=8
    simulation-distance=6
    max-tick-time=60000
    
    # World settings
    level-name=world
    level-type=minecraft:normal
    generate-structures=true
    
    # Connection
    online-mode=true
    enable-query=true
    

    Memory Allocation Guide

    Modpack SizeRAM NeededPlayers
    Light (50 mods)4-6 GB2-10
    Medium (150 mods)6-8 GB2-10
    Heavy (300+ mods)8-12 GB2-5
    Expert packs10-16 GB2-5
    Signs you need more RAM:
    • >Frequent "can't keep up" warnings
    • >High memory usage in /spark sampler
    • >Chunk loading issues
    • >Random crashes
    ---

    Step 5: Performance Optimization

    JVM Flags Explained

    The flags in our start script optimize for Minecraft:

    • >-Xmx8G - Maximum memory
    • >-Xms8G - Start with full memory
    • >-XX:+UseG1GC - Modern garbage collector
    • >-XX:+DisableExplicitGC - Prevent lag spikes

    Mod-Specific Optimizations

    Reduce tick-heavy features:

    • >Lower mob caps in mod configs
    • >Disable unnecessary world gen features
    • >Use chunk loaders sparingly
    Config files to check:
    config/
    ├── betterfps.txt
    ├── journeymap/
    ├── fertility.properties
    └── [modname]/config.toml
    

    Pre-generate Chunks

    Reduce lag by pre-generating your world:

    Using Chunky (recommended):

  • 1.Install Chunky mod
  • 2.Run: /chunky radius 5000
  • 3.Run: /chunky start
  • 4.Wait for completion
  • ---

    Step 6: Port Forwarding

    Finding Your Local IP

    Windows:

    ipconfig
    
    Look for "IPv4 Address" (usually 192.168.x.x)

    Mac/Linux:

    ifconfig
    
    Or:
    ip addr show
    

    Router Configuration

  • 1.Access router admin panel (usually 192.168.1.1 or 192.168.0.1)
  • 2.Find "Port Forwarding" or "NAT" settings
  • 3.Create a new rule:
    • >External Port: 25565
    • >Internal Port: 25565
    • >Protocol: TCP
    • >Internal IP: Your computer's local IP

    Get Your Public IP

    Visit whatismyip.com to find your public IP.

    Players connect using: your-public-ip:25565

    ---

    Step 7: Common Issues & Solutions

    Server Crashes on Start

    Check:

  • 1.Java version (mods often need specific versions)
  • 2.Mod conflicts (check crash reports)
  • 3.Insufficient RAM
  • 4.Missing dependencies
  • Finding crash reports:

    crash-reports/
    ├── crash-2024-01-15_10.30.00-server.txt
    └── crash-2024-01-15_12.45.00-server.txt
    

    "Missing Mods" Error

    Players must have:

    • >Same Forge version
    • >Same mod versions
    • >All required dependencies
    Solution: Share your entire mods folder with players or create a modpack.

    Extreme Lag

    Quick fixes:

  • 1.Reduce view distance in server.properties
  • 2.Disable mob spawning in mod configs
  • 3.Pre-generate chunks
  • 4.Use Aikar's flags (included above)
  • 5.Remove tick-heavy mods
  • Connection Refused

  • 1.Check if server is running
  • 2.Verify port forwarding
  • 3.Check firewall settings
  • 4.Ensure correct IP address
  • Windows Firewall:

    netsh advfirewall firewall add rule name="Minecraft" dir=in action=allow protocol=tcp localport=25565
    

    ---

    Creating a Modpack

    Manual Method

  • 1.Create a new folder for your pack
  • 2.Copy your mods folder
  • 3.Create mods/modlist.html (optional)
  • 4.Zip the contents
  • 5.Share with players
  • CurseForge Modpack

  • 1.Download CurseForge app
  • 2.Create a profile with your mods
  • 3.Right-click → "Export Profile"
  • 4.Upload to CurseForge or share directly
  • ---

    For Beginners

    • >Better Minecraft - Vanilla+ with quality of life
    • >All the Mods 9 - Kitchen sink pack
    • >FTB Academy - Learning-focused

    For Experienced Players

    • >Create: Above and Beyond - Tech-focused
    • >Roguelike Adventures and Dungeons - Adventure
    • >Nomifactory - Tech expert

    Hardcore Challenges

    • >RLCraft - Brutal survival
    • >Stoneblock 3 - Skyblock variant
    • >Divine Journey 2 - Expert progression
    ---

    Backup Strategy

    What to Backup

    world/           # World files
    mods/            # Your mod collection
    config/          # Server configs
    server.properties
    banned-players.json
    banned-ips.json
    ops.json
    whitelist.json
    

    Backup Script (Linux)

    Bash
    #!/bin/bash
    DATE=$(date +%Y-%m-%d_%H-%M-%S)
    tar -czf "backup_$DATE.tar.gz" world/ mods/ config/ server.properties
    # Keep only last 7 backups
    ls -t backup_*.tar.gz | tail -n +8 | xargs rm -f
    

    ---

    Conclusion

    You now have a fully functional modded Minecraft server! Remember:

    • >Keep mods updated together
    • >Monitor memory usage
    • >Regular backups are essential
    • >Share the exact modpack with all players
    Next steps:
    • >Install server management mods (LuckPerms, CoreProtect)
    • >Set up automated backups
    • >Consider a hosting provider for 24/7 uptime
    • >Join modding communities for support