Sign inSign up

gleenferdinand/lighttpd-arm-web

By gleenferdinand

•Updated about 2 months ago

Image
Developer tools
Web servers
Content management system
0

424

gleenferdinand/lighttpd-arm-web repository overview

⁠Lighttpd Web Server - ARM Docker Images

A collection of lightweight Lighttpd + PHP-FPM Docker images built for ARM architectures (e.g. Raspberry Pi, Apple Silicon, ARM-based NAS / servers). Each directory represents a single PHP version, plus a lighttpdarmall variant that bundles most PHP versions into one image.

These images are the ARM counterpart of the x86_64 images in webserver/lighttpd/. They expose a different set of host ports so both variants can run side by side.


⁠Table of Contents


⁠Features

  • Lighttpd web server that is lightweight, fast, and memory-efficient, built for ARM.
  • PHP-FPM runs separately and is connected to Lighttpd through a FastCGI socket.
  • Available for PHP 5.6, 7.0, 7.2, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4.
  • The lighttpdarmall variant bundles multiple PHP versions at once; the active version is selected via the PHP_VERSION environment variable.
  • Built with --platform=linux/arm, so it runs natively on 32-bit & 64-bit ARM (armv7 / arm64).
  • Based on Debian bookworm; "EOL" PHP releases (5.6, 7.0, etc.) are provided through the Sury repository (packages.sury.org), which publishes ARM packages.
  • The web directory is mounted from the host (./www) so no rebuild is needed when content changes.
  • Access logs are sent to stdout to simplify docker logs.

⁠Directory Structure

webserver/lighttpd_arm/
├── lighttpdarm5.6/      # PHP 5.6 ARM image
├── lighttpdarm7.0/      # PHP 7.0 ARM image
├── lighttpdarm7.2/      # PHP 7.2 ARM image
├── lighttpdarm7.4/      # PHP 7.4 ARM image
├── lighttpdarm8.0/      # PHP 8.0 ARM image
├── lighttpdarm8.1/      # PHP 8.1 ARM image
├── lighttpdarm8.2/      # PHP 8.2 ARM image
├── lighttpdarm8.3/      # PHP 8.3 ARM image
├── lighttpdarm8.4/      # PHP 8.4 ARM image
└── lighttpdarmall/      # Multi-PHP-version ARM image

Each version directory shares the same structure:

lighttpdarm8.3/
├── Dockerfile              # Image build definition (linux/arm)
├── docker-compose.yml      # Run orchestration (port, volume, container name)
├── docker/
│   ├── entrypoint.sh       # Startup: enable FastCGI module + start PHP-FPM + Lighttpd
│   ├── fastcgi.conf        # FastCGI handler for .php (FPM socket)
│   └── lighttpd.conf       # Main Lighttpd configuration
└── www/
    └── index.php           # Sample page (phpinfo)

⁠Technologies Used

ComponentDescription
Web ServerLighttpd (lightweight web server)
LanguagePHP-FPM (FastCGI Process Manager)
ProtocolFastCGI (Lighttpd → PHP-FPM via unix socket)
ArchitectureARM (--platform=linux/arm)
Base ImageDebian bookworm
Extra PHP RepoSury (packages.sury.org) for non-distro PHP versions

⁠Image List

DirectoryPHPContainer NameHost PortBuilt Image
lighttpdarm5.65.6lighttpd-arm-php568091lighttpdarm56-web
lighttpdarm7.07.0lighttpd-arm-php708092lighttpdarm70-web
lighttpdarm7.27.2lighttpd-arm-php728093lighttpdarm72-web
lighttpdarm7.47.4lighttpd-arm-php748094lighttpdarm74-web
lighttpdarm8.08.0lighttpd-arm-php808095lighttpdarm80-web
lighttpdarm8.18.1lighttpd-arm-php818096lighttpdarm81-web
lighttpdarm8.28.2lighttpd-arm-php828097lighttpdarm82-web
lighttpdarm8.38.3lighttpd-arm-php838098lighttpdarm83-web
lighttpdarm8.48.4lighttpd-arm-php848099lighttpdarm84-web
lighttpdarmall5.6–8.4lighttpd-arm-all8090gleenferdinand/lighttpd-arm-web:all

Note: The locally built image name follows the compose folder name (e.g. lighttpdarm83-web). The lighttpdarmall variant has an explicit image tag gleenferdinand/lighttpd-arm-web:all.


⁠Usage

⁠1. Prerequisites

Make sure Docker and Docker Compose v2 are installed, and that you are on an ARM machine (runs natively on armv7 / arm64 / Apple Silicon):

docker --version
docker compose version
uname -m        # should report arm, arm64, or aarch64

