Skip to main content
Forge is the most established modding platform for Minecraft, offering a comprehensive API and the largest collection of mods. It’s the go-to choice for running traditional modded Minecraft servers.

Overview

Minecraft Forge provides:
  • Extensive Mod Library: Thousands of mods available
  • Mature Platform: Long-standing, stable modding framework
  • Wide Version Support: Available for most Minecraft versions
  • Complex Mods: Supports large-scale gameplay modifications
  • Active Community: Large modding community and resources
Please support the Forge project through Patreon if you automate downloads, as their development is supported by ads from their download page.

Configuration

Basic Setup

services:
  minecraft:
    image: itzg/minecraft-server
    environment:
      EULA: "TRUE"
      TYPE: FORGE
      VERSION: "1.20.4"
    ports:
      - "25565:25565"
    volumes:
      - ./data:/data
    restart: unless-stopped

Version Selection

By default, the recommended Forge version for your Minecraft version is selected:
environment:
  TYPE: FORGE
  VERSION: "1.20.4"  # Uses recommended Forge for 1.20.4

Latest Forge Version

Use the latest Forge build instead of recommended:
environment:
  TYPE: FORGE
  VERSION: "1.20.4"
  FORGE_VERSION: latest

Specific Forge Version

Select a specific Forge version:
environment:
  TYPE: FORGE
  VERSION: "1.12.2"
  FORGE_VERSION: "14.23.5.2854"

Environment Variables

VariableDefaultDescription
TYPE-Set to FORGE
VERSIONlatestMinecraft version (e.g., 1.20.4)
FORGE_VERSIONrecommendedForge version: recommended, latest, or specific version
FORGE_INSTALLER-Path to pre-downloaded Forge installer
FORGE_INSTALLER_URL-URL to download Forge installer
FORGE_FORCE_REINSTALLfalseForce reinstall Forge
FORGE_PROMOTIONS_URL[official]Custom promotions JSON URL
FORGE_MAVEN_REPO_URL[official]Custom Maven repository URL

Custom Forge Installer

Pre-Downloaded Installer

Use a pre-downloaded Forge installer:
environment:
  TYPE: FORGE
  FORGE_INSTALLER: "/data/forge-installer.jar"
volumes:
  - ./data:/data
  - ./forge-installer.jar:/data/forge-installer.jar
When using FORGE_INSTALLER, you don’t need to specify VERSION or FORGE_VERSION.

Custom Download URL

Download Forge installer from a custom location:
environment:
  TYPE: FORGE
  FORGE_INSTALLER_URL: "https://your-repo.com/forge-installer.jar"

Mod Management

Manual Mod Installation

1

Mount mods directory

volumes:
  - ./data:/data
  - ./mods:/data/mods
2

Download Forge mods

Download Forge mods (.jar files) from CurseForge or Modrinth.
3

Add to mods directory

Place mod files in ./mods/ on your host.
4

Restart server

docker restart minecraft-forge

Auto-Download from CurseForge

Automatically install mods from CurseForge:
environment:
  TYPE: FORGE
  VERSION: "1.20.1"
  CF_API_KEY: "your-curseforge-api-key"
  CF_SLUG: "jei,journeymap,iron-chests"

Auto-Download from Modrinth

Install Forge-compatible mods from Modrinth:
environment:
  TYPE: FORGE
  VERSION: "1.20.1"
  MODRINTH_PROJECTS: |
    jei
    journeymap
Forge mods are NOT compatible with Fabric mods. Ensure all mods are built for Forge and your Minecraft version.

Forge Modpacks

CurseForge Modpacks

Automatically install complete CurseForge modpacks:
environment:
  TYPE: FORGE
  CF_API_KEY: "your-api-key"
  CF_PAGE_URL: "https://www.curseforge.com/minecraft/modpacks/all-the-mods-9"
Or use the modpack file:
environment:
  TYPE: FORGE
  CF_API_KEY: "your-api-key"
  MODPACK: "/data/modpack.zip"

Modrinth Modpacks

environment:
  TYPE: FORGE  # Will be auto-detected from modpack
  MODRINTH_MODPACK: "https://modrinth.com/modpack/atm9"

Performance Optimization

environment:
  TYPE: FORGE
  VERSION: "1.20.1"
  MODRINTH_PROJECTS: |
    modernfix
    ferritecore
    lazy-dfu

Essential Utilities

environment:
  CF_SLUG: |
    jei
    journey-map
    ftb-utilities
    ftb-chunks

Tech Mods

environment:
  CF_SLUG: |
    applied-energistics-2
    thermal-expansion
    mekanism
    industrial-foregoing

NeoForge

