Hosting a Minecraft bedrock server

The server

To host your own Minecraft Bedrock server using Docker, you can follow these steps:

Tip: I love using vs code for this work, because it has a docker client, to show running clients, it has an integrated terminal, and it has a nice way to edit YAML files.

  1. Install Docker on your host machine: You can follow the installation instructions for your specific operating system from the Docker website.
  2. Im always a fan of using docker-compose. This means that your the state of your containers are repeatable, and easy to debug. Here is my docker-compose.yml
version: '3.4'

services:
  bds:
    image: itzg/minecraft-bedrock-server
    environment:
      EULA: "TRUE"
      GAMEMODE: survival
      DIFFICULTY: normal
    ports:
      - 19132:19132/udp
    volumes:
      - bds:/data
    stdin_open: true
    tty: true

volumes:
  bds: {}
  1. Once you have saved this file, you can spin it up by entering the following:
docker-compose -f "minecraft docker compose.yml" up -d --build

This command creates a Docker container and maps port 19132 from the container to port 19132 on the host machine.

This solution is fine for hosting a minecraft bedrock server on your home network. but if you want your friends to play remotely, its a bit more work.

Dynamic DNS service

A dynamic DNS service allows you to associate a domain name with a dynamic IP address. Whenever your IP address changes, the service updates the DNS record to reflect the new IP. This way, you can use the domain name to access your services even if your IP changes.

Port forwarding

Port forwarding is a technique used in computer networking to redirect incoming network traffic from one port to another on a device such as a router. This is useful when you want to host a service (such as a web server or a game server) on your local network and make it accessible to the internet.

In our case, we want incomming traffic to reach our minecraft server on port 19132, you can set up port forwarding on your router to forward incoming traffic on port 19132 to the internal IP address of the computer running the minecraft server. This way, when someone accesses your public IP address on port 19132, the traffic will be redirected to your minecraft server, and the server will respond to the request.

Tip: Make sure your forwarding UDP traffic! This caught me out 🤨

Port forwarding can be configured in the administration interface of your router. The specific steps for configuring port forwarding may vary depending on the make and model of your router, so it is best to consult your router’s manual or the manufacturer’s website for more information.

Note: When I was using this tool to check if I had a port open:

https://www.yougetsignal.com/tools/open-ports/

It was saying that the port was closed, even though I could connect. 😒


Posted

in

,

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *