Skip to main content

Pre-requisites

Before building PocketMine-MP, ensure you have the following installed:
  • A bash shell (git bash is sufficient for Windows)
  • git available in your shell
  • PHP 8.2 or newer available in your shell
  • composer available in your shell

Custom PHP Binaries

Because PocketMine-MP requires several non-standard PHP extensions and configuration, PMMP provides scripts to build custom binaries for running PocketMine-MP, as well as prebuilt binaries.
If you use a custom binary, you’ll need to replace composer usages in this guide with path/to/your/php path/to/your/composer.phar.

Setting Up Environment

1

Clone the repository

git clone https://github.com/pmmp/PocketMine-MP.git
2

Install dependencies

composer install

Checking Out a Different Branch

1

Checkout the branch

git checkout <branch to checkout>
2

Synchronize dependencies

Re-run composer install to synchronize dependencies:
composer install

Building PocketMine-MP.phar

Run composer make-server using your preferred PHP binary. It’ll drop a PocketMine-MP.phar into the current working directory.
composer make-server
You can also use the --out option to change the output filename:
composer make-server -- --out MyServer.phar

Optimizing for Release Builds

For production deployments, add the flags --no-dev --classmap-authoritative to your composer install command. This will reduce build size and improve autoloading speed.
composer install --no-dev --classmap-authoritative

Running PocketMine-MP from Source Code

You can run PocketMine-MP directly from source without building a phar:
php src/PocketMine.php
This is useful during development as you can make changes and test them immediately without rebuilding the phar.

Build docs developers (and LLMs) love