MariaDB 11.8 on Ubuntu 26.04 on Azure User Guide
Overview
MariaDB is the open source relational database created by the original developers of MySQL, compatible with MySQL clients, drivers and SQL. Release 11.8 is a long-term support release: it adds native vector search (the VECTOR data type and vector indexes) for similarity search next to your relational data, and it is the release Ubuntu 26.04 LTS ships and supports. The cloudimg image installs MariaDB 11.8.6 from the Ubuntu 26.04 LTS main archive, so Ubuntu's security updates and unattended upgrades keep the database patched with the operating system. The database files live on a dedicated Azure data disk, and each VM makes its own administrator password and TLS certificate on first boot. cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours.
What is included:
- MariaDB 11.8.6 server and client (
mariadb-server,mariadb-client) from the Ubuntu 26.04 main archive - The server on TCP port
3306, run by systemd asmariadband started at boot - The data directory on a dedicated 32 GiB Azure data disk at
/var/lib/mariadb, separate from the operating system disk and independently resizable - No password in the image: first boot makes a unique password for the
dbadminadministrator account and a unique self-signed TLS certificate for each VM - Every TCP connection must use TLS (1.2 or 1.3); an unencrypted login is refused, and the database
rootaccount has no network login - cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours
Prerequisites
An active Azure subscription, an SSH key pair, and a VNet + subnet in the target region. Standard_B2s (2 vCPU / 4 GiB RAM) is a good starting point; choose a larger size and data disk as your data grows. NSG inbound: allow 22/tcp from your management network, and open 3306/tcp only to the networks whose applications use the database. Never open 3306 to the whole internet.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for MariaDB 11.8 LTS on Ubuntu 26.04 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). After deployment, add an NSG rule for 3306 scoped to your own networks. Then Review + create -> Create.
Step 2 - Deploy from the Azure CLI
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn cloudimg1647283583153:mariadb-ubuntu-26-04:default:latest
az vm create \
--resource-group <your-rg> \
--name mariadb \
--image cloudimg1647283583153:mariadb-ubuntu-26-04:default:latest \
--size Standard_B2s \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_ed25519.pub \
--vnet-name <your-vnet> --subnet <your-subnet> \
--public-ip-sku Standard
Step 3 - Connect to your VM
ssh azureuser@<vm-public-ip>
Step 4 - Confirm MariaDB is installed and running
MariaDB runs as the mariadb systemd unit and listens on port 3306. Check the version, the service, the listener and the data disk:
mariadb --version
systemctl is-active mariadb
ss -tln | grep ':3306 ' | awk '{print $1, $4}'
findmnt -no SOURCE,TARGET,FSTYPE /var/lib/mariadb
You should see MariaDB 11.8.6, active, a listener on 3306 and the dedicated data disk (its device name can differ on your VM):
mariadb from 11.8.6-MariaDB, client 15.2 for debian-linux-gnu (x86_64) using EditLine wrapper
active
LISTEN 0.0.0.0:3306
/dev/sda /var/lib/mariadb ext4

Step 5 - Retrieve your per-VM dbadmin password
Each VM makes its own dbadmin password on first boot and writes it to a root-only credentials file:
sudo cat /root/mariadb-credentials.txt
# MariaDB 11.8 LTS on Ubuntu 26.04 LTS (cloudimg Azure Marketplace image)
# These credentials are unique to THIS VM, made on its first boot. Store them safely.
MARIADB_USER=dbadmin
MARIADB_PASSWORD=********************************
MARIADB_HOST=13.68.145.26
MARIADB_PORT=3306
#
# Connect from your workstation (every TCP connection must use TLS):
# mariadb -h 13.68.145.26 -P 3306 -u dbadmin -p --ssl
# On the VM itself, as the database root user: sudo mariadb
# The server's TLS certificate is self-signed and unique to this VM.
MARIADB_HOST is your VM's public IP address. dbadmin has every privilege, including granting them to other accounts. Store the password in your secrets manager. The commands below read it from this file, so you never paste it on the command line.
Step 6 - Sign in on the VM
On the VM itself the operating system's root user signs in to MariaDB as root over the local socket, without a password:
sudo mariadb -e 'SELECT CURRENT_USER(), VERSION();'
CURRENT_USER() VERSION()
root@localhost 11.8.6-MariaDB-5ubuntu0.1 from Ubuntu
Step 7 - Sign in with the password over TLS
A TCP connection uses the password. Read it from the credentials file into MYSQL_PWD, then confirm the login works and that the session is encrypted:
export MYSQL_PWD="$(sudo grep -m1 '^MARIADB_PASSWORD=' /root/mariadb-credentials.txt | cut -d= -f2-)"
mariadb -h 127.0.0.1 -u dbadmin \
-e "SHOW SESSION STATUS WHERE Variable_name IN ('Ssl_version', 'Ssl_cipher');"
unset MYSQL_PWD
Variable_name Value
Ssl_cipher TLS_AES_256_GCM_SHA384
Ssl_version TLSv1.3

