# NGINX + PHP-FPM

NGINX + PHP-FPM is a Docker image that runs an Nginx web server with PHP-FPM and can pull or push application code from Git repositories. It is open source and self-hosted, installable on Docker Hub and Unraid.

Canonical page: https://ourlocalhost.com/app/371/nginx-php-fpm

## Description

NGINX + PHP-FPM is a Docker image that runs an Nginx web server with PHP-FPM and can pull or push application code from Git repositories. It is suited to lightweight PHP deployments that need configurable templates and local volume user ID mapping.

## Platform availability

Available on 2 of 10 platforms: Unraid, Helm.

## Health score

36/100 (Low), based on 4 of 5 factors.
- Maintained: 0 (last commit 1259 days ago)
- Popular: 65 (1,683 GitHub stars)
- Easy to install: 45 (2 install platforms, install notes, Docker image)
- Security check: 63 (no serious findings, CI, OpenSSF Scorecard 2.9/10)

## Links

- Docker Hub: https://hub.docker.com/r/richarvey/nginx-php-fpm
- Unraid: https://ca.unraid.net/apps/nginx-php-fpm-1fcann10nc159l?q=NGINX---PHP-FPM

## Common questions

### How do I make the container pull application code from Git on first start?

Set the GIT_EMAIL, GIT_NAME, GIT_USERNAME, GIT_REPO, and GIT_PERSONAL_TOKEN environment variables in the docker run command. The image uses those values to pull the repository when the container is created.

### How can I open the default install after starting the container?

Use docker inspect to get the container IP, which is often 172.17.0.2. Then browse to that IP over HTTP to view the default install files.

### How do I align file ownership when mounting a local volume?

The image provides UID mapping for local volume support. Use that mapping so the container's file ownership matches your host volume needs.

### How can I customize nginx or PHP behavior without replacing the whole configuration?

It supports custom nginx configs and core nginx/PHP variable overrides for running preferences. Use those overrides to adjust runtime settings as needed.

### Does this image support Let's Encrypt SSL?

Yes, the image has support for Let's Encrypt SSL configurations.

## Alternatives

- Apache HTTP Server: Open-source HTTP server offering cross-platform support, modular architecture, secure configuration, robust content delivery, and extensive…
- BunkerWeb: BunkerWeb is a self-hosted, open-source web application firewall and NGINX-based web server that protects services with secure-by-default s…
- Caddy: Caddy is an extensible web server and reverse proxy that serves Transport Layer Security (TLS) by default, making it simple to secure and r…
- Corvus: Self-hosted reverse proxy and web application firewall with a web console; it provides domain forwarding, free SSL, live traffic monitoring…
- Haproxy: HAProxy is a TCP proxy and a HTTP reverse proxy.
- Microsoft IIS: Internet Information Services (IIS) for Windows® Server is a flexible, secure and easy-to-manage Web server for hosting anything on the Web.
- Træfik Proxy: The Cloud Native Application Proxy Simplify networking complexity while designing, deploying, and operating applications.
- Varnish: Varnish is an open-source HyperText Transfer Protocol (HTTP) accelerator for website operators that serves cached pages from memory in fron…
- lighttpd: Lighttpd is a secure, lightweight web server that uses memory and CPU more efficiently than comparable servers, with FastCGI, CGI, authenti…
- nginx: Nginx is an HTTP web server, reverse proxy, content cache, load balancer, TCP/UDP proxy, and mail proxy server.
- nginx-ui

---
Source: Our Local Host (https://ourlocalhost.com/app/371/nginx-php-fpm), the self-hosted and open-source app directory.
