Skip to content

Instantly share code, notes, and snippets.

@dnaprawa
Last active November 22, 2020 11:52
Show Gist options
  • Save dnaprawa/6542e6adf7b84b5db6c941e6cec06a7a to your computer and use it in GitHub Desktop.
Save dnaprawa/6542e6adf7b84b5db6c941e6cec06a7a to your computer and use it in GitHub Desktop.
Running Minecraft Server using Docker (and docker-compose)

Running Minecraft Server using Docker (and docker-compose)

With over 126 million monthly users, 200 million games sold & 40 million MAU, Minecraft still remains one of the biggest games on the planet.

Why minecraft inside Docker?

  • for fun of course! :)
  • can be run locally for your kids
  • you can run it on popular and low-cost Rasperry PI inside your home and/or in the cloud

Installing Docker and docker-compose on Rasperry PI

Install Docker

curl -sSL https://get.docker.com | sh

Add permission to Pi user

sudo usermod -aG docker pi

Reboot here or run the next commands with a sudo

Test Docker installation

docker run hello-world

Install proper dependencies

sudo apt-get install -y libffi-dev libssl-dev

sudo apt-get install -y python3 python3-pip

sudo apt-get remove python-configparser

Install docker-compose

sudo pip3 -v install docker-compose

Now you are ready to run Minecraft Server using docker-compose.

Create a docker-compose.yml file

version: '3.7'
services:
 minecraft:
   image: itzg/minecraft-server:multiarch
   ports:
     - "25565:25565"
   environment:
     EULA: "TRUE"
   deploy:
     resources:
       limits:
         memory: 1.5G

Run & Enjoy ! :)

docker-compose up -d

NOTE: Your Minecraft Server will be running on port 25565



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment