Lightweight Alpine-based phpBB image with nginx and PHP 8.4 FPM.
Bundled phpBB 3.3.17 with support for SQLite, MariaDB/MySQL (mysqli), and PostgreSQL.
The included compose.yml runs phpBB with MariaDB LTS:
$ docker compose up -d --buildOpen http://127.0.0.1:8000. For a fresh install, start once with the installer enabled:
$ PHPBB_INSTALL=true docker compose up --buildDuring installation, use these database settings:
| Field | Value |
|---|---|
| Database type | MySQL with MySQLi Extension |
| Database server | mariadb |
| Database name | phpbb (or your MARIADB_DATABASE) |
| Username | phpbb (or your MARIADB_USER) |
| Password | phpbb (or your MARIADB_PASSWORD) |
Default MariaDB credentials can be overridden with environment variables:
MARIADB_ROOT_PASSWORD(default:changeme)MARIADB_DATABASE(default:phpbb)MARIADB_USER(default:phpbb)MARIADB_PASSWORD(default:phpbb)
After installation, restart without PHPBB_INSTALL so the install/ directory is removed on startup. Optionally enable automatic migrations:
$ docker compose up -d
$ PHPBB_DB_AUTOMIGRATE=true docker compose up -dWhen PHPBB_INSTALL is not set in the environment, the startup script deletes install/ automatically.
Build and run the image without Compose:
$ docker build -t phpbb .
$ docker run -p 8000:80 --name phpbb-install -e PHPBB_INSTALL=true -d phpbbBy default the standalone image uses SQLite. Set the DSN field to /phpbb/sqlite/sqlite.db during installation and leave username, password, and database name blank.
For an external database:
$ docker run --name phpbb \
-e PHPBB_DB_DRIVER=mysqli \
-e PHPBB_DB_HOST=dbhost \
-e PHPBB_DB_PORT=3306 \
-e PHPBB_DB_NAME=phpbb \
-e PHPBB_DB_USER=phpbb \
-e PHPBB_DB_PASSWD=pass \
-p 8000:80 -d phpbbMost variables are written into phpBB's config.php or read by the startup script.
If true, removes config.php and keeps the /install/ directory for a fresh setup.
Supported drivers in this image: sqlite3, mysqli, postgres.
Default: sqlite3
Database hostname, or SQLite file path for the sqlite3 driver.
Default: /phpbb/sqlite/sqlite.db
Database port (required for PHPBB_DB_WAIT with network databases).
Database credentials.
Default: phpbb_
If true, runs bin/phpbbcli.php db:migrate on startup. Requires an existing database schema.
If true, waits for the database host/port to accept connections before running migrations. Not used with SQLite.
Enable phpBB debug and diagnostics output when set to true.
Persistent data paths:
/phpbb/www/files/phpbb/www/store/phpbb/www/images/avatars/upload/phpbb/sqlite(SQLite only)
$ ./update.sh 3.3This updates PHPBB_VERSION and its checksum in the Dockerfile.
Drop PHP settings into /usr/local/etc/php/conf.d and nginx site config into /etc/nginx/http.d by extending the image:
FROM your-image/phpbb:latest
COPY custom.ini /usr/local/etc/php/conf.d/
COPY custom.conf /etc/nginx/http.d/To pass the client IP through a reverse proxy, configure nginx real_ip directives in a custom server block.