These Images vs Others
The Problem with Traditional PHP Deployment
If you've ever deployed a PHP application to production, you've probably experienced one (or all) of these frustrations:
- "It works on my machine" - Your local environment doesn't match production, leading to mysterious bugs that only appear after deployment
- Configuration Hell - Spending hours tweaking
php.ini,www.conf, and web server configs across multiple servers - Security Vulnerabilities - Running as root, outdated extensions, or misconfigured permissions exposing your application to attacks
- Manual Server Management - SSH-ing into servers to update PHP, install extensions, or troubleshoot issues
- Inconsistent Environments - Each server is slightly different, making debugging and scaling a nightmare
- Framework-Specific Tweaks - Researching and applying dozens of optimizations for Laravel or WordPress performance
You're not alone. These are the exact problems that led us to create serversideup/php.
How serversideup/php Solves These Problems
serversideup/php is built on the official PHP images but adds everything needed for real-world production use:
- β Works Identically Everywhere - Same container runs on your laptop, CI/CD, and production
- β Zero Configuration Required - Production-ready defaults with simple environment variable customization
- β Secure by Default - Runs as unprivileged user, hardened for the open internet
- β Batteries Included - Composer, common extensions, and helpful utilities pre-installed
- β Framework Optimized - Pre-configured for Laravel and WordPress best practices
- β Modern Architecture - FrankenPHP, S6 Overlay, native health checks, and multi-process support
Feature Comparison
See how serversideup/php stacks up against other PHP deployment options:
| Feature | Traditional Server | Official PHP Images | serversideup/php |
|---|---|---|---|
| Consistent environments | β | β | β |
| Easy to scale | β | β | β |
| Base OS Options | Manual Setup | Debian, Alpine | Debian, Alpine |
| PHP Version Management | Manual Updates | Easy Upgrades | Easy Upgrades |
| Multi-arch support | β | β | β |
| Production-ready defaults | β οΈ Manual | β | β |
| Runs as non-root user | β οΈ Manual | β | β |
| Variable-first configuration | β | β | β |
Includes composer | β οΈ Manual | β | β |
Includes install-php-extensions | β | β | β |
| Built-in security hardening | β οΈ Manual | β | β |
| Laravel & WordPress optimizations | β οΈ Manual | β | β |
| NGINX + FPM variation | β οΈ Manual | β | β |
| FrankenPHP support | β | β | β |
| Native health checks | β οΈ Manual | β | β |
| S6 Overlay init system | β | β | β |
| Published Registries | N/A | DockerHub | DockerHub + GitHub Packages |
Key Advantages Explained
Security First: Unprivileged by Default
root in production is a critical security vulnerability. If your application is compromised, an attacker gains root access to your container which could lead to a full system compromise.Our images run as the www-data user by default, following the principle of least privilege. This means:
- Limited Blast Radius - If your application is compromised, don't have root privileges
- Kubernetes Compatible - Many Kubernetes clusters require non-root containers by policy
- Production Best Practice - Aligns with NIST and CIS security benchmarks
We also include additional security hardening:
- Disabled dangerous PHP functions by default (but you control them)
- Proper file permissions out of the box
- CloudFlare trusted proxy support for accurate IP logging
- Regular security updates from official PHP base images
Performance Optimized
Every image includes production-tuned defaults based on real-world PHP applications:
OPcache Configuration
- Pre-configured for optimal memory usage and caching strategy
- Easily toggle between development and production modes
- Smart defaults that work for most applications
Process Management
- PHP-FPM tuned for typical low resource usage for Laravel/WordPress workloads
- S6 Overlay for intelligent process supervision
- Graceful shutdown handling for zero-downtime deployments
Modern Options
- FrankenPHP support for incredible performance gains (2-3x faster than FPM in many claims made by developers)
- Native support for NGINX Unit
- HTTP/2 and HTTP/3 ready configurations
PHP_OPCACHE_ENABLE=1 or PHP_MEMORY_LIMIT=512M. No config files needed.Developer Experience: Variable-First Configuration
Stop editing config files. Stop rebuilding images for simple changes. Just set environment variables:
services:
php:
image: serversideup/php:8.4-fpm-nginx
environment:
# Change any PHP setting with environment variables
PHP_MEMORY_LIMIT: "512M"
PHP_UPLOAD_MAX_FILE_SIZE: "100M"
PHP_MAX_EXECUTION_TIME: "180"
PHP_OPCACHE_ENABLE: "1"
# Run Migrations, Storage Link, Caching, and more
AUTORUN_ENABLED: "true"
No Dockerfile modifications. No config file mounting. No image rebuilds. Just simple environment variables with production-ready defaults.
View all environment variablesProduction-Ready Out of the Box
Our images are built for the wild internet:
Security Hardening
- Unprivileged user execution
- Disabled dangerous PHP functions (you control which ones)
- Proper file permissions and ownership
- Regular security updates
Monitoring & Observability
- Built-in health check endpoints
- All logs to STDOUT/STDERR for centralized logging
- Compatible with Prometheus, DataDog, and other monitoring tools
Deployment Features
- Zero-downtime deployment support
- Graceful shutdown handling
- Queue worker and scheduler support for Laravel
- Automatic migration running on container start (optional)
Infrastructure as Code
- Version your entire PHP stack in a
compose.ymlfile - Reproduce every environment with 100% consistency
- Easy rollbacks to previous versions
Framework Optimized for Laravel & WordPress
We've done the hard work of optimizing for PHP's most popular frameworks:
Laravel Automations
services:
php:
image: serversideup/php:8.4-fpm-nginx
environment:
# Run migrations, storage link, caching, and more
AUTORUN_ENABLED: "true"
WordPress Optimizations
- Pre-installed PHP extensions WordPress needs
- Optimized PHP settings for WordPress performance
- Support for popular WordPress hosting patterns
All Frameworks Welcome
While we optimize for Laravel and WordPress, our images work great with:
- Symfony
- CodeIgniter
- Drupal
- Joomla
- Custom PHP applications
Batteries Included
Unlike the official PHP images, we include tools you'll actually use:
Composer
- Pre-installed and ready to use
- No need to install it in every Dockerfile
- Supports Composer v2 for lightning-fast installs
install-php-extensions
- The popular mlocati/docker-php-extension-installer included
- Install any PHP extension with a single command
- Handles all dependencies automatically
FROM serversideup/php:8.4-cli
# Switch to root to install extensions
USER root
# Install any PHP extension easily
RUN install-php-extensions redis imagick mongodb
# Switch back to unprivileged user
USER www-data
Modern Init System
- S6 Overlay for our FPM-Apache and FPM-NGINX variations
- Proper process supervision in containers
- Better than Supervisor for containerized workloads
- Graceful handling of signals for zero-downtime deployments
Multiple Variations Choose the right tool for your use case:
cli- Command-line scripts, Composer, CI/CDfpm- Just PHP-FPM (bring your own web server)fpm-nginx- PHP-FPM + NGINX (most popular)fpm-apache- PHP-FPM + Apachefrankenphp- Modern, incredibly fast (2-3x FPM performance)unit- NGINX Unit for high-performance applications (deprecated)
Real-World Impact
Don't just take our word for it. Here's what developers are experiencing:
- 1,000,000+ Docker image pulls
- 2,000+ GitHub stars
- Active Community with regular updates and contributions
- Production-Proven across startups to enterprise applications
Time Savings
- β±οΈ Minutes vs Hours - Go from zero to production-ready PHP in minutes, not hours of server configuration
- π Consistent Deployments - Eliminate "works on my machine" debugging sessions
- π¦ Pre-configured - Stop researching optimal PHP settings for Laravel
Better Security
- π‘οΈ Hardened by Default - Security best practices built-in, not bolted on
- π Regular Updates - Based on official PHP images with security patches
- π Audit Trail - Infrastructure as code means every change is tracked
Happier Developers
- π Simple Configuration - Environment variables instead of config file archaeology
- π Modern Tools - FrankenPHP, native health checks, and container-native features
- π€ Community Support - Active community and comprehensive documentation
Making the Switch
From Traditional Servers (LAMP/LEMP)
If you're currently managing PHP on traditional servers, the switch to containers might seem daunting, but it's easier than you think:
Benefits You'll Gain
- Identical environments from development to production
- Scale horizontally by adding more containers
- Roll back bad deployments in seconds
- Version control your entire infrastructure
See our quick start guide to run your first PHP container.
Quick Start GuideFrom Official PHP Images
Already using Docker with official PHP images? Switching is trivially easy.
Official PHP Migration GuideFrom Other Docker Images
Switching from Bitnami, custom images, or other PHP Docker images is straightforward:
Key Differences to Note
- We run as
www-data(UID 33) by default, not root - Configuration via environment variables, not config file mounts
- Web root is
/var/www/htmlby default - All variations expose port
8080(unprivileged port)
Migration Strategy
- Review our environment variable specification
- Map your current config to environment variables
- Test in development first
- Switch image tag in production
Ready to Get Started?
You're just minutes away from a better PHP deployment experience.
Choose Your Path
Quick Start (New Projects) Follow our installation guide to create your first PHP app with Docker in under 5 minutes.
Quick Start GuideMigration Guide (Existing Apps) Already have a PHP application? Learn how to containerize it with serversideup/php.
Migration GuidesChoose an Image Variation
Not sure which image variation is right for you? We have a guide for that.
Choosing an ImageQuestions?
We're here to help! Check out these resources:
- π Full Documentation - Comprehensive guides and references
- π¬ GitHub Discussions - Ask questions and share experiences
- π GitHub Issues - Report bugs or request features
- π£οΈ Discord - Join our community and get help from the team and other developers.
Introduction
serversideup/php is an alternate approach to the official Docker images provided by PHP. Compared to the defaults provided by the official PHP Docker images, the serversideup/php Docker images are optimized for more real-world and production use cases and an easier developer experience.
Installation
Learn how to get started with serversideup/php Docker Images.