NeoForge is a modern fork of Forge for newer Minecraft versions:
environment:
  TYPE: NEOFORGE
  VERSION: "1.20.4"
  NEOFORGE_VERSION: "47.1.79"  # Or "latest" or "beta"
environment:
  TYPE: NEOFORGE
  VERSION: "1.20.4"
  NEOFORGE_VERSION: latest

Cleanroom (Legacy)

For legacy modded servers, Cleanroom can be used:
1

Find Cleanroom release

2

Copy installer URL

Get the link to the *-installer.jar file
3

Configure server

environment:
  TYPE: FORGE
  FORGE_INSTALLER_URL: "https://github.com/CleanroomMC/Cleanroom/releases/download/0.2.4-alpha/cleanroom-0.2.4-alpha-installer.jar"

Complete Production Example

docker-compose.yml
services:
  minecraft:
    image: itzg/minecraft-server
    container_name: minecraft-forge
    
    environment:
      # Server Type
      EULA: "TRUE"
      TYPE: FORGE
      VERSION: "1.20.1"
      FORGE_VERSION: "recommended"
      
      # Modpack (optional)
      # CF_API_KEY: "your-api-key"
      # CF_PAGE_URL: "https://www.curseforge.com/minecraft/modpacks/your-pack"
      
      # Individual Mods (optional)
      MODRINTH_PROJECTS: |
        jei
        journeymap
        modernfix
        ferritecore
      
      # Server Settings
      MOTD: "A Forge Minecraft Server"
      DIFFICULTY: normal
      MODE: survival
      MAX_PLAYERS: 30
      VIEW_DISTANCE: 10
      
      # Performance
      MEMORY: 8G
      USE_AIKAR_FLAGS: "true"
      
      # World
      LEVEL: "world"
      SEED: "forge-world"
      
      # Security
      ENABLE_WHITELIST: "false"
      ONLINE_MODE: "true"
    
    ports:
      - "25565:25565"
    
    volumes:
      - ./data:/data
      - ./mods:/data/mods
      - ./config:/data/config
    
    restart: unless-stopped
    
    stdin_open: true
    tty: true

Mod Configuration

Config Files

Forge mods store configuration in the config directory:
volumes:
  - ./data:/data
  - ./config:/data/config
Typical config structure:
  • ./config/mod-name.toml
  • ./config/mod-name/settings.cfg
  • ./config/mod-name/client.cfg
  • ./config/mod-name/server.cfg

Server vs Client Configs

Server-Side Mods:
  • Only needed on server
  • Players can connect without them
  • Examples: server utilities, admin tools
Client-Side Mods:
  • Only affect client rendering/UI
  • Not needed on server
  • Examples: minimaps, inventory sorters
Universal Mods:
  • Required on both client and server
  • Most gameplay mods
  • Examples: tech mods, content mods

Performance Tuning

Memory Recommendations

Mod CountPlayersRecommended RAM
< 501-104-6GB
50-10010-206-8GB
100-20020-308-12GB
200+30+12GB+

JVM Flags

environment:
  MEMORY: 8G
  USE_AIKAR_FLAGS: "true"
  JVM_OPTS: "-XX:+UseG1GC -XX:+ParallelRefProcEnabled"

Optimization Mods

Install these for better performance:
environment:
  MODRINTH_PROJECTS: |
    modernfix      # Overall performance
    ferritecore    # Memory optimization
    lazy-dfu       # Startup performance
    roadrunner     # Performance improvements

Troubleshooting

Installation Failed

If Forge installation fails:
environment:
  FORGE_FORCE_REINSTALL: "true"
Remove FORGE_FORCE_REINSTALL after successful installation.

Mod Conflicts

  1. Check server logs for error messages
  2. Verify all mods support the same Minecraft version
  3. Check for known incompatibilities
  4. Remove mods one by one to isolate the issue

Memory Issues

  1. Increase allocated memory
  2. Install optimization mods
  3. Reduce render distance
  4. Remove resource-intensive mods

Version Compatibility

Ensure:
  • Minecraft version matches Forge version
  • All mods support your Forge version
  • Mod dependencies are installed

Migration Guide

From Vanilla to Forge

1

Backup your world

docker stop minecraft
cp -r ./data ./data-backup
2

Update configuration

environment:
  TYPE: FORGE
  VERSION: "1.20.1"
  FORGE_VERSION: recommended
3

Add mods

Place mod files in ./mods/ directory.
4

Start server

docker-compose up -d
Players must install Forge and all required mods on their clients to connect.

Next Steps

CurseForge Modpacks

Install complete modpacks from CurseForge

Modrinth Integration

Download mods from Modrinth

NeoForge

Try modern NeoForge fork

Hybrid Servers

Run Forge mods with plugins

Build docs developers (and LLMs) love