bedrock-server-manager


Namebedrock-server-manager JSON
Version 3.4.1 PyPI version JSON
download
home_pageNone
SummaryA manager for Minecraft Bedrock Dedicated Servers
upload_time2025-06-25 16:28:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords minecraft bedrock server manager bsm admin dashboard web cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<div style="text-align: center;">
    <img src="https://raw.githubusercontent.com/dmedina559/bedrock-server-manager/main/src/bedrock_server_manager/web/static/image/icon/favicon.svg" alt="ICON" width="200" height="200">
</div> 

- [Bedrock Server Manager (BSM)](#bedrock-server-manager)
  - [Features](#features)
  - [Prerequisites](#prerequisites)
  - [Installation](#installation)
    - [Install The Package](#install-the-package)
  - [Configuration](#configuration)
    - [Setup The Configuration](#setup-the-configuration)
      - [The following variables are configurable via json](#the-following-variables-are-configurable-via-json)
  - [Usage](#usage)
    - [Run the app](#run-the-app)
  - [Install Content](#install-content)
  - [Web Server](#web-server)
    - [Configure the Web Server](#configure-the-web-server)
      - [Environment Variables](#environment-variables)
      - [Generate Password Hash](#generate-password-hash)
      - [Hosts](#hosts)
      - [Port](#port)
      - [HTTP API](#http-api)
        - [Obtaining a JWT token](#obtaining-a-jwt-token)
        - [Using the API](#using-the-api)
      - [Examples](#examples-1)
  - [Disclaimers](#disclaimers)


* [CHANGELOG](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/CHANGELOG.md)
* [PLUGINS](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/PLUGIN_API.md)
* [HTTP API](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/HTTP_API.md)
* [EXTRAS](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/EXTRAS.md)

# Bedrock Server Manager (BSM)

<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/bedrock-server-manager?link=https%3A%2F%2Fpypi.org%2Fproject%2Fbedrock-server-manager%2F"> <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/bedrock-server-manager"> <img alt="License" src="https://img.shields.io/github/license/dmedina559/bedrock-server-manager">


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.

## Features

Install New Servers: Quickly set up a server with customizable options like version (LATEST, PREVIEW, or specific versions).

Update Existing Servers: Seamlessly download and update server files while preserving critical configuration files and backups.

Backup Management: Automatically backup worlds and configuration files, with pruning for older backups.

Server Configuration: Easily modify server properties, and allow-list interactively.

Auto-Update supported: Automatically update the server with a simple restart.

Command-Line Tools: Send game commands, start, stop, and restart servers directly from the command line.

Interactive Menu: Access a user-friendly interface to manage servers without manually typing commands.

Install/Update Content: Easily import .mcworld/.mcpack files into your server.

Automate Various Server Task: Quickly create cron/task to automate task such as backup-server or restart-server.

View Resource Usage: View how much CPU and RAM your server is using.

Web Server: Easily manage your Minecraft servers in your browser, even if you're on mobile!

Plugin Support: Extend functionality with custom plugins that can listen to events, access the core app APIs, and trigger custom events.

## Prerequisites

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

## Installation

### Install The Package:

1. Run the command 
```bash
pip install bedrock-server-manager
```
See the [EXTRAS](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/EXTRAS.md) for more information on installing stable, beta, and development versions of the app.

## 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`

Follow your platforms documentation for setting Enviroment 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`

#### The following variables are configurable via json

* `BASE_DIR`: Directory where servers will be installed
* `CONTENT_DIR`: Directory where the app will look for addons/worlds
* `DOWNLOAD_DIR`: Directory where servers will download
* `BACKUP_DIR`: Directory where server backups will go
* `LOG_DIR`: Directory where app logs will be saved
* `BACKUP_KEEP`: How many backups to keep
* `DOWNLOAD_KEEP`: How many server downloads to keep
* `LOGS_KEEP`: How many logs to keep
* `CLI_LOG_LEVEL`: Level for CLI logging.
* `FILE_LOG_LEVEL`: Level for file logging.
* `WEB_PORT`: Port used by the web server. 11325 by default
* `TOKEN_EXPIRES_WEEKS`: How long JWT tokens are vaild for in weeks.

## Usage

<div style="text-align: left;">
    <img src="https://raw.githubusercontent.com/DMedina559/bedrock-server-manager/main/docs/images/cli_menu.png" alt="CLI Menu" width="300" height="200">
</div>

For a complete list of commands, see [CLI_COMMANDS.md](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/CLI_COMMANDS.md)

>Note: If you are using a version of the app prior to 3.3.0, you must run `bedrock-server-manager --help` to see the list of commands for your version.

### Run the app:

```bash
bedrock-server-manager <command> [options]
```
or

```bash
python -m bedrock_server_manager <command> [options] # 3.3.0 and later
```

##### Examples:

###### Open Main Menu:

```bash
bedrock-server-manager
```

###### Send Command:
```bash
bedrock-server-manager server send-command --server server_name "tell @a hello"
```

##### Export World:

```bash
bedrock-server-manager world export --server server_name_
```

##### Start the Web Server:

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

## Plugin Suport

Bedrock Server Manager features a powerful plugin system that allows you to extend and customize its functionality. Whether you want to add new automations, integrate with other services, or introduce custom server management logic, plugins provide the framework to do so.

**Key Capabilities:**

*   **Event Hooks:** Plugins can "listen" to various events within BSM (e.g., before a server starts, after a backup completes) and execute custom code in response.
*   **API Access:** Plugins have safe access to core BSM functions, allowing them to perform actions like starting/stopping servers, sending commands, and more.
*   **Custom Events:** Plugins can define and trigger their own events, enabling complex communication and collaboration between different plugins.

**Managing Plugins:**

You can manage your plugins directly from the command line:

*   List all plugins and their status: `bedrock-server-manager plugin list`
*   Enable a plugin: `bedrock-server-manager plugin enable <plugin_name>`
*   Disable a plugin: `bedrock_server-manager plugin disable <plugin_name>`
*   Reload all plugins: `bedrock-server-manager plugin reload`
*   Trigger custom events for plugins: `bedrock-server-manager plugin trigger_event <event_name> --payload-json '{...}'`

Running `bedrock-server-manager plugin` without a subcommand will launch an interactive plugin management menu.

**Developing Plugins:**

To learn how to create your own plugins, please refer to the comprehensive:

**[Plugin Docs](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/PLUGIN_API.md)**

This documentation covers everything from creating your first plugin, understanding the `PluginBase` class, using event hooks and the plugin API, to advanced topics like custom inter-plugin events.

## Install Content:

<div style="text-align: left;">
    <img src="https://raw.githubusercontent.com/DMedina559/bedrock-server-manager/main/docs/images/cli_install_content.png" alt="Install Worlds" width="300" height="200">
</div>

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 `CONTENT_DIR/worlds` or .mcpack/.mcaddon files in `CONTENT_DIR/addons`

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

```bash
bedrock-server-manager world install --server server_name --file '/path/to/WORLD.mcworld'
```

```bash
bedrock-server-manager install-addon --server server_name --file '/path/to/ADDON.mcpack'
```

## Web Server:

<div style="text-align: left;">
    <img src="https://raw.githubusercontent.com/DMedina559/bedrock-server-manager/main/docs/images/main_index.png" alt="Main Index" width="300" height="200">
</div>

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:

- Install New Server
- Configure various server config files such as allowlist and permissions
- Start/Stop/Restart Bedrock server
- Update/Delete Bedrock server
- Monitor resource usage
- Schedule cron/task
- Install world/addons
- Backup and Restore all or individual files/worlds

### Configure the Web Server:

#### Environment Variables:

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

- **BEDROCK_SERVER_MANAGER_USERNAME**: Required. Plain text username for web UI and API login. **The web server will not start if this is not set**

- **BEDROCK_SERVER_MANAGER_PASSWORD**: Required. Hashed password for web UI and API login. Use the generate-password utility. **The web server will not start if this is not set**

- **BEDROCK_SERVER_MANAGER_SECRET**:   Recommended. A long, random, secret string. If not set, a temporary key is generated, and web UI sessions will not persist across restarts, and will require reauthentication.

- **BEDROCK_SERVER_MANAGER_TOKEN**:    Recommended. A long, random, secret string (different from _SECRET). If not set, a temporary key is generated, and JWT tokens used for API authentication will become invalid across restarts. **JWT tokens expire every 4 weeks by default**

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:

```bash
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:

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

Example: specify all ipv4 and ipv6 addresses:

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

#### Port:

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

#### HTTP API:

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

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

- `BEDROCK_SERVER_MANAGER_TOKEN`: **REQUIRED** for token persistence across server restarts
- `BEDROCK_SERVER_MANAGER_USERNAME`: The username for API login.
- `BEDROCK_SERVER_MANAGER_PASSWORD`: The hashed password for API login

##### 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 expiration is configurable via `script_config.json` (default: 4 weeks).

###### `curl` Example (Bash):

```bash
curl -X POST -H "Content-Type: application/json" \
     -d '{"username": "your_username", "password": "your_password"}' \
     http://<your-manager-host>:<port>/api/login
```

###### PowerShell Example:

```powershell
$body = @{ username = 'your_username'; password = 'your_password' } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "http://<your-manager-host>:<port>/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):
```bash
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" \
     http://<your-manager-host>:<port>/api/server/<server_name>/stop
```

###### PowerShell Example:
```powershell
$headers = @{ Authorization = 'Bearer YOUR_JWT_TOKEN' }
Invoke-RestMethod -Method Post -Uri "http://<your-manager-host>:<port>/api/server/<server_name>/stop" -Headers $headers
```

- Send Command:

###### `curl` Example (Bash):
```bash
curl -X POST -H "Authorization: Bearer YOUR_JWT_TOKEN" -H "Content-Type: application/json" \
     -d '{"command": "say Hello from API!"}' \
     http://<your-manager-host>:<port>/api/server/<server_name>/send_command
```

###### PowerShell Example:
```powershell
$headers = @{ Authorization = 'Bearer YOUR_JWT_TOKEN'; 'Content-Type' = 'application/json' }
$body = @{ command = 'say Hello from API!' } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "http://<your-manager-host>:<port>/api/server/<server_name>/send_command" -Headers $headers -Body $body
```

For a complete list of endpoints see the [HTTP API Documentation](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/HTTP_API.md).

All documentation can also be found in the web server's footer `Docs` link.

## Disclaimers:

### Platform Differences:
- Windows suppport has the following limitations such as:
 - No attach to console support
 - No service integration

### Tested on these systems:
- Debian 12 (bookworm)
- Ubuntu 24.04
- Windows 11 24H2
- WSL2

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "bedrock-server-manager",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "minecraft, bedrock, server, manager, bsm, admin, dashboard, web, cli",
    "author": null,
    "author_email": "DMedina559 <dmedina559-github@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/77/0f/8962f312d814fac17b56b10a311c8d060d0377cd1901e9717c48f70fae1d/bedrock_server_manager-3.4.1.tar.gz",
    "platform": null,
    "description": "\ufeff\n<div style=\"text-align: center;\">\n    <img src=\"https://raw.githubusercontent.com/dmedina559/bedrock-server-manager/main/src/bedrock_server_manager/web/static/image/icon/favicon.svg\" alt=\"ICON\" width=\"200\" height=\"200\">\n</div> \n\n- [Bedrock Server Manager (BSM)](#bedrock-server-manager)\n  - [Features](#features)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n    - [Install The Package](#install-the-package)\n  - [Configuration](#configuration)\n    - [Setup The Configuration](#setup-the-configuration)\n      - [The following variables are configurable via json](#the-following-variables-are-configurable-via-json)\n  - [Usage](#usage)\n    - [Run the app](#run-the-app)\n  - [Install Content](#install-content)\n  - [Web Server](#web-server)\n    - [Configure the Web Server](#configure-the-web-server)\n      - [Environment Variables](#environment-variables)\n      - [Generate Password Hash](#generate-password-hash)\n      - [Hosts](#hosts)\n      - [Port](#port)\n      - [HTTP API](#http-api)\n        - [Obtaining a JWT token](#obtaining-a-jwt-token)\n        - [Using the API](#using-the-api)\n      - [Examples](#examples-1)\n  - [Disclaimers](#disclaimers)\n\n\n* [CHANGELOG](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/CHANGELOG.md)\n* [PLUGINS](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/PLUGIN_API.md)\n* [HTTP API](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/HTTP_API.md)\n* [EXTRAS](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/EXTRAS.md)\n\n# Bedrock Server Manager (BSM)\n\n<img alt=\"PyPI - Version\" src=\"https://img.shields.io/pypi/v/bedrock-server-manager?link=https%3A%2F%2Fpypi.org%2Fproject%2Fbedrock-server-manager%2F\"> <img alt=\"PyPI - Python Version\" src=\"https://img.shields.io/pypi/pyversions/bedrock-server-manager\"> <img alt=\"License\" src=\"https://img.shields.io/github/license/dmedina559/bedrock-server-manager\">\n\n\nBedrock Server Manager is a comprehensive python package designed for installing, managing, and maintaining Minecraft Bedrock Dedicated Servers with ease, and is Linux/Windows compatable.\n\n## Features\n\nInstall New Servers: Quickly set up a server with customizable options like version (LATEST, PREVIEW, or specific versions).\n\nUpdate Existing Servers: Seamlessly download and update server files while preserving critical configuration files and backups.\n\nBackup Management: Automatically backup worlds and configuration files, with pruning for older backups.\n\nServer Configuration: Easily modify server properties, and allow-list interactively.\n\nAuto-Update supported: Automatically update the server with a simple restart.\n\nCommand-Line Tools: Send game commands, start, stop, and restart servers directly from the command line.\n\nInteractive Menu: Access a user-friendly interface to manage servers without manually typing commands.\n\nInstall/Update Content: Easily import .mcworld/.mcpack files into your server.\n\nAutomate Various Server Task: Quickly create cron/task to automate task such as backup-server or restart-server.\n\nView Resource Usage: View how much CPU and RAM your server is using.\n\nWeb Server: Easily manage your Minecraft servers in your browser, even if you're on mobile!\n\nPlugin Support: Extend functionality with custom plugins that can listen to events, access the core app APIs, and trigger custom events.\n\n## Prerequisites\n\nThis app requires `Python 3.10` or later, and you will need `pip` installed\n\n## Installation\n\n### Install The Package:\n\n1. Run the command \n```bash\npip install bedrock-server-manager\n```\nSee the [EXTRAS](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/EXTRAS.md) for more information on installing stable, beta, and development versions of the app.\n\n## Configuration\n\n### Setup The Configuration:\n\nbedrock-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`\n\nFollow your platforms documentation for setting Enviroment Variables\n\nThe 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. \n\nCertain variables can can be changed directly in the `./.config/script_config.json`\n\n#### The following variables are configurable via json\n\n* `BASE_DIR`: Directory where servers will be installed\n* `CONTENT_DIR`: Directory where the app will look for addons/worlds\n* `DOWNLOAD_DIR`: Directory where servers will download\n* `BACKUP_DIR`: Directory where server backups will go\n* `LOG_DIR`: Directory where app logs will be saved\n* `BACKUP_KEEP`: How many backups to keep\n* `DOWNLOAD_KEEP`: How many server downloads to keep\n* `LOGS_KEEP`: How many logs to keep\n* `CLI_LOG_LEVEL`: Level for CLI logging.\n* `FILE_LOG_LEVEL`: Level for file logging.\n* `WEB_PORT`: Port used by the web server. 11325 by default\n* `TOKEN_EXPIRES_WEEKS`: How long JWT tokens are vaild for in weeks.\n\n## Usage\n\n<div style=\"text-align: left;\">\n    <img src=\"https://raw.githubusercontent.com/DMedina559/bedrock-server-manager/main/docs/images/cli_menu.png\" alt=\"CLI Menu\" width=\"300\" height=\"200\">\n</div>\n\nFor a complete list of commands, see [CLI_COMMANDS.md](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/CLI_COMMANDS.md)\n\n>Note: If you are using a version of the app prior to 3.3.0, you must run `bedrock-server-manager --help` to see the list of commands for your version.\n\n### Run the app:\n\n```bash\nbedrock-server-manager <command> [options]\n```\nor\n\n```bash\npython -m bedrock_server_manager <command> [options] # 3.3.0 and later\n```\n\n##### Examples:\n\n###### Open Main Menu:\n\n```bash\nbedrock-server-manager\n```\n\n###### Send Command:\n```bash\nbedrock-server-manager server send-command --server server_name \"tell @a hello\"\n```\n\n##### Export World:\n\n```bash\nbedrock-server-manager world export --server server_name_\n```\n\n##### Start the Web Server:\n\n```bash\nbedrock-server-manager web start --host 0.0.0.0 --host \"::\" --mode direct\n```\n\n## Plugin Suport\n\nBedrock Server Manager features a powerful plugin system that allows you to extend and customize its functionality. Whether you want to add new automations, integrate with other services, or introduce custom server management logic, plugins provide the framework to do so.\n\n**Key Capabilities:**\n\n*   **Event Hooks:** Plugins can \"listen\" to various events within BSM (e.g., before a server starts, after a backup completes) and execute custom code in response.\n*   **API Access:** Plugins have safe access to core BSM functions, allowing them to perform actions like starting/stopping servers, sending commands, and more.\n*   **Custom Events:** Plugins can define and trigger their own events, enabling complex communication and collaboration between different plugins.\n\n**Managing Plugins:**\n\nYou can manage your plugins directly from the command line:\n\n*   List all plugins and their status: `bedrock-server-manager plugin list`\n*   Enable a plugin: `bedrock-server-manager plugin enable <plugin_name>`\n*   Disable a plugin: `bedrock_server-manager plugin disable <plugin_name>`\n*   Reload all plugins: `bedrock-server-manager plugin reload`\n*   Trigger custom events for plugins: `bedrock-server-manager plugin trigger_event <event_name> --payload-json '{...}'`\n\nRunning `bedrock-server-manager plugin` without a subcommand will launch an interactive plugin management menu.\n\n**Developing Plugins:**\n\nTo learn how to create your own plugins, please refer to the comprehensive:\n\n**[Plugin Docs](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/PLUGIN_API.md)**\n\nThis documentation covers everything from creating your first plugin, understanding the `PluginBase` class, using event hooks and the plugin API, to advanced topics like custom inter-plugin events.\n\n## Install Content:\n\n<div style=\"text-align: left;\">\n    <img src=\"https://raw.githubusercontent.com/DMedina559/bedrock-server-manager/main/docs/images/cli_install_content.png\" alt=\"Install Worlds\" width=\"300\" height=\"200\">\n</div>\n\nEasily import addons and worlds into your servers. The app will look in the configured `CONTENT_DIR` directories for addon files.\n\nPlace .mcworld files in `CONTENT_DIR/worlds` or .mcpack/.mcaddon files in `CONTENT_DIR/addons`\n\nUse the interactive menu to choose which file to install or use the command:\n\n```bash\nbedrock-server-manager world install --server server_name --file '/path/to/WORLD.mcworld'\n```\n\n```bash\nbedrock-server-manager install-addon --server server_name --file '/path/to/ADDON.mcpack'\n```\n\n## Web Server:\n\n<div style=\"text-align: left;\">\n    <img src=\"https://raw.githubusercontent.com/DMedina559/bedrock-server-manager/main/docs/images/main_index.png\" alt=\"Main Index\" width=\"300\" height=\"200\">\n</div>\n\nBedrock 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!\n\nThe web ui has full parity with the CLI. With the web server you can:\n\n- Install New Server\n- Configure various server config files such as allowlist and permissions\n- Start/Stop/Restart Bedrock server\n- Update/Delete Bedrock server\n- Monitor resource usage\n- Schedule cron/task\n- Install world/addons\n- Backup and Restore all or individual files/worlds\n\n### Configure the Web Server:\n\n#### Environment Variables:\n\nTo get started using the web server you must first set these environment variables:\n\n- **BEDROCK_SERVER_MANAGER_USERNAME**: Required. Plain text username for web UI and API login. **The web server will not start if this is not set**\n\n- **BEDROCK_SERVER_MANAGER_PASSWORD**: Required. Hashed password for web UI and API login. Use the generate-password utility. **The web server will not start if this is not set**\n\n- **BEDROCK_SERVER_MANAGER_SECRET**:   Recommended. A long, random, secret string. If not set, a temporary key is generated, and web UI sessions will not persist across restarts, and will require reauthentication.\n\n- **BEDROCK_SERVER_MANAGER_TOKEN**:    Recommended. A long, random, secret string (different from _SECRET). If not set, a temporary key is generated, and JWT tokens used for API authentication will become invalid across restarts. **JWT tokens expire every 4 weeks by default**\n\nFollow your platform's documentation for setting Environment Variables\n\n#### Generate Password Hash:\n\nFor the web server to start you must first set the BEDROCK_SERVER_MANAGER_PASSWORD environment variable\n\nThis must be set to the password hash and NOT the plain text password\n\nUse the following command to generate a password:\n\n```bash\nbedrock-server-manager generate-password\n```\nFollow the on-screen prompt to hash your password\n\n#### Hosts:\n\nBy Default Bedrock Server Manager will only listen to local host only interfaces `127.0.0.1` and `[::1]`\n\nTo change which host to listen to start the web server with the specified host\n\nExample: specify local host only ipv4 and ipv6:\n\n```bash\nbedrock-server-manager web start --host 127.0.0.1 --host \"::1\"\n```\n\nExample: specify all ipv4 and ipv6 addresses:\n\n```bash\nbedrock-server-manager web start --host 0.0.0.0 --host \"::\"\n```\n\n#### Port:\n\nBy default Bedrock Server Manager will use port `11325`. This can be change in script_config.json\n\n#### HTTP API:\n\nAn HTTP API is provided allowing tools like `curl` or `Invoke-RestMethod` to interact with server.\n\nBefore using the API, ensure the following environment variables are set on the system running the app:\n\n- `BEDROCK_SERVER_MANAGER_TOKEN`: **REQUIRED** for token persistence across server restarts\n- `BEDROCK_SERVER_MANAGER_USERNAME`: The username for API login.\n- `BEDROCK_SERVER_MANAGER_PASSWORD`: The hashed password for API login\n\n##### Obtaining a JWT token:\n\nThe API endpoints require authentication using a JSON Web Token (JWT).\nHow: Obtain a token by sending a POST request to the `/api/login` endpoint.\nRequest Body: Include a JSON payload with username and password keys, matching the values set in the environment variables.\n\n```\n{\n    \"username\": \"username\",\n    \"password\": \"password\"\n}\n```\n\nResponse: On success, the API returns a JSON object containing the access_token:\n```\n{\n    \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\"\n}\n```\n\nTokens expiration is configurable via `script_config.json` (default: 4 weeks).\n\n###### `curl` Example (Bash):\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" \\\n     -d '{\"username\": \"your_username\", \"password\": \"your_password\"}' \\\n     http://<your-manager-host>:<port>/api/login\n```\n\n###### PowerShell Example:\n\n```powershell\n$body = @{ username = 'your_username'; password = 'your_password' } | ConvertTo-Json\nInvoke-RestMethod -Method Post -Uri \"http://<your-manager-host>:<port>/api/login\" -Body $body -ContentType 'application/json'\n```\n\n##### Using the API\n\nEndpoints requiring authentication will need the obtained access_token included  in the Authorization header of your requests:\n\n```\n\"Authorization: Bearer YOUR_JWT_TOKEN\"\n```\n\nFor requests sending data (like POST or PUT), set the Content-Type header to `application/json`.\n\n#### Examples:\n\n- Start server:\n\n###### `curl` Example (Bash):\n```bash\ncurl -X POST -H \"Authorization: Bearer YOUR_JWT_TOKEN\" \\\n     http://<your-manager-host>:<port>/api/server/<server_name>/stop\n```\n\n###### PowerShell Example:\n```powershell\n$headers = @{ Authorization = 'Bearer YOUR_JWT_TOKEN' }\nInvoke-RestMethod -Method Post -Uri \"http://<your-manager-host>:<port>/api/server/<server_name>/stop\" -Headers $headers\n```\n\n- Send Command:\n\n###### `curl` Example (Bash):\n```bash\ncurl -X POST -H \"Authorization: Bearer YOUR_JWT_TOKEN\" -H \"Content-Type: application/json\" \\\n     -d '{\"command\": \"say Hello from API!\"}' \\\n     http://<your-manager-host>:<port>/api/server/<server_name>/send_command\n```\n\n###### PowerShell Example:\n```powershell\n$headers = @{ Authorization = 'Bearer YOUR_JWT_TOKEN'; 'Content-Type' = 'application/json' }\n$body = @{ command = 'say Hello from API!' } | ConvertTo-Json\nInvoke-RestMethod -Method Post -Uri \"http://<your-manager-host>:<port>/api/server/<server_name>/send_command\" -Headers $headers -Body $body\n```\n\nFor a complete list of endpoints see the [HTTP API Documentation](https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/HTTP_API.md).\n\nAll documentation can also be found in the web server's footer `Docs` link.\n\n## Disclaimers:\n\n### Platform Differences:\n- Windows suppport has the following limitations such as:\n - No attach to console support\n - No service integration\n\n### Tested on these systems:\n- Debian 12 (bookworm)\n- Ubuntu 24.04\n- Windows 11 24H2\n- WSL2\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A manager for Minecraft Bedrock Dedicated Servers",
    "version": "3.4.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/DMedina559/bedrock-server-manager/issues",
        "Changelog": "https://github.com/DMedina559/bedrock-server-manager/blob/main/docs/CHANGELOG.md",
        "Repository": "https://github.com/dmedina559/bedrock-server-manager.git"
    },
    "split_keywords": [
        "minecraft",
        " bedrock",
        " server",
        " manager",
        " bsm",
        " admin",
        " dashboard",
        " web",
        " cli"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5ce3396db3cff8c5d79f1d2fce1c4d8bb38801de8633c1c2703135a60b864896",
                "md5": "ca2cdfcabe17eeb5229eeb3273a93a4c",
                "sha256": "393f55e4a7f7028d12fb643994416419562af5ca6270abad535b4b9eda99bd1a"
            },
            "downloads": -1,
            "filename": "bedrock_server_manager-3.4.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ca2cdfcabe17eeb5229eeb3273a93a4c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 991019,
            "upload_time": "2025-06-25T16:28:35",
            "upload_time_iso_8601": "2025-06-25T16:28:35.689877Z",
            "url": "https://files.pythonhosted.org/packages/5c/e3/396db3cff8c5d79f1d2fce1c4d8bb38801de8633c1c2703135a60b864896/bedrock_server_manager-3.4.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "770f8962f312d814fac17b56b10a311c8d060d0377cd1901e9717c48f70fae1d",
                "md5": "33e4ac2cd9f9928c40f5c890bfdd967f",
                "sha256": "0d5654cff04518629797b11ff389cca49d30c2639665bb37a2f067c85f54834e"
            },
            "downloads": -1,
            "filename": "bedrock_server_manager-3.4.1.tar.gz",
            "has_sig": false,
            "md5_digest": "33e4ac2cd9f9928c40f5c890bfdd967f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 903710,
            "upload_time": "2025-06-25T16:28:37",
            "upload_time_iso_8601": "2025-06-25T16:28:37.493179Z",
            "url": "https://files.pythonhosted.org/packages/77/0f/8962f312d814fac17b56b10a311c8d060d0377cd1901e9717c48f70fae1d/bedrock_server_manager-3.4.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-06-25 16:28:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DMedina559",
    "github_project": "bedrock-server-manager",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "bedrock-server-manager"
}
        
Elapsed time: 1.90263s