Choosing an Image
Choosing an image might be a little intimidating because there are so many options, but this ultimately gives you a ton of flexibility. This guide will help simplify your decision making process on choosing the right image.
Registry: Where images are located
Before diving into the different options available, let's understand where these images come from. The source code is hosted on GitHub with an automated process that builds and uploads images to container registries:
To use these images, you need to specify a certain "tag" for the image you want. For example, the 8.4 version of the fpm-nginx variation is tagged as:
serversideup/php:8.4-fpm-nginx
This image gives you the latest stable patch version of PHP 8.4 running the fpm-nginx variation. Since no registry is specified, it defaults to Docker Hub.
When selecting an image, you'll need to decide on:
- PHP version
- PHP variation
- Base operating system
- serversideup/php version (for production environments)
Our most popular images
All images are intelligently tagged with the PHP version and variation, allowing you to easily select the right image for your use case.
If you don't specify a variation, it defaults to cli and the latest supported Debian release for that variation.
Our most popular tags include:
| ⚙️ Variation | 🚀 Version |
|---|---|
| cli | Debian Based Alpine Based |
| fpm | Debian Based Alpine Based |
| fpm-apache | Debian Based |
| fpm-nginx | Debian Based Alpine Based |
| frankenphp | Debian Based Alpine Based ⚠️ Some users are experiencing known performance issues with FrankenPHP on Alpine. Consider using the Debian version. |
| unit (deprecated) | NGINX stopped supporting NGINX Unit and archived the project. NGINX Unit will eventually be removed from our project. Learn more → |
The full tag schema
Our tagging process is quite flexible, and it can become quite complex, but don't worry -- we've spent a ton of time applying sensible defaults to give you the best experience.
The full tag schema is as follows:
{{registry-url}}/serversideup/php:{{release-prefix}}-{{php-version}}-{{variation-name}}-{{operating-system}}-v{{github-release-version}}
Here's what each part means:
| Option | Default | Other Options |
|---|---|---|
{{registry-url}} Which registry to pull images from. | '' (Docker Hub) | ghcr.io (GitHub Packages) |
{{release-prefix}} The prefix of the release. | '' (stable) | beta (beta releases) |
{{php-version}} The version of PHP to use. | Latest stable PHP minor version (ie. 8.5) | 8.4 8.3 8.2 8.1 8.0 7.4 (you can also specify the full version number, ie. 8.4.1) |
{{variation-name}} The name of the variation to use. | cli | fpm fpm-apache fpm-nginx frankenphp unit (deprecated) |
{{operating-system}} The operating system to use. | debian | alpine bullseye bookworm trixie |
{{github-release-version}} The version of the GitHub release to use. | (latest stable release) | See our GitHub Releases for specific versions. |
PHP version
There are many factors to consider when choosing the right PHP version. Best practices include:
- Choose the latest PHP version (as your dependencies allow)
- Choose a PHP version that is receiving active and security support by PHP
If you need help understanding what's new in each PHP version, check out the official PHP changelog. This will give you a detailed overview of the changes and improvements in each version.
PHP variation
Choose from several variations to suit your needs. Each variation is optimized for specific use cases.
| Variation | Description |
|---|---|
cli | Minimal image for running PHP from the command line only. No web server included. |
fpm | Runs PHP-FPM without a web server. Ideal for microservices architectures where you need a dedicated PHP backend. |
fpm-apache | Combines PHP-FPM with Apache as a reverse proxy. Ideal for running WordPress with Docker. |
fpm-nginx | Combines PHP-FPM with NGINX as a reverse proxy. This is the traditional setup widely adopted for modern PHP applications, including Laravel. |
frankenphp | Modern application server built on Caddy that runs everything in a single process. Ideal for Laravel/Symfony applications with worker mode support, automatic HTTPS, and HTTP/2 and HTTP/3 protocols. |
unit (deprecated) | Uses NGINX Unit as a modern application server that runs everything in a single process. Consider migrating to FrankenPHP for a modern alternative. |
CLI
The CLI variation is a minimal image designed for running PHP from the command line only. It does not include a web server. Use this variation when you need a disposable and repeatable method for easily running PHP scripts from your terminal.
Learn more about the CLI variationFPM
The FPM (Fast Process Manager) variation runs PHP-FPM without a web server. This variation is ideal for microservices architectures where you need a dedicated PHP backend.
Use this variation when you already have a separate proxy or load balancer handling static content and routing PHP requests to your FPM container. This is commonly used in larger-scale deployments.
Learn more about the FPM variationFPM-Apache
The FPM-Apache variation combines PHP-FPM with Apache as a reverse proxy. Apache serves static content directly and forwards PHP requests to PHP-FPM for processing.
This is an excellent choice for WordPress sites and applications that specifically require Apache features or .htaccess support.
FPM-NGINX
The FPM-NGINX variation combines PHP-FPM with NGINX as a reverse proxy. This is the traditional setup that has been widely adopted for modern PHP applications, including many Laravel deployments.
NGINX serves static files efficiently and proxies PHP requests to PHP-FPM, providing excellent performance and flexibility.
Learn more about the FPM-NGINX variationFrankenPHP
The FrankenPHP variation is a modern application server built on top of the Caddy web server. It runs everything in a single process, eliminating the complexity of managing PHP-FPM and a separate web server.
Use this variation for Laravel or Symfony applications that can benefit from worker mode, automatic HTTPS, and modern protocols like HTTP/2 and HTTP/3. This is the recommended variation for new projects seeking cutting-edge performance.
Learn more about the FrankenPHP variationUnit (deprecated)
The Unit variation uses NGINX Unit as an application server that runs everything in a single process. Since NGINX Unit is no longer maintained, consider migrating to FrankenPHP for a single-process alternative.
Operating System
Choosing an operating system comes down to a few preferences, but ultimately you need to make sure your dependencies are available for the operating system you choose.
| Operating System | Description |
|---|---|
debian (default) | Debian is a popular Linux distribution that is known for its stability and reliability. It is the default operating system for our images. |
alpine | Alpine is a lightweight Linux distribution that is known for its small size and low resource usage. |
Debian
Debian is a popular Linux distribution that is known for its stability and compatibility. It is the default operating system for our images.
Alpine
Alpine is a lightweight Linux distribution that is known for its small size and low resource usage. If you're an advanced user, Alpine may be an excellent choice for you.
Specific versions
We also support specific versions of operating systems. So this means that you can choose versions like:
bookwormtrixiealpine3.16alpine3.17alpine3.18alpine3.19alpine3.20alpine3.21alpine3.22