Installation

serversideup/php is compatible with any container orchestrator that supports Docker images (Kubernetes, Docker Swarm, Docker Compose, HashiCorp Nomad, etc.).

All images are hosted on DockerHub and GitHub Packages for free. Containers default to running Debian, but Alpine images are also available.

All images are intelligently tagged with the PHP version and variation. This allows you to easily select the right image for your use case.

If you do not specify a variation, it will default to cli and the latest supported Debian release for that variation.

Our most popular tags include:

⚙️ Variation🚀 Version
cliserversideup/php:8.3-cliserversideup/php:8.2-cliserversideup/php:8.1-cliserversideup/php:8.0-cliserversideup/php:7.4-cli
fpmserversideup/php:8.3-fpmserversideup/php:8.2-fpmserversideup/php:8.1-fpmserversideup/php:8.0-fpmserversideup/php:7.4-fpm
fpm-apacheserversideup/php:8.3-fpm-apacheserversideup/php:8.2-fpm-apacheserversideup/php:8.1-fpm-apacheserversideup/php:8.0-fpm-apacheserversideup/php:7.4-fpm-apache
fpm-nginxserversideup/php:8.3-fpm-nginxserversideup/php:8.2-fpm-nginxserversideup/php:8.1-fpm-nginxserversideup/php:8.0-fpm-nginxserversideup/php:7.4-fpm-nginx
unitserversideup/php:8.3-unitserversideup/php:8.2-unitserversideup/php:8.1-unitserversideup/php:8.0-unitserversideup/php:7.4-unit

Selecting the right variation

There are 4 main variations.

CLI

If you need to run a quick command with something like composer or use PHP to run a CLI program only, this might be a great option for you.

FPM

The fpm variation is great for people who need to run a PHP "backend" if they already have a proxy serving static content. If you're using FPM only, that means you're probably at a larger scale.

FPM-Apache

The fpm-apache variation is meant for users who want to run something like WordPress with Docker. Apache is configured to be a "reverse proxy", which will serve any static content with Apache and serve any PHP requests with PHP-FPM. Since there are two processes required to run this variation, we use S6 Overlay to ensure the container health is accurate.

Learn more about using Docker with WordPress →

FPM-NGINX

The fpm-nginx variation is great for people who want to run Laravel applications or similar. This allows you to serve static content quickly with NGINX but also pass PHP requests to PHP-FPM. Similar to PHP-Apache, there are two proccess required to run this variation. We use S6 Overlay to ensure the container health is accurate.

Learn more about S6 Overlay →

Unit

The unit variation is for NGINX Unit, which is a modern approach to delivering containerized web applications. Instead of relying on the complexities of two processes running NGINX + PHP-FPM, Unit replaces both the NGINX Web Server and PHP-FPM to run everything under one process. Unit is open source and maintained by the NGINX Unit team.

Learn more about Unit →

Selecting the version of PHP

Selecting the best version of PHP is highly dependent on your use case. In a perfect world, running the latest version of PHP will give you the latest and greatest, but it all depends on the libraries that your application uses.

For example, if you're running a WordPress site with a ton of different plugins, they may be using libraries that do not yet support the latest version of PHP. Be sure to evaluate your dependencies and test your application before deploying to production.

All versions + variations are tagged by:

  • Major Version (example: 8 will give you the latest 8.x version)
  • Minor Version (example: 8.3 will give you the latest 8.3.x version)
  • Patch Version (example: 8.3.2 will alway stay at the 8.3.2 version)

If you use latest, you will always get the latest stable version of the CLI variation of PHP running the latest version of Debian. For the best stability in production environments, you may want to pin to a specific patch version (example: 8.3.2).

The Full Image Tag Standard

{{registry-url}}/serversideup/php:{{release-prefix}}-{{php-version}}-{{variation-name}}-{{operating-system}}

Few examples

Latest version of 8.3.x running FPM + NGINX from Github Packages

ghcr.io/serversideup/php:8.3-fpm-nginx

8.1.16 running FPM + Apache on Alpine from DockerHub

serversideup/php:8.1.16-fpm-apache-alpine

Beta version (of this repository, not PHP) running PHP CLI 8.x

serversideup/php:beta-8

Viewing all available images & tags

All our images are available on DockerHub and GitHub Packages (ghcr.io). You can use their built-in search functions to browse through our entire collection of Docker Images:

Downloading an image

In the simplest form of using the image, you can simply pull it down.

Pull an image with Docker

docker pull serversideup/php:8.3-fpm-nginx

If you'd like to explore the image a little bit more, you can run bash on the image and view the structure of everything.

Explore the image with Bash

docker run --rm --name php -it serversideup/php:8.3-fpm-nginx bash

Running with a container orchestrator

serversideup/php is compatible with any container orchestrator that supports Docker images. Learn more below on how to use this image with the orchestrator of your choice.

Docker

Docker is a tool that enables users to deploy applications inside isolated containers for easy development and deployment.

Read more

Kubernetes

Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.

Read more

HashiCorp Nomad

HashiCorp Nomad is an open-source cluster scheduler that automates deployment, management & scaling of apps across public, private or hybrid clouds.

Read more