Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-minecraft

A nice and easy way to get a Minecraft server up and running using docker.

For help on getting started with docker see the official getting started guide.

For more information on Minecraft and check out it's website.

Building Image

Running this will build you a docker image with the latest version of both docker-minecraft and Minecraft itself.

$ git clone https://github.com/micooz/docker-minecraft
$ cd docker-minecraft
$ sudo docker build -t micooz/minecraft .

Running Container

$ sudo docker run -d -p=25565:25565 -v=/mnt/minecraft:/data --name minecraft micooz/minecraft

Running the first time will set your port to a static port of your choice so that you can easily map a proxy to.

If this is the only thing running on your system you can map the port to 25565 and no proxy is needed. i.e. -p=25565:25565 .

If you want to enable the query protocol you need to add another -p=25565:25565/udp to forward the UDP protocol on the same port as well.

Also be sure your mounted directory on your host machine is already created before running mkdir -p /mnt/minecraft.

From now on when you start/stop docker-minecraft you should use the container id or it's name we set with the following commands. To get your container id, after you initial run type sudo docker ps and it will show up on the left side followed by the image name which is micooz/minecraft:latest.

$ sudo docker start <container_id>
$ sudo docker stop <container_id>
// or
$ sudo docker start/stop minecraft

Notes on the run command

  • -v is the volume you are mounting -v=host_dir:docker_dir
  • micooz/minecraft is simply what I called my docker build of this image
  • -d allows this to run cleanly as a daemon, remove for debugging
  • -p is the port it connects to, -p=host_port:docker_port

About

Dockerfile for deploying minecraft server anywhere.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages