Getting Started

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
Trusted by the Community - Over 1 million Docker image pulls and actively used by Laravel and PHP developers worldwide.

Feature Comparison

See how serversideup/php stacks up against other PHP deployment options:

FeatureTraditional ServerOfficial PHP Imagesserversideup/php
Consistent environmentsβŒβœ…βœ…
Easy to scaleβŒβœ…βœ…
Base OS OptionsManual SetupDebian, AlpineDebian, Alpine
PHP Version ManagementManual UpdatesEasy UpgradesEasy 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 RegistriesN/ADockerHubDockerHub + GitHub Packages

Key Advantages Explained

Security First: Unprivileged by Default

Running containers as 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
Need to customize performance settings? Just set an environment variable like 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:

compose.yml
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 variables

Production-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.yml file
  • 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

compose.yml
services:
  php:
    image: serversideup/php:8.4-fpm-nginx
    environment:
      # Run migrations, storage link, caching, and more
      AUTORUN_ENABLED: "true"
Learn More About Laravel Automations

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

Dockerfile
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/CD
  • fpm - Just PHP-FPM (bring your own web server)
  • fpm-nginx - PHP-FPM + NGINX (most popular)
  • fpm-apache - PHP-FPM + Apache
  • frankenphp - 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:

By the Numbers
  • 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 Guide

From Official PHP Images

Already using Docker with official PHP images? Switching is trivially easy.

Official PHP Migration Guide

From 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/html by default
  • All variations expose port 8080 (unprivileged port)

Migration Strategy

  1. Review our environment variable specification
  2. Map your current config to environment variables
  3. Test in development first
  4. Switch image tag in production
Always test in a development or staging environment first to ensure your application works correctly with the new image.

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 Guide

Migration Guide (Existing Apps) Already have a PHP application? Learn how to containerize it with serversideup/php.

Migration Guides

Choose an Image Variation

Not sure which image variation is right for you? We have a guide for that.

Choosing an Image

Questions?

We're here to help! Check out these resources:

Join our community! Star us on GitHub and follow updates.