Development stack (PHP interpreter, web server, database server) for the MyBB forum software. Not for production use.
-
Install Docker Desktop (or Docker Engine + Docker Compose).
-
Clone/download this repository on your computer, placing it next to the MyBB source code directory (which can be a cloned
mybb/mybb
repository):. ├── mybb/ └── deploy/
-
In the
deploy/
directory, run:docker compose up
Once the services are running, MyBB should be available at
http://localhost:8080
.
The following database engines are available for MyBB installation:
- PostgreSQL (enabled by default):
- Database Host:
postgresql
- Database Name:
mybb
- Database User:
mybb
- Database Password:
mybb
- Database Host:
- MySQL:
- Database Host:
mysql
- Database Name:
mybb
- Database User:
mybb
- Database Password:
mybb
- Database Host:
- SQLite (if supported by the PHP configuration)
By default, only the PostgreSQL service is started. To start the MySQL service, include the db.mysql
profile in the .env
file:
COMPOSE_PROFILES=db.mysql
and restart.
To switch the PHP version, change it in the .env
file (see available X.Y versions):
PHP_VERSION=7.4
and restart the container with docker compose up -d
.
To use PHP versions not available in the pre-built images, but included in an official PHP base image, change the PHP_IMAGE
variable to custom
in the .env
file:
PHP_IMAGE=custom
PHP_VERSION=8.1.0RC2
and build the image using
docker compose build
and restart.
The following variables can be set in the .env
file:
Name | Default | Description |
---|---|---|
SOURCE_PATH |
../mybb |
Path to served files |
PHP_IMAGE |
prebuilt |
Base image for the PHP service (prebuilt or custom ) |
PHP_VERSION |
8.2 |
PHP version to use. Depends on available base images |
COMPOSER_NO_DEV |
1 |
Equivalent to --no-dev for composer install when set to 1 |
XDEBUG |
1 |
Whether to install Xdebug when building a custom PHP image |
XDEBUG_VERSION |
empty string | Which version of the Xdebug Pecl package to install when building a custom PHP image (see compatibility) |
NGINX_PUBLISHED_PORT |
8080 |
The port accessible from the host machine |
POSTGRESQL_PUBLISHED_PORT |
6432 |
The port accessible from the host machine |
MYSQL_PUBLISHED_PORT |
4306 |
The port accessible from the host machine |
COMPOSE_PROFILES |
db.postgresql,composer,install |
- database service (postgresql or mysql )- auto-install Composer dependencies -auto-install MyBB (≥ 1.9) |
MYBB_DEV_MODE |
1 |
Enable MyBB's development mode when set to 1 |