Step 8 - Create an application database and user
Give each application its own database and user rather than using dbadmin. Choose your own strong password in place of the example:
sudo mariadb <<'SQL'
CREATE DATABASE appdb;
CREATE USER 'appuser'@'%' IDENTIFIED BY 'change-me-Str0ng';
GRANT ALL PRIVILEGES ON appdb.* TO 'appuser'@'%';
SELECT User, Host FROM mysql.user WHERE User = 'appuser';
SQL
User Host
appuser %
Sign in as the new user, create a table, write a row and read it back:
MYSQL_PWD='change-me-Str0ng' mariadb -h 127.0.0.1 -u appuser appdb <<'SQL'
CREATE TABLE notes (id INT AUTO_INCREMENT PRIMARY KEY, body VARCHAR(200) NOT NULL, created TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
INSERT INTO notes (body) VALUES ('hello from MariaDB 11.8');
SELECT id, body FROM notes;
SQL
id body
1 hello from MariaDB 11.8

Step 9 - Confirm the secure defaults
The settings cloudimg adds are in one file, /etc/mysql/mariadb.conf.d/99-cloudimg.cnf, read after Ubuntu's own 50-server.cnf. Check the ones that matter on the running server:
sudo mariadb -e 'SELECT @@require_secure_transport, @@tls_version, @@bind_address, @@local_infile, @@log_bin, @@secure_file_priv\G'
*************************** 1. row ***************************
@@require_secure_transport: 1
@@tls_version: TLSv1.2,TLSv1.3
@@bind_address: 0.0.0.0
@@local_infile: 0
@@log_bin: 0
@@secure_file_priv: /var/lib/mysql-files/
Every TCP connection must use TLS, LOAD DATA LOCAL is off, the server reads and writes files only in /var/lib/mysql-files/, and there is no binary log until you turn one on. An unencrypted login is refused even with the right password, a wrong password is refused, and the database root account cannot sign in over the network at all. Each command prints the server's refusal:
export MYSQL_PWD="$(sudo grep -m1 '^MARIADB_PASSWORD=' /root/mariadb-credentials.txt | cut -d= -f2-)"
mariadb -h 127.0.0.1 -u dbadmin --skip-ssl -e 'SELECT 1' 2>&1 | grep -o 'Connections using insecure transport are prohibited.*'
MYSQL_PWD='not-the-password' mariadb -h 127.0.0.1 -u dbadmin -e 'SELECT 1' 2>&1 | grep -o "Access denied for user 'dbadmin'.*"
MYSQL_PWD='' mariadb -h 127.0.0.1 -u root -e 'SELECT 1' 2>&1 | grep -o "Access denied for user 'root'@'127.0.0.1'"
unset MYSQL_PWD
Connections using insecure transport are prohibited while --require_secure_transport=ON.
Access denied for user 'dbadmin'@'127.0.0.1' (using password: YES)
Access denied for user 'root'@'127.0.0.1'

Step 10 - Connect from your own machine
Open 3306/tcp on the VM's NSG to your own address or network only, then connect with any MariaDB or MySQL client. With the mariadb client:
mariadb -h <vm-public-ip> -P 3306 -u appuser -p --ssl appdb
The server's certificate is self-signed and unique to this VM. A MariaDB 11.4 or later client checks it without a certificate file, from the password you sign in with. With an older or MySQL client, use --ssl-mode=REQUIRED to encrypt the connection, or copy /etc/mysql/ssl/server-cert.pem from the VM to your machine and pass it with --ssl-ca=server-cert.pem to check the certificate as well. In an application driver, turn TLS on in its connection settings: the server refuses a connection without it.
If the address in the credentials file is not the one your clients use (a VM without a public IP, a load balancer, or a DNS name), point the VM at the right one; it rewrites the credentials file and the login message, makes a new certificate for that address and restarts MariaDB:
sudo cloudimg-set-public-address <your-ip-or-dns-name>
Step 11 - Remove the example
When you are done with the example from Step 8, drop it:
sudo mariadb -e "DROP DATABASE appdb; DROP USER 'appuser'@'%';"
sudo mariadb -e 'SHOW DATABASES;'
Database
information_schema
mysql
performance_schema
sys
Maintenance
- Persistence: the data directory,
/var/lib/mariadb, is the dedicated data disk, so your data survives reboots and the disk can be resized on its own. To grow it, resize the disk in Azure, then runsudo resize2fs "$(findmnt -no SOURCE /var/lib/mariadb)"on the VM. - Patching: MariaDB comes from the Ubuntu archive, so
sudo apt update && sudo apt upgradeand the enabled unattended upgrades apply MariaDB security fixes with the operating system's. - Configuration: put your own settings (for example
innodb_buffer_pool_sizeormax_connections) under[mariadbd]in a new file in/etc/mysql/mariadb.conf.d/whose name sorts after99-cloudimg.cnf, thensudo systemctl restart mariadb. The server logs to the systemd journal:sudo journalctl -u mariadb. - Password: change the dbadmin password with
sudo mariadb -e "ALTER USER 'dbadmin'@'%' IDENTIFIED BY '<new-password>';", then update/root/mariadb-credentials.txtor remove it. - Backups:
mariadb-dumpfor logical backups,mariadb-backupfor a physical hot copy (sudo apt install mariadb-backup), and Azure disk snapshots of the data disk for point-in-time copies of the volume. - TLS: for production, replace
/etc/mysql/ssl/server-cert.pemandserver-key.pemwith a certificate from your own CA (key owned byroot:mysql, mode0640; keep them under/etc/mysql/, which Ubuntu's AppArmor profile lets MariaDB read) and restart MariaDB.
Support
cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours. Contact support@cloudimg.co.uk.
MariaDB Server is released under the GNU General Public License version 2. MariaDB is a registered trademark of MariaDB Corporation Ab. This image is provided by cloudimg and is not affiliated with or endorsed by MariaDB Corporation Ab or the MariaDB Foundation.