apache2 + php8 + modules + switch public/ or not
10K+
Apache + PHP 8 Docker image with a persistent /var/www layout, optional reverse proxy support, and a wide set of PHP extensions and utilities.
đ Security update (2026-10-21/22) â All branches have been rebuilt on patched PHP releases fixing the critical remote code execution vulnerabilities CVE-2026-109618 and CVE-2026-109619. Patched versions: 8.2.35â , 8.3.36â , 8.4.27â , 8.5.12â . Please pull the latest image and recreate your containers.
All tags are multi-arch (linux/amd64 + linux/arm64); Docker picks the right architecture automatically.
| Branch tag | Full version tag | PHP | Security support until |
|---|---|---|---|
8.5 | 8.5.12-apache-trixie | 8.5.12â | 2029-12-31 |
8.4 | 8.4.27-apache-trixie | 8.4.27â | 2028-12-31 |
8.3 | 8.3.36-apache-trixie | 8.3.36â | 2027-12-31 |
8.2 | 8.2.35-apache-trixie | 8.2.35â | â ī¸ 2026-12-31 |
8.4) always point to the latest patched release of that branch: use them to receive security fixes automatically.8.4.27-apache-trixie) match the upstream php base image and never change.-arm64 and -previous tags have been removed.services:
app:
image: waazaafr/webserver-apache-php8:8.4
container_name: webserver
restart: unless-stopped
ports:
- "8787:80"
volumes:
- ./webserver:/var/www
environment:
TZ: Europe/Paris
PUID: 99
PGID: 100
PUBLIC_FOLDER: "false"
PROXY_LOCAL_IPS: 192.168.1.23
PROXY_EXTERNAL_IPS: 192.168.1.23
docker run -d \
--name webserver \
--restart unless-stopped \
-p 8787:80 \
-v ./webserver:/var/www \
-e TZ=Europe/Paris \
-e PUID=99 \
-e PGID=100 \
-e PUBLIC_FOLDER=false \
-e PROXY_LOCAL_IPS=192.168.1.23 \
-e PROXY_EXTERNAL_IPS=192.168.1.23 \
waazaafr/webserver-apache-php8:8.4
Then put your website in ./webserver/html/ and open http://<host>:8787.
âšī¸ No default
index.phpis created. As long ashtml/(orhtml/public/) contains noindex.phporindex.html, Apache answers403and the container is reported asunhealthy.
| Variable | Default | Description |
|---|---|---|
TZ | Europe/Paris | Time zone used inside the container |
PUID | 99 | User ID of the apache2 user |
PGID | 100 | Group ID of the apache2 user |
FORCE_CHOWN | false | If true, /var/www is recursively owned by PUID:PGID at startup |
PUBLIC_FOLDER | false | If true, the document root is /var/www/html/public/ instead of /var/www/html/ |
PROXY_LOCAL_IPS | (empty) | IP address of your local reverse proxy |
PROXY_EXTERNAL_IPS | (empty) | IP address of an external reverse proxy, if any |
Everything persistent lives in /var/www: bind it to a folder on your host. Missing folders are created at startup.
| Path | Content |
|---|---|
html/ | Your website files (document root) |
ini/php/ | Custom PHP configuration (php_custom_config.ini) |
cron/ | Crontab file for your scheduled tasks |
logs/ | Apache access and error logs |
Two commands are available inside the container, useful in cron jobs (e.g. stop Apache while running mysqldump or pg_dump):
apache-stopapache-startPHP and its dependencies come from the packages.sury.orgâ repository. Base OS: Debian 13 (trixie).
composer git curl nano tree zip unzip smbclient sqlite3 mariadb-client postgresql-client redis-tools locales-all
Databases & cache: mysqli mysqlnd pdo_mysql pgsql pdo_pgsql sqlite3 pdo_sqlite pdo_dblib dba mongodb redis memcached apcu Zend OPcache
Text, i18n & data: mbstring iconv intl gettext pspell json igbinary msgpack ds
XML & web: dom libxml SimpleXML xml xmlreader xmlwriter xsl soap tidy curl ftp imap ldap snmp sockets
Images & files: gd imagick exif fileinfo zip zlib bz2 Phar
Security & math: openssl sodium hash random bcmath gmp mcrypt
System & core: Core calendar ctype date filter pcntl pcre PDO posix readline Reflection session shmop SPL standard sysvmsg sysvsem sysvshm tokenizer
mcrypt is available on 8.2, 8.3 and 8.4 only.
Main: mpm_prefork php rewrite remoteip deflate filter status
Others: access_compat alias auth_basic authn_core authn_file authz_core authz_host authz_user autoindex dir env mime negotiation reqtimeout setenvif
Static: core so watchdog http log_config logio version unixd
Full upstream PHP changelog: php.net/ChangeLog-8.phpâ
8.3.36 rebuilt with the redis PHP extension, which was missing from the 8.3 images.-arm64 or -previous tags).8.2 and 8.3 are now explicitly based on Debian 13 (trixie), like 8.4 and 8.5.FORCE_CHOWN (disabled by default).locales-all.index.php.PUID and PGID to set the apache2 user IDs and the ownership of /var/www.redis PHP extension.Content type
Image
Digest
sha256:4d36513edâĻ
Size
481.6 MB
Last updated
about 4 hours ago
docker pull waazaafr/webserver-apache-php8:8.3