Nginx + PHP-FPM
| Description / name | Input element |
|---|---|
| Container Registry | |
| Container Configuration Root Path | |
| Timezone | |
| User ID | |
| Group ID | |
| Nginx + PHP-FPM Host Port | |
| Nginx + PHP-FPM /config Path |
Nginx with PHP-FPM, composer and the PHP extensions from ports, for running your own PHP sites.
| Port | 80 |
| Registry | ghcr.io/daemonless/nginx-php-fpm |
| Daemonless | daemonless/nginx-php-fpm |
| Source | php/php-src |
| Website | www.php.net |
Version Tags
| Tag | Description | Best For |
|---|---|---|
85 / 85-pkg / latest / pkg |
FreeBSD Quarterly. Uses stable, tested packages. | Most users — recommended. |
85-pkg-latest / pkg-latest |
FreeBSD Latest. Rolling package updates. | Staying current. |
86 / 86-pkg |
FreeBSD Quarterly. Uses stable, tested packages. | Production stability. |
86-pkg-latest |
FreeBSD Latest. Rolling package updates. | Staying current. |
84 / 84-pkg |
FreeBSD Quarterly. Uses stable, tested packages. | Production stability. |
84-pkg-latest |
FreeBSD Latest. Rolling package updates. | Staying current. |
Before deploying, ensure your host environment is ready. See the Quick Start Guide for host setup instructions, including the security model for host vs. container privileges.
Deployment
Save as compose.yaml, then run podman-compose up -d.
Warning
Exposing ports in AppJail means that your service can be reached from remote hosts. If that is not your intention, do not expose the ports and communicate with the service using the jail's IPv4 address or hostname assigned by the virtual network.
Save the files above, then run appjail-director up.
Experimental
Bastille's OCI support is experimental. It requires buildah and shares the host network stack (inherit). Mount volumes with --volume HOST JAIL; without it, image-declared volumes are stored under ${bastille_volumesdir}/${jail}.
Save as bastille-compose.yml, then run bastille up.
Access at: http://localhost:80
Interactive Configuration
Parameters
Environment Variables
| Variable | Default | Description |
|---|---|---|
PUID |
1000 |
User ID for php-fpm workers and nginx workers |
PGID |
1000 |
Group ID for php-fpm workers and nginx workers |
TZ |
UTC |
Timezone, also used as PHP's date.timezone |
PHP_EXTENSIONS |
`` | Space-separated list of PHP extensions to enable; replaces the default set |
PHP_EXTENSIONS_EXTRA |
`` | Extensions to enable in addition to PHP_EXTENSIONS |
Volumes
| Path | Description |
|---|---|
/config |
Web root (/config/www), nginx and PHP configuration |
Ports
| Port | Protocol | Description |
|---|---|---|
80 |
TCP | Web |
Your site
Put your PHP code in /config/www. On first start, when that directory is
empty, a welcome page is placed there showing the PHP version and the loaded
extensions. /config/nginx/site-confs/default.conf serves it; add more files
there for more sites. /config/nginx/nginx.conf and /config/php/www.conf
hold the nginx main config and the php-fpm pool. All of these are copied in
on first run and never overwritten afterwards.
PHP settings
/config/php/php-local.ini is loaded after php.ini and holds the memory,
upload and opcache settings. Edit it and restart the container.
Extensions
The image ships every PHP extension in the FreeBSD ports tree except imagick, smbclient and enchant, whose dependencies would quadruple the image. By default these are enabled:
apcu bcmath bz2 ctype curl dom exif fileinfo filter gd iconv intl mbstring
mysqli opcache pdo pdo_mysql pdo_pgsql pdo_sqlite pgsql phar posix session
simplexml tokenizer xml xmlreader xmlwriter zip zlib
Set PHP_EXTENSIONS to replace that list, or PHP_EXTENSIONS_EXTRA to add to
it, for example PHP_EXTENSIONS_EXTRA=redis soap ldap. Extensions not in the
image are reported in the container log at start. json and openssl are built
into PHP and always available.
Composer
Composer is installed. Run it as the bsd user so the files it writes stay
owned by your PUID:
PHP versions
Tags 86, 85 and 84 pick the PHP version; latest is PHP 8.5. Each
has a -pkg-latest variant built from the FreeBSD latest package branch.
Newer PHP versions ship fewer extensions until the pecl ports catch up; the
welcome page lists what is loaded.
Implementation Details
- Architectures: amd64
- User:
bsd(UID/GID set via PUID/PGID). Defaults to1000:1000. - Base: Built on
ghcr.io/daemonless/base(FreeBSD 15.1).
Need help? Join our Discord community.