Place your web files inside the www/ folder of the relevant directory, or use the bundled sample index.php.

⁠2. Running a Specific Version (e.g. PHP 8.3)
cd webserver/lighttpd_arm/lighttpdarm8.3

# Build the image
docker compose build

# Start the container
docker compose up -d

# Check status
docker compose ps

Access it in your browser:

http://localhost:8098

If the bundled www/index.php (phpinfo) is still present, the PHP configuration page will be displayed.

⁠3. Running Other Versions

Repeat the same steps for the version directory you want. Adjust the port according to the table above:

cd webserver/lighttpd_arm/lighttpdarm8.4
docker compose build
docker compose up -d
# Access http://localhost:8099
⁠4. Running lighttpdarmall (all PHP versions)

This image bundles several PHP-FPM versions at once. The default PHP version is determined by the PHP_VERSION environment variable (default 8.4).

cd webserver/lighttpd_arm/lighttpdarmall
docker compose build
docker compose up -d

Switching the active PHP version:

# Set PHP_VERSION directly at run time
PHP_VERSION=7.4 docker compose up -d --force-recreate
# Or use .env
docker compose --env-file .env up -d
⁠5. Setting Port & PHP via .env (for lighttpdarmall)

The lighttpdarmall/.env file is already available and can be edited:

# Choose PHP version (5.6, 7.0, 7.2, 7.4, 8.0, 8.1, 8.2, 8.4)
PHP_VERSION=7.4

# Port for accessing the web (default 8090)
WORDPRESS_PORT=8090

After editing .env, rerun:

docker compose up -d --force-recreate

⁠How the Image Works

When the container starts, entrypoint.sh performs several steps:

  1. Removes Lighttpd's default FastCGI configuration (15-fastcgi-php.conf) to avoid conflicts.
  2. Enables the custom FastCGI configuration (10-fastcgi-custom.conf).
  3. Creates the /run/php directory for PHP-FPM sockets.
  4. Starts PHP-FPM:
    • Specific version: php-fpm<v> matching the version in that directory.
    • lighttpdarmall: starts all php-fpm5.6 … php-fpm8.4, then points the .php handler to the $PHP_VERSION socket.
  5. Runs Lighttpd in the foreground: lighttpd -D -f /etc/lighttpd/lighttpd.conf.

Web request flow:

Browser ──HTTP──▶ Lighttpd ──FastCGI socket──▶ php-fpm<v> ──▶ /var/www/html

⁠Configuration

⁠docker/lighttpd.conf
  • server.document-root = "/var/www/html" — web folder.
  • server.port = 80 — container internal port.
  • server.username / server.groupname = "www-data" — privilege drop.
  • <include conf-enabled/*.conf> — loads the enabled FastCGI module.
  • accesslog.filename = "/dev/stdout" — access logs to console output.
  • server.errorlog = "/dev/null" — error log disabled.
⁠docker/fastcgi.conf

Connects the .php extension to the corresponding PHP-FPM version socket, for example:

fastcgi.server += (
    ".php" => (
        "localhost" => (
            "socket" => "/run/php/php8.3-fpm.sock"
        )
    )
)
⁠Volume
  • ./www:/var/www/html — your web content. Changes on the host are visible in the container immediately.

⁠Verification

Check container status & logs:

docker ps | grep lighttpd-arm
docker logs <container_name>          # e.g. docker logs lighttpd-arm-php83

Test the page response:

curl -i http://localhost:8098

Check the active PHP version (if www/index.php contains phpinfo()):

curl -s http://localhost:8098 | grep -i "PHP Version"

⁠Troubleshooting

SymptomSolution
Port already in useChange the port in docker-compose.yml (the ports section).
Blank page / .php extension downloadedMake sure FastCGI is enabled; check docker logs <container>.
Wrong architecture / exec format errorThese images require an ARM host. On x86_64 use the webserver/lighttpd/ variant instead.
php-fpm<v>: not foundEnsure the PHP version is actually installed in the image (or use the lighttpdarmall variant).
Old PHP version missing from Debian repoThe image uses the Sury repo; make sure the build uses docker compose build --pull.
Want to reset / stopRun docker compose down, then docker compose up -d to start again.
Configuration changes not appliedFiles in docker/ are only read at build time; after editing them you must run docker compose build again.

Note: This directory is the ARM webserver variant (linux/arm). For x86_64 / amd64 machines (e.g. desktop PCs, most cloud VPS), use the webserver/lighttpd/ directory in the same repository.

Tag summary

Content type

Image

Digest

sha256:962006c0f…

Size

100.8 MB

Last updated

about 2 months ago

docker pull gleenferdinand/lighttpd-arm-web