Sign inSign up

basictheprogram/crossfire-phpbb3

By basictheprogram

•Updated 11 days ago

Docker image for phpBB3 on Apache with PHP 8.4 and ImageMagick — self-hosted forum on Debian Trixi

Image
Content management system
0

3.0K

basictheprogram/crossfire-phpbb3 repository overview

⁠Docker image for phpBB3

⁠What is phpBB?

phpBB is a popular open-source bulletin board that features robust messaging capabilities: flat message structure, subforums, topic split/merge/lock, user groups, full-text search, and attachments.

⁠About this image

This image provides a Docker-based deployment for phpBB3 on Apache with PHP 8.4 (Debian Trixie). It was originally created for the Crossfire Forums but the packaging is general-purpose and not specific to that deployment.

Key differences from the official phpBB distribution:

  • Multi-stage build: extensions and PECL packages compiled in a cli builder stage; only runtime libraries copied into the apache final stage
  • ImageMagick (via imagick PECL extension) and GD enabled
  • opcache tuned for production
  • mod_remoteip configured for reverse-proxy deployments

This image does not auto-provision phpBB from environment variables the way some other packaged images do. phpBB is configured through its own web-based installer on first run — see First-time setup⁠.

⁠TL;DR

docker run --name phpbb basictheprogram/crossfire-phpbb3:latest

Warning

This quick setup is for development only. Change default credentials before any production use.

⁠Prerequisites

Docker Engine 20.10 or later. Docker Compose v2 recommended.

⁠Get this image

Pull from Docker Hub:

docker pull basictheprogram/crossfire-phpbb3:latest

Pull a specific version:

docker pull basictheprogram/crossfire-phpbb3:[TAG]

Tags follow the phpBB3 upstream version. CI publishes:

  • latest and <version> (e.g. 3.3.19) on pushes to main
  • devel-<version> on pushes to devel
  • <commit-sha> on every push

Available tags: https://hub.docker.com/repository/docker/basictheprogram/crossfire-phpbb3/tags⁠

Build locally:

git clone https://github.com/crossfire-projects/docker-phpbb.git
cd docker-phpbb
docker build -t crossfire-phpbb3 php/

⁠How to use this image

phpBB3 requires a MySQL or MariaDB database. Use Docker Compose to run both together:

docker compose up -d

Copy .env.sample⁠ to .env and fill in real values first — compose.yml reads its database and Traefik settings from there.

⁠First-time setup

This image does not auto-provision phpBB from environment variables. On first run, phpBB's own installer is still present in the image; the PHPBB_DATABASE_* values in compose.yml are not read by anything in the image; they're there so you have one place to keep the values consistent with what you type into the installer.

  1. docker compose up -d
  2. Browse to http://<host>/install/ and complete phpBB's installer (database connection, admin account, forum name, etc.)
  3. Once the installer writes config.php (persisted on the phpbb_config volume), the container's entrypoint automatically removes the install/ directory the next time it starts — restart the phpbb container to trigger that
  4. SMTP and other forum settings are configured afterward through phpBB's own Admin Control Panel (ACP), not environment variables

⁠Persisting your application

compose.yml already defines named volumes for the database and every phpBB directory that needs to survive a container recreate:

services:
  mysql:
    volumes:
      - phpbb-mysql-data:/var/lib/mysql
  phpbb:
    volumes:
      - phpbb_config:/config-volume       # config.php (DB credentials)
      - phpbb_files:/var/www/html/phpBB3/files
      - phpbb_images:/var/www/html/phpBB3/images
      - phpbb_store:/var/www/html/phpBB3/store
      - phpbb_ext:/var/www/html/phpBB3/ext
      - phpbb_styles_crossfire:/var/www/html/phpBB3/styles/crossfire

Without these volumes, all data is lost when the container is removed.

Note what's not covered: the rest of styles/ (including the stock Prosilver style) isn't persisted, so any change made directly to styles/prosilver/... is lost on the next rebuild — this is what happened in issue #7⁠. For custom branding (a logo, colors, etc.), create a child style that inherits from Prosilver — e.g. one named crossfire — through phpBB's ACP (Customise → Styles → Manage styles), and set it as the default style. Files under a child style's own directory land on the phpbb_styles_crossfire volume and survive upgrades; the stock prosilver style stays upgradable.

⁠Configuration

⁠Environment variables

Only these are actually read by something in this repo. See .env.sample⁠ for the full list with example values.

NameRead byDescription
MYSQL_ROOT_PASSWORDmysql container (official image)MySQL root password.
MYSQL_HOSTmysql containerHostname the mysql container advertises.
MYSQL_HOST_PORTmysql containerHost-side port mapped to MySQL. Default 3306.
MYSQL_DATABASEmysql containerDatabase created on first boot.
MYSQL_USERmysql containerNon-root MySQL user created on first boot.
MYSQL_PASSWORDmysql containerPassword for MYSQL_USER.
ALLOW_EMPTY_PASSWORDmysql and phpbb containersAllow an empty MySQL root password. Default no.
PHPBB_DATABASE_HOSTnot read by the imageFor your own reference; type the same value into phpBB's installer.
PHPBB_DATABASE_PORT_NUMBERnot read by the imageSame.
PHPBB_DATABASE_NAMEnot read by the imageSame.
PHPBB_DATABASE_USERnot read by the imageSame.
PHPBB_DATABASE_PASSWORDnot read by the imageSame.
APACHE_SERVER_ADMINphp/Dockerfile build ARG, not runtimeBakes the Apache ServerAdmin address in at build time. The published Docker Hub image is built without this set, so it's a no-op unless you build the image yourself with --build-arg APACHE_SERVER_ADMIN=....
DOMAINtraefik/compose.ymlPassed into the traefik container's environment.
TZall containersContainer timezone.
SYSLOG_ADDRESScompose.yml, traefik/compose.ymlRemote syslog endpoint for container logs.

⁠Logging

Container logs go to stdout:

docker compose logs phpbb

⁠Maintenance

⁠Backup
docker compose stop phpbb
docker run --rm \
  -v /path/to/phpbb-backups:/backups \
  --volumes-from phpbb \
  busybox cp -a /var/www/html/phpBB3 /backups/latest
⁠Upgrade
  1. Pull the new image tag
  2. Stop the running container
  3. Take a backup (see above)
  4. Update the image tag in compose.yml
  5. docker compose up -d

⁠Extend this image

FROM basictheprogram/crossfire-phpbb3:latest
USER 0
RUN apt-get update && apt-get install -y --no-install-recommends vim \
    && rm -rf /var/lib/apt/lists/*
USER www-data

⁠Third-party software

This image downloads and ships phpBB3, which is distributed under the GNU General Public License, Version 2⁠.

The GPL v2 requires that the phpBB3 source be made available to recipients of this image. The unmodified phpBB3 source is available at the upstream GitHub repository linked above. This project's own files (Dockerfile, scripts, configuration) are licensed separately under the MIT License — see LICENSE.md⁠.

⁠Author

Bob Tanner⁠, maintained by Rick Tanner⁠.

⁠License

This project's own files (Dockerfile, scripts, configuration) are licensed under the MIT License — see LICENSE.md⁠. phpBB3 itself is distributed separately under GPL v2 — see Third-party software⁠.

⁠Issues

File an issue at https://github.com/crossfire-projects/docker-phpbb/issues⁠.

Tag summary

Content type

Image

Digest

sha256:2b4c48fc0…

Size

192 MB

Last updated

11 days ago

docker pull basictheprogram/crossfire-phpbb3