Coppermine Photo Gallery on Ubuntu 24.04 on Azure User Guide
Overview
Coppermine Photo Gallery is a mature open-source, multi-user web photo gallery: categories and albums, user accounts with per-album permissions, uploads, comments, ratings, EXIF display, keyword search and e-cards, all on the classic LAMP stack. The cloudimg image installs Coppermine 1.6.29 on a full LAMP stack from the Ubuntu 24.04 repositories (nginx, PHP 8.3-FPM and MariaDB), completes the entire installation at build time so there is no web setup wizard to work through, seeds a small sample gallery so a fresh VM shows real thumbnails immediately, stores the MariaDB database and every uploaded photo on a dedicated Azure data disk, and generates the database password, the administrator account and the site security token uniquely on the first boot of each VM. Backed by 24/7 cloudimg support.
What is included:
- Coppermine Photo Gallery 1.6.29 (GPL-3.0) served on port 80 by nginx via the PHP 8.3-FPM FastCGI socket
- Thumbnails generated by the bundled PHP GD extension - no external image tooling required
- A seeded public sample album with rendered thumbnails so the gallery is not empty on first launch
- MariaDB on loopback only, with its data directory on a dedicated Azure data disk
- A dedicated Azure data disk at
/var/lib/copperminefor the database and all uploaded photos - A per-VM database password, administrator account and site token generated on first boot
- The installer (
install.php) removed after setup so it can never be re-run nginx.service,php8.3-fpm.serviceandmariadb.serviceas systemd units, enabled and active- 24/7 cloudimg support
Prerequisites
An active Azure subscription, an SSH key pair, and a VNet plus subnet in the target region. Standard_B2s (2 vCPU / 4 GiB RAM) is a good starting point. NSG inbound: allow 22/tcp from your management network and 80/tcp for the Coppermine web interface (front with TLS for public exposure - see Enabling HTTPS).
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Coppermine Photo Gallery by cloudimg, and select Create. On Basics pick your subscription, resource group, region and size; under Administrator account choose SSH public key and paste your key; under Inbound port rules allow SSH (22) and HTTP (80). Review the dedicated data disk on the Disks tab, then Review + create -> Create.
Step 2 - Deploy with the Azure CLI
az vm create \
--resource-group <your-rg> --name coppermine \
--image <cloudimg-coppermine-image-urn> \
--size Standard_B2s \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_ed25519.pub \
--vnet-name <your-vnet> --subnet <your-subnet> \
--public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name coppermine --port 80 --priority 1010
Step 3 - Connect to your VM
ssh azureuser@<vm-public-ip>
Step 4 - Confirm the LAMP stack is running
On first boot Coppermine rotates its database password, resets the administrator account to a fresh per-VM password, rotates the site security token and starts the stack.
systemctl is-active nginx php8.3-fpm mariadb
All three report active. You can confirm the component versions and that the gallery answers on port 80:
php -v | head -1
mariadb --version
curl -s -o /dev/null -w 'HTTP %{http_code}\n' http://127.0.0.1/
The gallery home returns HTTP 200. MariaDB listens on loopback only; PHP-FPM runs on a Unix socket rather than a TCP port.

Step 5 - Retrieve the administrator password
The administrator account is unique to your VM and is generated on first boot. Read it as root:
sudo cat /root/coppermine-credentials.txt
The file (mode 600, owned by root) contains the login (admin), the sign-in URL and a unique password, plus the database name, user and password. Every guessable default is rejected by the real login form, and exactly one account - your administrator - exists on a fresh instance.

Step 6 - Browse to your gallery
Browse to http://<vm-public-ip>/. The image ships with a seeded sample album, so you see a real gallery with rendered thumbnails immediately rather than an empty install.

Step 7 - Sign in as the administrator
Browse to http://<vm-public-ip>/login.php and sign in with admin and the password from the credentials file.

Step 8 - Browse an album and view a photo
Open the sample album from the gallery home to see its thumbnails. Coppermine generates a thumbnail and an intermediate-size copy of every uploaded photo automatically, so albums stay fast to browse.

Click any thumbnail to view the photo at intermediate size, with a film-strip of the rest of the album and navigation controls.

Step 9 - Create albums and upload your own photos
Signed in as the administrator, use the gallery menu to open the album and category managers. Create a category, add one or more albums to it, then upload photos into an album - Coppermine builds the thumbnails and intermediate images for you. You can delete the seeded sample album at any time.

Step 10 - How the image is secured
The Coppermine installer (install.php) and phpinfo.php are removed after the build, so a visitor can never re-run the installer or read your server configuration. The database credential in include/config.inc.php, and the sql/ schema files, are denied over HTTP - only the gallery itself is served.
curl -s -o /dev/null -w 'install.php HTTP %{http_code}\n' http://127.0.0.1/install.php
curl -s -o /dev/null -w 'config.inc.php HTTP %{http_code}\n' http://127.0.0.1/include/config.inc.php
Both return HTTP 404/403.

Step 11 - The dedicated data disk
The MariaDB database and every uploaded photo (originals plus generated thumbnails) live on a dedicated Azure data disk mounted at /var/lib/coppermine, separate from the OS disk. This keeps your gallery independent of the OS image and lets you resize the disk as your collection grows.
df -h /var/lib/coppermine
findmnt /var/lib/coppermine
readlink -f /var/www/coppermine/albums
The albums/ directory resolves onto the data disk, and MariaDB's data directory is under /var/lib/coppermine/mysql.

Step 12 - Enabling HTTPS
For any public deployment, front Coppermine with TLS. Point a DNS A record at your VM's public IP, then install a certificate with Certbot and the nginx plugin. Run the following as prose-driven steps on your VM (replace the placeholders with your real values; do not paste them verbatim):
- Install Certbot:
sudo apt-get update && sudo apt-get install -y certbot python3-certbot-nginx - Obtain and install a certificate for your domain, supplying your contact email when prompted, by running certbot with the nginx plugin for
your-domain.example.com. - Coppermine derives its base URL from the request, so it automatically switches generated links to
https://once TLS is terminated in front of it. No configuration change is required.
Certbot installs a renewal timer automatically; certificates renew without further action.
Step 13 - Maintenance
- Updates: the OS continues to receive unattended security updates. Coppermine itself can be updated from the admin tools, or by replacing the application files with a newer 1.6.x release and running its upgrade routine.
- Backups: back up the MariaDB
copperminedatabase (for example withmysqldump) and the/var/lib/coppermine/albumsdirectory, which together hold your gallery data and every uploaded photo. - Logs: web server logs are under
/var/log/nginx/; PHP-FPM logs are under/var/log/php8.3-fpm.log.
Support
This image is maintained by cloudimg and backed by 24/7 support. If you need help deploying or operating Coppermine Photo Gallery on Azure, contact the cloudimg team through the cloudimg website.