Codync
A free, open-source 1:1 alternative to Grok Bot and Muse. Message Claude Code, Codex, Cursor and 40+ coding agents as persistent bots from your iPhone, Mac or Linux desktop. Group chats, threads, appr
A modern Docker image for phpBB
Translation pending
Developer toolsGitHub @EvanDarwinOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Repository information has not been collected yet.
No updates detected yet. GitHub releases will appear here.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗Looking for a modern, secure, and hassle-free way to run phpBB in Docker? You've found it! This image offers a thoughtfully pre-configured phpBB environment that's ready for production use with minimal setup.
All tags have been re-released to address several serious issues. First, the issues:
/opt/phpbb/ was never actually declared as a volumeX-Forwarded-For from all internal IPs, and now requires TRUSTED_PROXIESUpgrades your board automatically, after writing a backup.
See How Upgrades Work.
Stops trusting X-Forwarded-For by default. If a reverse proxy (nginx, Traefik, Caddy,
Cloudflare, ...) sits in front of your forum, you must set TRUSTED_PROXIES to its address
range, or to the string cloudflare. Unless you do, phpBB will see the Docker proxy's address for
every visitor, so IP information and per-IP login limits will apply to everyone. If the proxy is
another container, you can trust its whole Docker network instead, as long as the forum's port
isn't also published.
Warns about weak admin passwords. Older images generated admin passwords far shorter than
intended. If your board was created by one of them and you don't set PHPBB_PASSWORD, the log
shows a SECURITY WARNING on every start. Change the admin password in the User Control Panel
(Profile > Edit account settings), then silence the warning:
docker exec <container> rm /opt/phpbb/phpbb/.change-admin-password
Stops using phpBB's code on your volume. phpBB's code now lives read-only inside the image, at
/var/www/phpbb. From your volume, the image uses only your board's data (see
Data Persistence). Everything else the older images put in
/opt/phpbb/phpbb/ is left untouched but no longer used, and you can delete it once the upgrade
has succeeded:
adm/, assets/, bin/, cache/, config/ (the folder, not config.php), docs/,
download/, includes/, phpbb/, vendor/app.php, common.php, composer.json, composer.lock, cron.php, faq.php,
feed.php, index.php, mcp.php, memberlist.php, posting.php, report.php, search.php,
ucp.php, viewforum.php, viewonline.php, viewtopic.php, web.configStops applying edits to phpBB's own code. If you patched phpBB's PHP files, or added files
next to index.php (a custom page, robots.txt, a site verification file), they stay on your
volume but are no longer used or served. Move them into a derived image; see
Customizing phpBB.
Disables the web installer. /install/ answers 403. Installs and upgrades run automatically
from the command line inside the container.
This issue only applies if you used the container without mounting a volume to /opt/phpbb -
removing a container deletes everything stored inside it, so check before you update:
docker inspect -f '{{range .Mounts}}{{println .Name .Destination}}{{end}}' <container>
If a line ends in /opt/phpbb, your data is on a volume, and you can update as usual.
If none does, you DID NOT provide a -v phpbb_data:/opt/phpbb argument in some form, quickly
back it up before you update (and properly mount a volume this time).
docker cp <container>:/opt/phpbb ./phpbb-backup
From v2 on, /opt/phpbb is declared as a volume, so Docker always stores it outside the container.
Previous values are still respected and this change does not affect that configuration.
This change is directed at avoiding data loss for new installs.
This image was created after Bitnami / Broadcom deprecated their official phpBB container; as a modern alternative that prioritizes:
exec and shell_execopen_basedir restrictions to limit file accessThe recommended method for running this image is via Docker Compose, as it makes upgrading between tags much easier.
services:
phpbb:
image: evandarwin/phpbb:3
ports:
# Only the host's reverse proxy can reach the forum
- '127.0.0.1:8080:8080'
environment:
- PHPBB_FORUM_NAME=My Amazing Forum
- PHPBB_FORUM_DESCRIPTION=Welcome to my phpBB forum
- PHPBB_USERNAME=admin
- PHPBB_PASSWORD={admin_password}
- [email protected]
- PHPBB_DATABASE_DRIVER=mysqli
- PHPBB_DATABASE_HOST=mysql
- PHPBB_DATABASE_NAME=phpbb
- PHPBB_DATABASE_USER=phpbb
- PHPBB_DATABASE_PASSWORD={database_password}
- SERVER_NAME=forums.example.com
- SERVER_PROTOCOL=https://
- COOKIE_SECURE=true
# The host's reverse proxy connects from the gateway of the network below
- TRUSTED_PROXIES=172.30.0.1
volumes:
- phpbb_data:/opt/phpbb
depends_on:
- mysql
restart: unless-stopped
mysql:
image: mysql:8.0
environment:
- MYSQL_ROOT_PASSWORD={root_password}
- MYSQL_DATABASE=phpbb
- MYSQL_USER=phpbb
- MYSQL_PASSWORD={database_password}
volumes:
- mysql_data:/var/lib/mysql
restart: unless-stopped
healthcheck:
test: ['CMD-SHELL', 'mysqladmin ping -h localhost -u root -p"$$MYSQL_ROOT_PASSWORD"']
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
networks:
default:
ipam:
config:
- subnet: 172.30.0.0/24
volumes:
phpbb_data:
mysql_data:
For PostgreSQL, set PHPBB_DATABASE_DRIVER=postgres and PHPBB_DATABASE_HOST=postgres, and replace
the MySQL service with:
postgres:
image: postgres:15
environment:
- POSTGRES_PASSWORD={database_password}
- POSTGRES_USER=phpbb
- POSTGRES_DB=phpbb
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'phpbb']
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
Start it with docker compose up -d. Once the install finishes (a few seconds), log in as admin
with your {admin_password}. Leave PHPBB_PASSWORD out to have one generated instead: the log
shows it once, right after the install.
docker run -d \
--name phpbb \
-p 127.0.0.1:8080:8080 \
-v phpbb_data:/opt/phpbb \
-e PHPBB_FORUM_NAME="My Awesome Forum" \
-e TRUSTED_PROXIES=172.17.0.1 \
evandarwin/phpbb:3
The container will log the generated admin password, once - so write it down somewhere!
By default, it uses SQLite stored on the volume, but for Kubernetes or multi-container installs you'll likely want to read Real-World Examples for true MySQL and PostgreSQL installs.
latest - Latest phpBB version with all the good stuff<version> - Specific phpBB version (e.g., 3.3.19)<major>.<minor> - Latest patch version of a minor release (e.g., 3.3)<major> - Latest minor.patch version of a major release (e.g., 3)All images are built on Alpine Linux 3.24: phpBB 3.x with PHP 8.4 (nobody's complained yet).
The first start installs phpBB and creates an admin account from PHPBB_USERNAME (default admin)
and PHPBB_PASSWORD.
PHPBB_PASSWORD is empty, a random 12-character password (from every printable ASCII character
except space) is generated and shown once in the log, in a framed block right after the
install. Save it then; it is never shown again.PHPBB_PASSWORD, including quotes and symbols. phpBB requires 6 to 30
characters, and counts & as 5, < and > as 4, and " as 6 characters toward that limit.Except for the proxy, header, debug and PHP settings, which are read on every start, these are only
read when phpBB is first installed. To change them on an existing board, use phpBB's Administration
Control Panel. The database settings are the exception: phpBB keeps them in
/opt/phpbb/phpbb/config.php, so change them there, and keep the variables matching, because the
image uses them on every start to check that the database is reachable.
| Variable | Description | Default |
|---|---|---|
PHPBB_FORUM_NAME | Name of the forum | "My phpBB Forum" |
PHPBB_FORUM_DESCRIPTION | Description of the forum | "A phpBB Forum" |
PHPBB_LANGUAGE | Language for the board (phpBB ships with en) | "en" |
| Variable | Description | Default |
|---|---|---|
PHPBB_USERNAME | Username for the administrative user | "admin" |
PHPBB_PASSWORD | Password for the admin user | "" (auto-generated if empty) |
PHPBB_EMAIL | Admin user email | "[email protected]" |
| Variable | Description | Default |
|---|---|---|
PHPBB_DATABASE_DRIVER | sqlite3, mysqli (MySQL and MariaDB) or postgres | "sqlite3" |
PHPBB_DATABASE_HOST | Database host address | "localhost" |
PHPBB_DATABASE_PORT | Database port | "" (uses default port) |
PHPBB_DATABASE_NAME | Database name | "phpbb" |
PHPBB_DATABASE_USER or PHPBB_DATABASE_USERNAME | Database username | "phpbb_user" |
PHPBB_DATABASE_PASSWORD or PHPBB_DATABASE_PASS | Database password | "" |
PHPBB_DATABASE_SQLITE_PATH | SQLite database file; must be under /opt/phpbb (see SQLite) | "/opt/phpbb/phpbb.sqlite" |
PHPBB_TABLE_PREFIX | Prefix for database tables | "phpbb_" |
| Variable | Description | Default |
|---|---|---|
SMTP_HOST | SMTP server address; enables SMTP | "" (disabled) |
SMTP_PORT | SMTP server port | "25" |
SMTP_USER | SMTP username | "" |
SMTP_PASSWORD | SMTP password | "" |
SMTP_AUTH | SMTP authentication method | "" |
| Variable | Description | Default |
|---|---|---|
SERVER_PROTOCOL | Server protocol (http:// or https://) | "http://" |
SERVER_NAME | Server hostname | "localhost" |
SERVER_PORT | Server port, 1 to 65535 | "8080" |
SCRIPT_PATH | Base path for the phpBB installation | "/" |
COOKIE_SECURE | Whether to use secure cookies: true or false | "false" |
| Variable | Description | Default |
|---|---|---|
TRUSTED_PROXIES | Proxies whose X-Forwarded-For gives the visitor's address: addresses or ranges, separated by spaces or commas, also recognizes cloudflare as a value, to use Cloudflare's pre-published ranges | "" (trusts none) |
CONTENT_SECURITY_POLICY | Replaces the image's Content-Security-Policy header; can't contain double quotes, backslashes, $ or line breaks | "" (the image's own) |
| Variable | Description | Default |
|---|---|---|
PHPBB_DEBUG | true runs phpBB in debug mode, which shows errors, stack traces and page timings to visitors; for troubleshooting only | "false" |
| Variable | Description | Default |
|---|---|---|
PHP_MEMORY_LIMIT | PHP's memory_limit | "128M" |
PHP_CUSTOM_INI | php.ini lines (multiple lines), applied after PHP_MEMORY_LIMIT and can override it | "" |
Mount one named volume (or host directory) at /opt/phpbb. Everything important and mutable your
board writes lives there:
/opt/phpbb/
├── phpbb.sqlite SQLite database (when using SQLite at the default path)
├── backups/ backups written before each upgrade (created by the first one)
└── phpbb/
├── config.php
├── files/ attachments
├── images/ including uploaded avatars
├── ext/ extensions
├── styles/
├── language/
├── store/
└── .phpbb-dist-base/ phpBB's originals of its bundled files, for merging upgrades
In the Quick Start, that's the phpbb_data volume:
volumes:
- phpbb_data:/opt/phpbb
The logs live in /var/log/phpbb, outside the volume; mount that separately to keep them (see
Accessing Logs).
The container runs as UID 100 and GID 101 unless you give it another user with --user (user: in
Compose), for example to match the owner of a host directory. /opt/phpbb must be writable by that
user; when it isn't, the log says so and gives the command that fixes it.
On every start, the image compares the phpBB version recorded in your board's database with its own.
When the image is newer, it upgrades the board:
/opt/phpbb/phpbb/.phpbb-dist-base/, or, for boards made by the older images, in
/usr/share/phpbb-legacy-base/ inside the image./opt/phpbb/backups/phpbb-<old version>-<time>.zip: everything on the
volume (except earlier backups and the merge originals) plus, for MySQL and PostgreSQL, a dump of
the database in database/database.sql. If the dump fails, the backup holds the files only and
the log says so.When the image is older than the database, it refuses to start: downgrades aren't supported. Restore a backup instead.
When the database can't be reached, the board starts anyway without upgrading, and the log says so. The next start that reaches the database runs the upgrade.
The zip holds the contents of /opt/phpbb as they were before the upgrade, including phpbb.sqlite
for SQLite boards. For MySQL and PostgreSQL, database/database.sql is made with phpBB's own backup
code and restores into an empty database:
mysql -u phpbb -p phpbb_restored < database.sql
psql -v ON_ERROR_STOP=1 -U phpbb -d phpbb_restored < database.sql
Styles, templates, language packs and images: edit them on the volume
(/opt/phpbb/phpbb/styles/ and so on). Upgrades keep your edits and merge phpBB's changes in.
Extensions: phpBB's supported way to change how the board behaves. Put them in
/opt/phpbb/phpbb/ext/ and enable them in the Administration Control Panel. Upgrades never touch
extensions you added.
phpBB's own code, or extra files at the web root (such as robots.txt): build your own image
on top of this one. phpBB's code is read-only in the container, and edits to it on the volume
aren't used.
FROM evandarwin/phpbb:3.3.19
COPY robots.txt /var/www/phpbb/robots.txt
COPY patches/includes/functions.php /var/www/phpbb/includes/functions.php
Pin the tag you build from, and port your patches to each new phpBB release before rebuilding: your copies replace phpBB's files and are not merged.
You can customize your PHP settings by providing PHP.ini directives through the PHP_CUSTOM_INI
environment variable:
docker run -d \
-p 8080:8080 \
-v phpbb_data:/opt/phpbb \
-e PHPBB_FORUM_NAME="My Community" \
-e PHP_CUSTOM_INI="upload_max_filesize = 64M
post_max_size = 64M
memory_limit = 256M
max_execution_time = 60" \
evandarwin/phpbb:latest
They're applied on every start, after the image's own settings and PHP_MEMORY_LIMIT, so they can
override both. Raising post_max_size also raises the web server's request size limit, which always
follows it. PHP reports a value it can't use in the log and ignores it; after a syntax error, it
ignores the lines that follow as well. You can also mount an .ini file into /etc/php84/conf.d/.
docker run -d \
-p 8080:8080 \
-v phpbb_data:/opt/phpbb \
-e PHPBB_FORUM_NAME="My Community" \
-e PHPBB_DATABASE_DRIVER="mysqli" \
-e PHPBB_DATABASE_HOST="mysql_container" \
-e PHPBB_DATABASE_NAME="phpbb_db" \
-e PHPBB_DATABASE_USER="phpbb_user" \
-e PHPBB_DATABASE_PASSWORD="secure_password" \
evandarwin/phpbb:latest
docker run -d \
-p 8080:8080 \
-v phpbb_data:/opt/phpbb \
-e PHPBB_FORUM_NAME="My Community" \
-e PHPBB_DATABASE_DRIVER="postgres" \
-e PHPBB_DATABASE_HOST="postgres_container" \
-e PHPBB_DATABASE_NAME="phpbb_db" \
-e PHPBB_DATABASE_USER="phpbb_user" \
-e PHPBB_DATABASE_PASSWORD="secure_password" \
evandarwin/phpbb:latest
SQLite is the default, stored at /opt/phpbb/phpbb.sqlite on the volume:
docker run -d \
-p 8080:8080 \
-v phpbb_data:/opt/phpbb \
-e PHPBB_FORUM_NAME="My Community" \
evandarwin/phpbb:latest
docker run -d \
-p 8080:8080 \
-v phpbb_data:/opt/phpbb \
-e PHPBB_FORUM_NAME="My Community" \
-e PHPBB_EMAIL="[email protected]" \
-e SMTP_HOST="smtp.example.com" \
-e SMTP_PORT="587" \
-e SMTP_USER="smtp_user" \
-e SMTP_PASSWORD="smtp_password" \
-e PHPBB_DATABASE_DRIVER="mysqli" \
-e PHPBB_DATABASE_HOST="mysql_container" \
-e PHPBB_DATABASE_NAME="phpbb_db" \
-e PHPBB_DATABASE_USER="phpbb_user" \
-e PHPBB_DATABASE_PASSWORD="secure_password" \
evandarwin/phpbb:latest
You can build your own phpBB Docker images using the provided build script:
PHPBB_VERSION=3.3.19 ./scripts/build.sh
Without PHPBB_VERSION, the script picks the newest release tag on phpBB's GitHub, which can be a
pre-release, so set it explicitly. The build fails if phpBB can't be downloaded.
To choose the PHP version, build with Docker directly; PHP 8.4 is the default:
docker build --build-arg PHPBB_VERSION=3.3.19 --build-arg PHP_VERSION=8.5 .
When using this container behind a reverse proxy like Traefik or Nginx:
SERVER_NAME to your domain nameSERVER_PROTOCOL to https:// if using SSL/TLSCOOKIE_SECURE=true for secure cookiesTRUSTED_PROXIES to your proxy's address or network (or cloudflare behind Cloudflare), so
phpBB sees each visitor's address instead of the proxy's. Nothing is trusted by default, because
a trusted X-Forwarded-For lets anyone who can reach the container directly pick their address.Traefik reaches the forum over a shared Docker network, and the forum publishes no port, so only containers on that network can connect to it. Create the network once with a fixed range:
docker network create --subnet 172.30.0.0/24 proxy
services:
phpbb:
image: evandarwin/phpbb:latest
environment:
- SERVER_NAME=forums.example.com
- SERVER_PROTOCOL=https://
- COOKIE_SECURE=true
- TRUSTED_PROXIES=172.30.0.0/24
# Other configuration...
networks:
- proxy
labels:
- 'traefik.enable=true'
- 'traefik.http.routers.phpbb.rule=Host(`forums.example.com`)'
- 'traefik.http.routers.phpbb.entrypoints=websecure'
- 'traefik.http.routers.phpbb.tls=true'
networks:
proxy:
external: true
The forum's port is published on 127.0.0.1 only, so nothing outside the host can reach it. The
host's nginx connects through that port and arrives from the gateway of the forum's Docker network,
so the network gets a fixed range, and its gateway, 172.30.0.1, is the trusted proxy:
services:
phpbb:
image: evandarwin/phpbb:latest
ports:
- '127.0.0.1:8080:8080'
environment:
- SERVER_NAME=forums.example.com
- SERVER_PROTOCOL=https://
- COOKIE_SECURE=true
- TRUSTED_PROXIES=172.30.0.1
# Other configuration...
networks:
default:
ipam:
config:
- subnet: 172.30.0.0/24
nginx passes the visitor's headers through unchanged except Host, so forward it exactly, and add
the visitor's address to X-Forwarded-For. The forum's nginx takes the visitor's address from there
and ignores anything a visitor added themselves:
server {
listen 443 ssl;
server_name forums.example.com;
# ssl_certificate ...
# The forum accepts requests up to PHP's post_max_size (32M by default)
client_max_body_size 32m;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
This Docker image implements numerous security best practices:
/install/ is blocked; installs and upgrades run from the command lineBy default, the SQLite database is stored at /opt/phpbb/phpbb.sqlite. That's on the volume, so it
persists, and outside everything the web server serves, so it can't be downloaded.
If you set PHPBB_DATABASE_SQLITE_PATH yourself:
/opt/phpbb. PHP may only open files there, in /tmp and in two directories of the
image, and only /opt/phpbb is kept when the container is recreated./opt/phpbb/phpbb/; the installer refuses that path.As a last line of defense, the Nginx configuration also refuses to serve .sqlite, .sqlite3,
.db and .sql files anywhere.
This Docker image includes a built-in health check. It:
This is particularly useful when using the container with orchestration systems like Docker Swarm, Kubernetes, or Docker Compose with health checks.
Database Connection Errors:
An Upgrade Stopped With a Conflict:
Permission Issues:
--user;
/opt/phpbb must be writable by that user, and the log gives the command that fixes it when it
isn'tPHP Configuration:
PHP_CUSTOM_INI, or mount an .ini file into /etc/php84/conf.d/ (see
Custom PHP Configuration)Nginx Logs:
docker logs <container_name>nginx's access and error logs and PHP-FPM's error log are written to /var/log/phpbb, which you can
mount on its own to keep them, and every new line is also forwarded to the Docker logging system. If
/var/log/phpbb isn't writable, they go to the Docker logging system only:
# View all logs
docker logs <container_name>
# View only recent logs
docker logs --tail 100 <container_name>
# Follow logs in real-time
docker logs -f <container_name>
tests/run.sh builds the image (and an older one to upgrade from) and runs every tests/test_*.sh
against real containers: fresh installs, installer input, the read-only code and blocked paths, and
upgrades of SQLite, MariaDB, MySQL and PostgreSQL boards. It needs Docker and network access.
tests/run.sh # every test
tests/run.sh tests/test_security.sh # just these
Contributions are always welcome! Whether it's reporting bugs, suggesting features, or submitting pull requests, your input helps make this project better for everyone.
If you're using this image in production, I'd love to hear about your experience!
Licensed under the MIT license. This license applies to the Docker container only.
phpBB itself is licensed under GPL-2.0: https://www.phpbb.com/downloads/license/