Docker Install
This project includes a Dockerfile that allows you to build and run the Bedrock Server Manager in a containerized environment. This allows for easy deployment and management of the application.
Image Location
The official Docker image is hosted on both the GitHub Container Registry and Docker Hub.
Docker Hub:
dmedina559/bedrock-server-manager:stableGitHub Container Registry:
ghcr.io/dmedina559/bedrock-server-manager:stable
You can pull it using the following command:
docker pull dmedina559/bedrock-server-manager:stable
Running the Container
The Docker image is configured to run the web server by default. To run the container, you need to map the port and, most importantly, provide volumes for persistent data storage.
Data Persistence
The application uses two main directories to store its data. To prevent data loss when the container is removed, you must mount volumes for both of these locations.
Configuration Directory: This directory stores the main
bedrock_server_manager.jsonfile, which contains the path to the data directory and the database URL.Container Path:
/root/.config/bedrock-server-manager
Data Directory: This directory stores everything else, including server files, plugins, backups, and the application’s database.
Default Container Path:
/root/bedrock-server-manager
Using a Named Volume (Recommended)
This is the easiest and most recommended way to manage the data. Docker will manage the volumes for you.
docker run -d \
-p 11325:11325 \
-p 19132:19132/udp \
--name bsm-container \
-v bsm_config:/root/.config/bedrock-server-manager \
-v bsm_data:/root/bedrock-server-manager \
dmedina559/bedrock-server-manager:stable
This command creates two named volumes, bsm_config and bsm_data, and mounts them to the correct locations.
Using Bind Mounts
Alternatively, you can mount directories from your host machine.
docker run -d \
-p 11325:11325 \
-p 19132:19132/udp \
--name bsm-container \
-v /path/on/host/bsm_config:/root/.config/bedrock-server-manager \
-v /path/on/host/bsm_data:/root/bedrock-server-manager \
dmedina559/bedrock-server-manager:stable
Overriding Environment Variables
You can override the default HOST and PORT for the web server by passing environment variables to the container. If these variables are not set, the application will use the default values (HOST=0.0.0.0, PORT=11325). For example, to change the web server port to 8080:
docker run -d \
-p 8080:8080 \
-p 19132:19132/udp \
--name bsm-container \
-e PORT=8080 \
-e HOST=0.0.0.0 \
-v bsm_config:/root/.config/bedrock-server-manager \
-v bsm_data:/root/bedrock-server-manager \
dmedina559/bedrock-server-manager:stable
Exposing Minecraft Server Ports
For players to be able to connect to your Minecraft servers, you must expose the corresponding UDP ports from the container. The default Minecraft Bedrock port is 19132/udp.
If you run multiple servers, you will need to map a port for each one. See the example above for how to add more -p flags.
Alternative: Host Networking
A simpler, but less isolated, approach is to use host networking by adding --network host to your docker run command. Note that when using host networking, you do not need to map individual ports.
Using Docker Compose
For an even easier setup, you can use Docker Compose. Create a docker-compose.yml file and add the following content:
version: '3.8'
services:
bedrock-server-manager:
image: dmedina559/bedrock-server-manager:stable # Use desired tag here (e.g., stable, latest, 3.7.0)
container_name: bsm-container # Name of the container
restart: unless-stopped # Restart policy
ports:
- "11325:11325" # Web server port
- "19132:19132/udp" # Default Minecraft Bedrock server port
# - "19132:19132/udp" # Add more ports as needed for additional servers
environment: # Optional
- HOST=0.0.0.0 # Which host to bind the web server to
- PORT=11325 # Port for the web server
volumes:
- bsm_config:/root/.config/bedrock-server-manager
- bsm_data:/root/bedrock-server-manager
volumes:
bsm_config:
bsm_data:
You can then start the application with a single command: docker-compose up -d.
Advanced Usage
Accessing the CLI
You can access the bedrock-server-manager CLI using docker exec.
To run a single command:
docker exec bsm-container bedrock-server-manager <command>
To get an interactive shell:
docker exec -it bsm-container /bin/bash
Changing the Database URL
The database URL is stored in the configuration file. If you are using the recommended volume setup, you can find the file in the bsm_config volume.
To change the database URL:
Stop the container:
docker stop bsm-containerLocate and edit the
bedrock_server_manager.jsonfile inside thebsm_configvolume. The exact location on your host will depend on your Docker setup. You can usedocker volume inspect bsm_configto find the mountpoint.Change the
db_urlvalue in the JSON file.Start the container again:
docker start bsm-container