How to Install MariaDB 10.8 on Debian 11 Bullseye
You’re running a fresh Bullseye install and need the newer MariaDB 10.8 instead of the distro’s default 10.5. This guide shows the exact commands, why each step matters, and how to verify everything is up‑and‑running.
Add the official MariaDB repository
Debian’s packages are stale; pulling from MariaDB’s own repo gives you the right version and future updates.
sudo apt-get install -y software-properties-common gnupg2 curl
curl -LsS https://mariadb.org/mariadb_release_signing_key.asc | sudo apt-key add -
The first line installs tools needed to manage extra repos. The second fetches MariaDB’s signing key so the system can trust packages from their server.
sudo add-apt-repository 'deb [arch=amd64] http://mirror.mariadb.org/repo/10.8/debian bullseye main'
add-apt-repository writes a new entry to /etc/apt/sources.list.d, pointing apt at the 10.8 pool for Bullseye.
Refresh package lists and install MariaDB
Now that apt knows where to look, pull the index and grab the server package.
sudo apt-get update
sudo apt-get install -y mariadb-server
update pulls the latest metadata; without it you’d still get 10.5 from Debian’s mirrors. The mariadb-server meta‑package will automatically select version 10.8 because that’s the highest available from the newly added repo.
Secure the installation
Running mysql_secure_installation is optional but saves you a lot of headaches later (especially if you’ve ever forgotten to set a root password).
sudo mysql_secure_installation
You’ll be prompted to set a strong root password, remove anonymous accounts, disallow remote root logins, and delete the test database. Say “yes” to everything unless you have a very specific need otherwise.
Verify the version is really 10.8
It’s easy to assume you got the right package, but a quick check confirms it.
mysql --version
You should see something like mysqld Ver 10.8.3-MariaDB-1:10.8.3+maria~bullseye in the output.
Common pitfall – stale caches after a failed install
I’ve seen this happen after a botched upgrade where apt kept pulling the old 10.5 from its cache. If you run into “Package has no installation candidate,” clear the cache:
sudo apt-get clean
sudo apt-get update
Then retry the install command.
Enable automatic start and check service status
Debian should enable MariaDB automatically, but double‑check that it’s enabled and running.
sudo systemctl enable mariadb
sudo systemctl start mariadb
systemctl status mariadb
The status line will show “active (running)” if everything is healthy. If you see a failure, the log snippet displayed right after the status command often points to permission problems in /etc/mysql/mariadb.conf.d/.
That’s it – MariaDB 10.8 should now be serving your applications on Bullseye.