Production-ready PHP-FPM & CLI images: 52 extensions, Composer, WP-CLI, Node.js. PHP 8.2-8.5
5.0K
Maintained by morsalin1342 · GitHub
Batteries-included PHP images with 52 extensions, Composer, WP-CLI, the MariaDB client, and configurable Node.js. Available in FPM (web) and CLI (tasks/CI) variants.
| Feature | Official image | This image |
|---|---|---|
| PHP extensions | Few built in | ✅ 52 pre-installed |
| 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
docker run --rm -v $(pwd):/app morsalin1342/php:8.4-cli composer install
docker run --rm -v $(pwd):/app morsalin1342/php:8.4-cli php artisan migrate
| Tag | Variant | PHP | Base OS |
|---|---|---|---|
latest-fpm, 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-fpm, 8.4-fpm-trixie | FPM | 8.4 | trixie |
8.4-cli, 8.4-cli-trixie | CLI | 8.4 | trixie |
8.3-fpm, 8.3-cli (+ -trixie) | Both | 8.3 | trixie |
8.2-fpm, 8.2-cli (+ -trixie) | Both | 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.
| 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 as a static server or php-fpm application server, no PHP inside |
| easydigital/php | Same image, organization namespace |
⭐ If this image helps you, consider giving it a star on GitHub!
Content type
Image
Digest
sha256:e2cb3f56b…
Size
516.2 MB
Last updated
3 days ago
docker pull morsalin1342/php:latest-cli