Skip to main content
Modrinth Modpacks can automatically be installed along with the required mod loader (Forge, Fabric, or Quilt) by setting MODPACK_PLATFORM, MOD_PLATFORM or TYPE to MODRINTH. Upgrading and downgrading automatically cleans up old files and manages the mod loader version.

Environment Variables

VariableRequiredDescription
TYPEYesSet to MODRINTH
MODRINTH_MODPACKYesProject slug, ID, URL, or path to mrpack file
MODRINTH_VERSIONNoSpecific version ID or number
MODRINTH_MODPACK_VERSION_TYPENoFilter by release, beta, or alpha
MODRINTH_LOADERNoFilter by forge, fabric, or quilt
MODRINTH_EXCLUDE_FILESNoComma/newline list of files to exclude
MODRINTH_FORCE_INCLUDE_FILESNoComma/newline list of files to force include
MODRINTH_IGNORE_MISSING_FILESNoGlob pattern of files to ignore if missing
MODRINTH_OVERRIDES_EXCLUSIONSNoAnt-style paths to exclude from overrides
MODRINTH_FORCE_SYNCHRONIZENoForce re-evaluation of excludes/includes
MODRINTH_DEFAULT_EXCLUDE_INCLUDESNoSet to empty to disable default excludes

Specifying the Modpack

The MODRINTH_MODPACK variable accepts multiple formats:

Project Slug

The slug is located in the URL:
MODRINTH_MODPACK: cobblemon-fabric

Project ID

Found in the bottom of the left panel on the project page:
MODRINTH_MODPACK: 5FFgwNNP

Project Page URL

MODRINTH_MODPACK: https://modrinth.com/modpack/cobblemon-fabric

Version Page URL

For a specific version:
MODRINTH_MODPACK: https://modrinth.com/modpack/cobblemon-fabric/version/1.3.2

Custom mrpack URL

MODRINTH_MODPACK: https://example.com/my-modpack.mrpack

Local mrpack File

MODRINTH_MODPACK: /modpacks/my-pack.mrpack

Version Selection

1

Default behavior

Latest release version is selected when VERSION is LATESTLatest beta version is selected when VERSION is SNAPSHOT
2

Override version type

Set MODRINTH_MODPACK_VERSION_TYPE to filter versions:
MODRINTH_MODPACK_VERSION_TYPE: beta
3

Narrow by Minecraft version

Set VERSION to a specific Minecraft version:
VERSION: "1.19.2"
4

Filter by mod loader

Set MODRINTH_LOADER to specify the loader:
MODRINTH_LOADER: fabric

Examples

services:
  mc:
    image: itzg/minecraft-server
    environment:
      EULA: "TRUE"
      MODPACK_PLATFORM: MODRINTH
      MODRINTH_MODPACK: cobblemon-fabric
    volumes:
      - ./data:/data
    ports:
      - "25565:25565"

Excluding Files

To exclude client mods incorrectly declared as server-compatible:
environment:
  MODRINTH_EXCLUDE_FILES: |
    notenoughanimations
    lambdynamiclights
    euphoriapatcher
  MODRINTH_FORCE_SYNCHRONIZE: "true"
You may need to set MODRINTH_FORCE_SYNCHRONIZE to true while iterating on a compatible set of mods.

Force-Including Files

To force include specific mods:
environment:
  MODRINTH_FORCE_INCLUDE_FILES: |
    yet-another-config-lib

Ignoring Missing Files

Some mods like MCInstance Loader use temporary files that get deleted. Prevent re-installation by ignoring them:
environment:
  MODRINTH_IGNORE_MISSING_FILES: |
    config/mcinstanceloader/pack.mcinstance
    mods/*.jar

Excluding Overrides Files

Modrinth mrpack files may include an overrides subdirectory with config files, world data, and extra mods. Exclude specific files using ant-style paths:
environment:
  MODRINTH_OVERRIDES_EXCLUSIONS: |
    mods/NekosEnchantedBooks-*.jar
    mods/citresewn-*.jar

Ant-style Path Patterns

SymbolBehavior
*Matches zero, one, or many characters except a slash
**Matches zero, one, or many characters including slashes
?Matches one character

Default Exclude/Includes

The image includes default exclude/include rules maintained in the repository. Disable defaults by setting:
environment:
  MODRINTH_DEFAULT_EXCLUDE_INCLUDES: ""

Troubleshooting

If files become inconsistent, set MODRINTH_FORCE_SYNCHRONIZE to true to force re-evaluation of all mod files.
Modrinth modpacks often require significant memory. Set MEMORY to at least 4G for most modpacks.

Build docs developers (and LLMs) love