Install/Upgrade MariaDB 10.8 on Debian 11 Bullseye
You’re going to get a clean 10.8 server running on Bullseye, or bump an existing install up without losing your data. The steps below show the reliable way – add MariaDB’s own repo, pull in the right packages, and verify everything works.
Why the default Debian repository isn’t enough
Debian 11 ships with MariaDB 10.5. It runs fine for a test box, but if you need features like system‑versioned tables or the new authentication plugins, 10.8 is mandatory. I once upgraded a home lab after a kernel bump and found the old server refusing to start because the bundled libmariadb3 conflicted with a newer client library. Skipping the official repo usually ends in that kind of version mismatch nightmare.
Add MariaDB’s official repository
Debian makes it easy to add third‑party sources, but you have to be explicit about the distro codename and version.
sudo apt-get install -y software-properties-common curl gnupg2
software-properties-common gives us add-apt-repository, while curl/gnupg2 handle the key.
Now create the repo file:
echo "deb [arch=amd64,arm64] http://mariadb.mirror.nucleus.be/repo/10.8/debian bullseye main" \
| sudo tee /etc/apt/sources.list.d/mariadb.list > /dev/null
Why the mirror? The official MariaDB domain sometimes throttles connections from residential IPs; this European mirror is fast and reliable for most users.
Import the signing key safely
MariaDB signs its packages with a GPG key. Pull it directly from their keyserver rather than trusting any random copy you might find on the internet.
curl -fsSL https://mariadb.org/mariadb_release_signing_key.asc | sudo gpg --dearmor -o /usr/share/keyrings/mariadb-archive-keyring.gpg
Then tell APT to use that key for the new repo:
echo "Signed-By: /usr/share/keyrings/mariadb-archive-keyring.gpg" \
| sudo tee -a /etc/apt/sources.list.d/mariadb.list > /dev/null
Skipping this step or using an outdated key will cause “The following signatures couldn’t be verified” errors during apt update.
Update the package index and install (or upgrade) MariaDB 10.8
sudo apt update sudo apt install -y mariadb-server
If you already have 10.5 installed, APT will treat this as an upgrade. It replaces the old binaries while preserving /etc/mysql/mariadb.conf.d/ and your data directory (/var/lib/mysql). I’ve seen people panic when the service restarts automatically; just keep a terminal open so you can watch the logs if something goes sideways.
Why install mariadb-server instead of pulling individual components? The meta‑package pulls in the correct client libraries, the server daemon, and the appropriate systemd unit. Trying to cherry‑pick packages usually leaves you with mismatched versions that refuse to start.
Verify the installation
sudo mariadb -u root -p -e "SELECT VERSION();"
You should see 10.8.x printed out. Also confirm the service is active:
systemctl status mariadb
If it shows “active (running)”, you’re good to go. In my own setup, after a fresh upgrade I ran mysql_upgrade just to be safe; it re‑creates any missing system tables.
Quick tip: rollback if needed
Should the new version bite you, Debian keeps the old packages in its cache for a short window. You can reinstall 10.5 with:
sudo apt install mariadb-server=1:10.5.* mariadb-client=1:10.5.*
Then purge the MariaDB.org repo file to avoid future accidental upgrades.
That’s it – you now have MariaDB 10.8 on Bullseye without the usual headaches.