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.
Our most popular images
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 |
---|---|
cli | Debian Based Alpine Based |
fpm | Debian Based Alpine Based |
fpm-apache | Debian Based |
fpm-nginx | Debian Based Alpine Based |
unit | Debian Based |
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 processes required to run this variation. We use S6 Overlay to ensure the container health is accurate.
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.
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 always 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}}-{{github-release-version}}
Few examples
Latest version of 8.3.x running FPM + NGINX from GitHub Packages
ghcr.io/serversideup/php:8.3-fpm-nginx
PHP 8.1.16, running FPM + Apache on Alpine from DockerHub, locked into our v3.0.0 GitHub Release
serversideup/php:8.1.16-fpm-apache-alpine-v3.0.0
In this example, we can lock into the v3.0.0
release of our image. This is useful if you want to ensure there are no automatic changes that could break your CI process. View our releases →
Latest 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.
Kubernetes
Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.
HashiCorp Nomad
HashiCorp Nomad is an open-source cluster scheduler that automates deployment, management & scaling of apps across public, private or hybrid clouds.