Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

First Steps with mc

This walkthrough creates a new instance and runs it.

Create an instance

Each instance lives in its own directory, with a mc.kdl manifest at its root. mc init creates both:

mc init myserver
cd myserver

The generated manifest looks like this:

name "myserver"
description "A Minecraft Server"

minecraft {
    version "..."
    loader "fabric"
}

server {
    gamemode "survival"
    difficulty "normal"
    hardcore #false

    // Setting this to true indicates YOU have read and agree to the Minecraft EULA (https://aka.ms/MinecraftEULA).
    // This agreement is between you and Mojang/Microsoft.
    eula #false
}

backups {
    enabled #true
    frequency "0 0 * * * *"
}

mods {
    modrinth {
        lithium "..."
    }
}

By default mc init uses the optimized preset, which adds a mod loader and a small set of performance mods. Pass --preset vanilla for an unmodded instance. The manifest is yours to edit; every key is documented in The Manifest Format.

Agree to the EULA

The instance will not start until you have agreed to the Minecraft EULA. Once you have read it, set:

server {
    eula #true
}

You can also pass --eula to mc init to do this at creation time.

Run it

mc run

On first run, mc downloads a Java runtime, the Minecraft binary, the mod loader, and any configured mods, then starts the instance. Subsequent runs reuse what is already installed and start immediately.

The console is attached to your terminal. Stop the instance with Ctrl-C: mc asks it to save the world and waits for it to exit cleanly.

Note that the allow list is enabled by default, so players must be on it before they can join. Add them with mc allow add. To open the instance to everyone instead, set allow-list #false in the server section.

Next steps