PHP web stack: NGINX with PHP-FPM on Ubuntu 24.04, hardened, ready for PHP sites and frameworks.
You get NGINX already wired to PHP-FPM on Ubuntu 24.04 LTS, serving PHP on port 80 from first boot. Copy your PHP files into the web root and NGINX serves them, with no web server or PHP configuration to do first.
Who it's for
- PHP developers and agencies hosting sites or APIs behind NGINX
- Teams that prefer NGINX to Apache for PHP hosting
- Developers who need a clean staging or test server for a PHP application
What's included
- NGINX 1.24 (the web server) and PHP-FPM 8.3 (FastCGI Process Manager, the service that runs your PHP code), from Ubuntu 24.04 packages and enabled at boot
- PHP extensions curl (outbound web requests), gd (image handling), mbstring (multi-byte text), xml and zip, plus MySQL and PostgreSQL drivers. These are client drivers only: no database server is installed, so you connect to a database you run elsewhere.
- A default site (server block, NGINX's per-site configuration) serving /var/www/html, with a placeholder page and a PHP information page (info.php) used to prove PHP runs. NGINX and PHP-FPM both restart automatically after a reboot.
After deployment
- First boot starts PHP-FPM and NGINX, then checks that a .php request is executed by PHP rather than served as source. There is no login and no generated credential.
- Allow port 80 for your own IP in the network security group (NSG, the firewall Azure applies to your VM) and browse to the VM's address. Point a DNS name at the VM when you are ready.
- Delete /var/www/html/info.php before going live, because it publishes your full PHP configuration.
- HTTPS is not on out of the box. The VM firewall already allows port 443, but nothing listens there until you add a certificate for your domain. Certbot (the Let's Encrypt client) is not pre-installed; the login message (MOTD) and the support page give the install and setup steps.
Why this image
- First boot proves PHP actually executes, not just that the web server is running.
- The build fails if a credential or private key would be captured into the image.
- A weekly verification job checks the configuration test, PHP execution and the PHP-FPM socket on the newest build.
- Ubuntu 24.04 LTS with every update available at build time applied.
How it runs on Azure
A Gen2 VM image with Trusted Launch (Secure Boot plus a virtual TPM, a software security chip, which together protect the VM's boot process), deployed into your own subscription and virtual network. Charges appear on your Azure invoice with the VM's compute and storage. Recommended sizes range from Standard_B2s to Standard_D8as_v5.
This image is packaged by Derek Coleman & Associates Inc and is not affiliated with or endorsed by the NGINX or PHP projects. Quick-start guide and support for this image: www.dcassociatesgroup.com/support