Ad
Databases Azure

Adminer on Ubuntu 24.04 on Azure User Guide

| Product: Adminer on Ubuntu 24.04 LTS on Azure

Overview

Adminer is a full featured database management tool that ships as a single, self contained PHP file. It is the lightweight cousin of phpMyAdmin: from an ordinary browser you can browse and edit tables, run SQL, import and export data, and manage users and privileges, with no local client to install. The cloudimg image serves Adminer 5.4.2 with nginx and PHP 8.3 FPM on a hardened, fully patched Ubuntu 24.04 LTS base, together with a bundled local MariaDB server so the appliance is useful on its own. Adminer runs behind an nginx reverse proxy on port 80. The bundled MariaDB listens only on the loopback interface (127.0.0.1:3306) and keeps its data on a dedicated Azure data disk. A unique MariaDB root password is generated on the first boot of every VM. Adminer can also administer external MySQL, MariaDB and PostgreSQL servers, so the same appliance is both a self contained database host and a browser based console for the rest of your estate. Backed by 24/7 cloudimg support.

What is included:

  • Adminer 5.4.2 served by nginx and PHP 8.3 FPM, managed by systemd
  • A bundled MariaDB 10.11 server, the database Adminer administers out of the box
  • The Adminer web interface on :80 with cookie authentication
  • A per VM MariaDB root password generated on first boot and recorded in a root only file
  • Loopback login with Server localhost, so the customer only enters the user and password
  • MariaDB bound to 127.0.0.1 only, never exposed to the network
  • A dedicated Azure data disk at /var/lib/mysql for all databases
  • nginx.service, php8.3-fpm.service and mariadb.service as enabled systemd units
  • An unauthenticated /healthz endpoint for Azure Load Balancer health probes
  • 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 sensible starting point; size up for larger databases or heavier query loads. NSG inbound: allow 22/tcp from your management network and 80/tcp for the web interface. Adminer serves plain HTTP on port 80; for production, terminate TLS in front of it with your own domain. The bundled MariaDB is never exposed: it listens on 127.0.0.1 only, so port 3306 stays off the network.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Adminer 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 then Create.

Step 2 - Deploy from the Azure CLI

az vm create \
  --resource-group <your-rg> \
  --name adminer \
  --image <marketplace-image-urn> \
  --size Standard_B2s \
  --admin-username azureuser \
  --generate-ssh-keys \
  --public-ip-sku Standard

Then open port 80 to the web interface:

az vm open-port --resource-group <your-rg> --name adminer --port 80

Step 3 - Confirm the services are running

SSH in as azureuser and confirm nginx, PHP FPM and MariaDB are all active. Note that MariaDB listens only on 127.0.0.1:3306 while nginx serves the web interface on port 80.

systemctl is-active nginx php8.3-fpm mariadb adminer-firstboot
ss -tlnp | grep -E ':80 |:3306 ' | sed 's/  */ /g'

The nginx, php8.3-fpm, mariadb and adminer-firstboot services active, with nginx on port 80 and MariaDB bound to loopback 127.0.0.1:3306

Step 4 - Retrieve the per VM database password

Every VM generates its own MariaDB root password on first boot and writes it, along with the login server, user and URL, to a root only credentials file. Read it with sudo:

sudo cat /root/adminer-credentials.txt

The per VM Adminer credentials file, showing the login server localhost, the user root, the generated password and the Adminer URL

You sign in to Adminer with Server localhost, username root and the ADMINER_ROOT_PASSWORD from this file. On the box itself you can also run sudo mariadb to reach the database directly over the local socket without a password.

Step 5 - Sign in to Adminer

Browse to http://<vm-public-ip>/. Adminer opens on its login screen. Leave System on MySQL / MariaDB, enter Server localhost, username root and the password from Step 4, and leave Database blank to see every database.

The Adminer login page with the MySQL system, server localhost and user root entered

Once signed in you land on the server overview, which lists every database on the bundled MariaDB server with its collation and quick links to select, export or drop it.

The Adminer database overview listing the databases on the bundled MariaDB server

Step 6 - Browse tables and run SQL

Select a database in the left navigation to expand its tables, then click select on a table to browse its rows. The data grid shows the rows with inline edit and delete actions, and lets you sort, search and page through large tables.

Browsing the demo customers table in Adminer, showing rows with inline edit and delete actions

The SQL command page gives you a full query editor. Type any statement and click Execute to run it; results appear below with options to export or edit.

The Adminer SQL command page with a sample GROUP BY query entered

You can do the same from the command line on the VM. Read the root password from the credentials file and list the databases over the loopback interface:

PW=$(sudo grep '^ADMINER_ROOT_PASSWORD=' /root/adminer-credentials.txt | cut -d= -f2-); mysql -h127.0.0.1 -uroot -p"$PW" -e 'SHOW DATABASES;'

Step 7 - Administer external database servers

Adminer is not limited to the bundled MariaDB. To manage another server, sign out and, on the login screen, enter that server's host under Server (for example db.internal:3306), its username and password, and pick the right System (MySQL, MariaDB, PostgreSQL, SQLite and others are supported when the matching PHP driver is present). This lets the appliance act as a single browser based console for the rest of your database estate while keeping its own bundled MariaDB private on loopback.

Step 8 - Verify the stack

Confirm the Adminer version, the PHP and MariaDB versions, and the health endpoint that Azure Load Balancer probes:

grep -oaE '5\.4\.2' /var/www/adminer/index.php | head -1
php -v | head -1
mariadb --version
curl -sI http://127.0.0.1/healthz | head -1

The Adminer 5.4.2 version, PHP 8.3 and MariaDB 10.11 versions and the healthz endpoint returning 200

Step 9 - Where your data lives

All databases live on a dedicated Azure data disk mounted at /var/lib/mysql, separate from the OS disk. This is the MariaDB datadir, captured into the image and re provisioned on every VM. Confirm the mount and the filesystem:

df -h /var/lib/mysql | tail -1
findmnt -no SOURCE,TARGET,FSTYPE /var/lib/mysql

The MariaDB datadir on the dedicated ext4 data disk mounted at /var/lib/mysql

Security notes

  • Adminer serves plain HTTP on port 80. For production, put it behind your own TLS terminating reverse proxy or an Azure Application Gateway with a certificate for your domain, and restrict port 80 in the NSG to trusted networks.
  • The bundled MariaDB listens on 127.0.0.1 only and is never exposed to the network; port 3306 stays off the NSG. On box maintenance uses sudo mariadb over the local socket.
  • The per VM root password lives in /root/adminer-credentials.txt, readable only by root. Rotate it with a standard ALTER USER if you wish, and keep a copy somewhere safe.
  • Keep the VM patched. The image ships fully patched with unattended security upgrades enabled.

Support

cloudimg images come with 24/7 support. If you have any questions about this Adminer image or need help with your deployment, contact us through the cloudimg website.