{# bedrock-server-manager/bedrock_server_manager/web/templates/getting_started.html #} {% extends "base.html" %} {# --- Page Title --- #} {% block title %}Getting Started - {{ super() }}{% endblock %} {# --- Page Specific Styles --- #} {% block head_styles %} {{ super() }} {# Include styles from base if needed #} {# Include table styles if not already globally included/needed #} {% endblock %} {# --- Main Content --- #} {% block content %}

Bedrock Server Manager

{# --- Link back to the Documentation Index --- #}

Bedrock Server Manager is a comprehensive python package designed for installing, managing, and maintaining Minecraft Bedrock Dedicated Servers with ease, and is Linux/Windows compatable.

{# --- CHANGELOG Link --- #}

Features

Prerequisites

This app requires Python 3.10 or later, and you will need pip installed.

On Linux, you'll also need:

Installation

Install The Package:

  1. Run the command:
pip install bedrock-server-manager

Configuration

Setup The Configuration:

bedrock-server-manager will use the Environment Variable BEDROCK_SERVER_MANAGER_DATA_DIR for setting the default config/data location, if this variable does not exist it will default to $HOME/bedrock-server-manager (Linux/macOS) or the user's home directory equivalent (Windows).

Follow your platform's documentation for setting Environment Variables.

The app will create its data folders in this location. This is where servers will be installed to and where the app will look when managing various server aspects.

Certain variables can can be changed directly in the /.config/script_config.json or with the manage-script-config command.

The following variables are configurable via json

Usage

{# --- CLI Commands Link (External) --- #}

For a complete list of commands, run bedrock-server-manager --help from the Bedrock Server Manager host CLI

Run the app:

bedrock-server-manager  [options]
Examples:

Open Main Menu:

bedrock-server-manager main

Send Command:

bedrock-server-manager send-command --server server_name --command "tell @a hello"

Manage Script Config:

bedrock-server-manager manage-script-config --key BACKUP_KEEP --operation write --value 5

Start the Web Server:

bedrock-server-manager start-web-server --host 0.0.0.0 "::" --mode direct

Install Content:

Easily import addons and worlds into your servers. The app will look in the configured CONTENT_DIR directories for addon files.

Place .mcworld files in /worlds or .mcpack/.mcaddon files in /addons

Use the interactive menu to choose which file to install or use the command:

bedrock-server-manager install-world --server server_name --file '/path/to/WORLD.mcworld'
bedrock-server-manager install-addon --server server_name --file '/path/to/ADDON.mcpack'

Web Server:

Bedrock Server Manager 3.1.0 includes a Web server you can run to easily manage your bedrock servers in your web browser, and is also mobile friendly!

The web ui has full parity with the CLI. With the web server you can:

Configure the Web Server:

Environment Variables:

To get started using the web server you must first set these environment variables:

Follow your platform's documentation for setting Environment Variables.

Generate Password Hash:

For the web server to start you must first set the BEDROCK_SERVER_MANAGER_PASSWORD environment variable.

This must be set to the password hash and NOT the plain text password.

Use the following command to generate a password:

bedrock-server-manager generate-password

Follow the on-screen prompt to hash your password.

Hosts:

By Default Bedrock Server Manager will only listen to local host only interfaces 127.0.0.1 and [::1].

To change which host to listen to start the web server with the specified host.

Example: specify local host only ipv4 and ipv6:

bedrock-server-manager start-web-server --host 127.0.0.1 "::1"

Example: specify all ipv4 and ipv6 addresses:

bedrock-server-manager start-web-server --host 0.0.0.0 "::"

Port:

By default Bedrock Server Manager will use port 11325. This can be changed in script_config.json:

bedrock-server-manager manage-script-config --key WEB_PORT --operation write --value 11325

HTTP API:

An HTTP API is provided allowing tools like curl or Invoke-RestMethod to interact with the server.

Before using the API, ensure the following environment variables are set on the system running the app:

Obtaining a JWT token:

The API endpoints require authentication using a JSON Web Token (JWT).

How: Obtain a token by sending a POST request to the /api/login endpoint.

Request Body: Include a JSON payload with username and password keys, matching the values set in the environment variables.

{
    "username": "username",
    "password": "password"
}

Response: On success, the API returns a JSON object containing the access_token:

{
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Tokens expire after the configured duration (default: 4 weeks).

curl Example (Bash):
curl -X POST -H "Content-Type: application/json" \
     -d '{"username": "your_username", "password": "your_password"}' \
     http://:/api/login
PowerShell Example:
$body = @{ username = 'your_username'; password = 'your_password' } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "http://:/api/login" -Body $body -ContentType 'application/json'
Using the API

Endpoints requiring authentication will need the obtained access_token included in the Authorization header of your requests:

Authorization: Bearer YOUR_JWT_TOKEN

For requests sending data (like POST or PUT), set the Content-Type header to application/json.

Examples:

Start server:

curl Example (Bash):
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" \
     http://:/api/server//start
PowerShell Example:
$headers = @{ Authorization = 'Bearer YOUR_JWT_TOKEN' }
Invoke-RestMethod -Method Post -Uri "http://:/api/server//start" -Headers $headers

Send Command:

curl Example (Bash):
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" -H "Content-Type: application/json" \
     -d '{"command": "say Hello from API!"}' \
     http://:/api/server//send_command
PowerShell Example:
$headers = @{ Authorization = 'Bearer YOUR_JWT_TOKEN'; 'Content-Type' = 'application/json' }
$body = @{ command = 'say Hello from API!' } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "http://:/api/server//send_command" -Headers $headers -Body $body
{# --- HTTP API Link --- #}

Disclaimers:

Platform Differences:

Tested on these systems:

{# --- Optional: Back link at the bottom --- #}
{# End .getting-started-container #} {% endblock %} {# --- Page Specific Body Scripts (Optional) --- #} {% block body_scripts %} {{ super() }} {# Add any JS specific to this page if needed #} {% endblock %}