Skip to content

Runtimes

If anything is confusing, unclear, missing, or maybe even wrong on this page, then please let us know by submitting a bug report ❤

The Pixelfed Dockerfile support multiple target runtimes (Apache and Nginx + FPM.)

You can consider a runtime target as individual Dockerfiles, but instead, all of them are built from the same optimized Dockerfile, sharing +90% of their configuration and packages.

What runtime is right for me?

If you are unsure of which runtime to choose, please use the Apache runtime; it's the most straightforward one and also the default.

Apache

RECOMMENDED

This is the default and recommended runtime for almost all single-server Pixelfed instances, as it has fewer moving parts, simplified operational model, and strikes a good balance between performance, features, and convenience.

Building a custom Pixelfed Docker image using Apache + mod_php can be achieved the following way.

docker build (Apache)

docker build \
 -f Dockerfile \
 --target apache-runtime \
 --tag <docker hub user>/<docker hub repo> \
 .

docker compose (Apache)

Info

This is already configured if you use the default Pixelfed docker-compose.yml

Instead you control the target runtime via your .env file

DOCKER_APP_BASE_TYPE="apache"
DOCKER_APP_RUNTIME="apache"
version: "3"

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
      target: apache-runtime

Nginx + FPM

ADVANCED USAGE

Nginx + FPM has more moving parts than the default (and recommended) Apache runtime.

Only select this runtime if you have valid technical reasons to do so.

Building a custom Pixelfed Docker image using nginx + FPM can be achieved the following way.

docker build (Nginx)

docker build \
 -f Dockerfile \
 --target nginx-runtime \
 --build-arg 'PHP_BASE_TYPE=fpm' \
 --tag <docker hub user>/<docker hub repo> \
 .

docker compose (Nginx)

Info

This is already configured if you use the default Pixelfed docker-compose.yml

Instead you control the target runtime via your .env file

DOCKER_APP_BASE_TYPE="fpm"
DOCKER_APP_RUNTIME="nginx"
version: "3"

services:
 app:
  build:
   context: .
   dockerfile: Dockerfile
   target: nginx-runtime
   args:
     PHP_BASE_TYPE: fpm