- Setup an environment file. Name it
.env
or something. More configuration options can be found here.
# Set the amount of RAM to max out at.
MEMORY=4G
# Required to access CurseForge APIs (you need to get this yourself😉)
CF_API_KEY=???
TYPE=AUTO_CURSEFORGE
# Link to the version of the mod pack you want to install (NOT THE SERVER FILES!)
CF_PAGE_URL=https://www.curseforge.com/minecraft/modpacks/all-the-mods-9/files/6045443
# Agree to Mojang's EULA
EULA=true
- Unpack world data into a separate directory. For this example we'll use
$HOME/mc-world/
.
- Create a Docker volume for your server.
docker volume create --label minecraft-server-data
- Create your Minecraft server Docker container.
docker container create --env-file .env --volume minecraft-server-data:/data/:noacl -p 25565:25565 --name minecraft-server itzg/minecraft-server:latest
- Copy the world data into the Docker volume.
docker container cp $HOME/mc-world minecraft-server:/data/world
- Start the server.
docker container start minecraft-server
- Monitor the logs during first boot.
docker container logs --follow minecraft-server
- Once the start is up and running press Ctrl-C to stop following the logs. Proceed to log in.