PHP development environment for use with https://getknot.dev
8.5K
A PHP development image for knot spaces, combining knot-ubuntu with PHP-FPM and a Caddy web server (the binary from knot-caddy). Any HTML or PHP file placed in ~/public_html is served on port 80, with PHP executed via FastCGI. Composer and Node.js are preinstalled for front-end / asset work.
It inherits the full knot entrypoint, runtime user, rsyslog logging and startup-hook framework from knot-ubuntu.
All tags are multi-arch (linux/amd64, linux/arm64); see Docker Hub for the current list.
PHP is installed from the Ondřej Surý PPA. Each release is also tagged <version>-<BUILD_DATE>.
docker run -d \
-p 8080:80 \
-e KNOT_SERVER=https://knot.example.com \
-e KNOT_USER=alice \
-v knot_home:/home \
paularlott/knot-php:8.5
Place files in the mounted home's public_html directory and open http://localhost:8080.
A startup hook (/etc/knot-startup.d/01-startup-php) starts:
cron with /etc/cron.d/container-crons (which rotates logs every 4 hours).php-fpm listening on the Unix socket /run/php/php-fpm.sock (logging to syslog).~/public_html if missing.:80 with the bundled /etc/caddy/Caddyfile, which:
~/public_html with the static file server + directory browser,zstd / gzip compression,*.php to the php-fpm socket via php_fastcgi,Prefer a single Caddy+PHP process? See the
knot-frankenphpimage.
gd, pdo, pdo-mysql, mysqli, bcmath, mbstring, exif, zip, sockets, iconv, gettext, curl, redis, mailparse, xml, dev, pear, plus opcache (PHP 8.3/8.4). Also bundled:
phpenxdebug / phpdisxdebug helper scripts.Built on knot-ubuntu, so it supports the common knot variables:
| Variable | Default | Description |
|---|---|---|
KNOT_USER | knot | Runtime user (uid 1000); created if missing |
KNOT_SERVER | (unset) | knot server URL; if set, the agent is downloaded and started |
KNOT_AGENT_ENDPOINT | (unset) | Agent endpoint reported to the server |
KNOT_SPACEID | (unset) | Space identifier |
KNOT_SERVICE_PASSWORD | (auto-generated UUID) | Shared service password |
KNOT_SSHD | (unset) | Set to native to start sshd |
KNOT_SSH_PORT | 2222 | Port for the SSH daemon |
KNOT_SYSLOG_PORT | 1514 | Syslog forward target (0 disables forwarding) |
TZ | Etc/UTC | Timezone (also sets date.timezone) |
PHP-specific:
| Variable | Default | Description |
|---|---|---|
PHP_VERSION | (build-time) | The PHP version, also used to locate /etc/php/<version>/ configs |
| Port | Protocol | Purpose |
|---|---|---|
80 | TCP | HTTP (Caddy → php-fpm) |
/home — persistent home directory; serve content from ~/public_html.The Ubuntu base image, PHP, Caddy and their packages are licensed under their respective upstream licenses (PHP is PHP License; Caddy is Apache 2.0). This image's packaging — the Dockerfile, knot-entrypoint and supporting scripts/configs — is Apache License 2.0.
Source: paularlott/knot-base-images.
Content type
Image
Digest
sha256:fee5ef4b9…
Size
398.6 MB
Last updated
about 16 hours ago
docker pull paularlott/knot-php:8.5-20260929