Selfhost a Minecraft Server With Docker

Self-Hosting a Minecraft server

This is going to be quick rundown on running Minecraft as a docker container.


The minecraft docker image we are using is itzj/minecraft-server

The compose file

Paste the following into a docker-compose.yml

version: "3"

    image: itzg/minecraft-server
    container_name: my-mc-server
      - 25565:25565
      EULA: "TRUE"
    tty: true
    stdin_open: true
    restart: unless-stopped
      - ./minecraft_data:/data

After you have that file - run docker-compose up -d to run the services in this compose file.

This is just a minimal compose file to get started… there are many many more options that can be used to configure various runtime settings for the minecraft server.

The documentation of the project is very good, so you are sure to find what you are looking for there.