PHP-FPM & CLI images: 51 extensions, Composer, WP-CLI, Node.js. PHP 8.2-8.5
7.6K
Maintained by morsalin1342 · GitHub
PHP 8.2 to 8.5 images with 51 extensions on top of the official image's (counted on PHP 8.5), Composer 2.11.2, WP-CLI 2.12.0, the MariaDB client and Node.js 24. Available in FPM (web) and CLI (tasks/CI) variants.
Platform: linux/amd64 only. morsalin1342/php on Docker Hub and ghcr.io/morsalin1342/php on GitHub Container Registry are the same image, pushed by the same build with the same digest; pull whichever you prefer.
| Feature | Official image | This image |
|---|---|---|
| PHP extensions | 36 loaded on PHP 8.5 | ✅ 51 more installed on PHP 8.5 |
| Composer / WP-CLI | ❌ | ✅ Both |
| Node.js | ❌ | ✅ v24, configurable |
| MariaDB client | ❌ | ✅ mariadb tools, also as mysql, mysqldump |
| Debian release | One | ✅ trixie (Debian 13) |
| Variants | Separate images | ✅ FPM and CLI from one build |
# docker-compose.yml
services:
php:
image: morsalin1342/php:8.4-fpm
volumes:
- ./src:/var/www/html
nginx:
image: nginx:alpine
ports:
- "8080:80"
volumes:
- ./src:/var/www/html
- ./nginx.conf:/etc/nginx/conf.d/default.conf
A minimal nginx.conf that passes .php requests to the php service is in the repository.
docker run --rm -v $(pwd):/app -w /app morsalin1342/php:8.4-cli composer install
docker run --rm -v $(pwd):/app -w /app morsalin1342/php:8.4-cli php artisan migrate
| Tag | Variant | PHP | Base OS |
|---|---|---|---|
latest, latest-fpm, 8.5, 8.5-fpm, 8.5-fpm-trixie | FPM | 8.5 | trixie |
latest-cli, 8.5-cli, 8.5-cli-trixie | CLI | 8.5 | trixie |
8.4, 8.4-fpm, 8.4-fpm-trixie | FPM | 8.4 | trixie |
8.4-cli, 8.4-cli-trixie | CLI | 8.4 | trixie |
8.3, 8.3-fpm, 8.3-cli (+ -trixie) | Both (8.3 is FPM) | 8.3 | trixie |
8.2, 8.2-fpm, 8.2-cli (+ -trixie) | Both (8.2 is FPM) | 8.2 | trixie |
Only Debian 13 (trixie) is built, and -trixie tags are aliases of the unsuffixed ones. The old -bookworm tags stay available but are no longer updated.
The full list of extensions and tools, with versions, is in EXTENSIONS.md.
pgsql + pdo_pgsql), Imagick, GD, Intl,
OpenTelemetry, openswoole, ftp and more-fpm for web behind nginx or Caddy, -cli for tasks, migrations and CIdocker build . \
--build-arg PHP_VERSION=8.4 \
--build-arg IMAGE_TYPE=fpm \
--build-arg NODE_VERSION=22 \
--build-arg NODE_PACKAGE_VERSION=<a 22.x package from deb.nodesource.com> \
-t my-php:8.4-fpm
Q: FPM or CLI? A: FPM for web behind nginx or Caddy; CLI for migrations, queues and CI.
Q: Can I add extensions?
A: Yes — RUN install-php-extensions <name> in a layer on top.
Q: Is there a bookworm image?
A: No. Only trixie is built now. Older -bookworm tags stay on Docker Hub but are no longer updated.
The repository's build files are MIT. PHP (PHP License 3.01), Composer and WP-CLI (MIT), Node.js (MIT), npm (Artistic-2.0), the MariaDB client (GPL-2.0), FFmpeg as Debian builds it (GPL-2.0-or-later) and the other packages keep their own licences; the Licence section lists them.
| Image / Tool | Description |
|---|---|
| morsalin1342/caddy | Standalone Caddy with WAF, rate limiting & caching |
| morsalin1342/frankenphp | Caddy + PHP app server in one container |
| morsalin1342/nginx | nginx with ModSecurity 3, Brotli, zstd & GeoIP2 |
| morsalin1342/apache | Apache httpd as a static server or php-fpm application server, no PHP inside |
| morsalin1342/adminer | Adminer database tool: the official image plus Alpine security updates |
| ghcr.io/morsalin1342/php | Same image, GitHub Container Registry |
⭐ If this image helps you, consider giving it a star on GitHub!
Content type
Image
Digest
sha256:948f0a367…
Size
521.5 MB
Last updated
3 days ago
docker pull morsalin1342/php