Skip to content

Instantly share code, notes, and snippets.

@glektarssza
Created January 21, 2025 04:21
Show Gist options
  • Save glektarssza/68291039a781358a162b63cd8b88b504 to your computer and use it in GitHub Desktop.
Save glektarssza/68291039a781358a162b63cd8b88b504 to your computer and use it in GitHub Desktop.
Setup instructions for Minecraft using itzg/minecraft-server
  1. 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
  1. Unpack world data into a separate directory. For this example we'll use $HOME/mc-world/.
  2. Create a Docker volume for your server.
docker volume create --label minecraft-server-data
  1. 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
  1. Copy the world data into the Docker volume.
docker container cp $HOME/mc-world minecraft-server:/data/world
  1. Start the server.
docker container start minecraft-server
  1. Monitor the logs during first boot.
docker container logs --follow minecraft-server
  1. Once the start is up and running press Ctrl-C to stop following the logs. Proceed to log in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment