How to install MariaDB 10 on Debian 11 Bullseye Linux

Guide to learn the MariaDB 10 installation on Debian 11 Bullseye. Currently while writing this tutorial the latest version was MariaDB Server 10.6. 

The default version available to install on Debian 11 Linux while performing this guide was MariaDB 10.5, however the latest available is 10.6. The new version comes with few updates and new features in the following areas:

  • Atomic DDL
  • SQL Syntax
  • Oracle Compatibility
  • InnoDB
  • Replication, Galera and Binlog
  • Performance Schema
  • Storage Engines
  • Fixing of Security Vulnerabilities

To get the full details of fixed bugs and added new features, see the official page that has listed Improvements in 10.06.


Install MariaDB Server 10.6 on Debian 11 Bullseye Linux


1. Refresh Repository cache

Run the system update command that will install all the available updates along with refreshing of system repository cache.

sudo apt update


Note: If you want the default available version in the Debian 11 base repo then you can check that using a command:

apt show mariadb-server

Whereas to install it the command will be:

sudo apt install mariadb-server


Those who want the 10.6 version can go for further steps…


2. Install common packages

There are few packages that we require to easily manage our distribution and independent software vendor sources.

sudo apt-get install software-properties-common dirmngr


2. Importing the MariaDB GPG Public Key on Debian 11

Let’s download and add a GPG key, signed by MariaDB developers to verify the packages that we get to install this Database. This will help the system to confirm whether the packages are from the authentic source and have not been altered.

sudo chmod -c 644 mariadb_release_signing_key.asc
sudo mv -vi mariadb_release_signing_key.asc /etc/apt/trusted.gpg.d/


3. Add Repository

Next, add the MariaDB repo meant to get the version 10.06 manually on your Debian 11 Linux; using the below-given command:

Paste the whole block of the given command and hit the Enter key.

echo "deb [arch=amd64,arm64,ppc64el] \ \
bullseye main" | sudo tee /etc/apt/sources.list.d/mariadb.list
sudo apt update


4. Install MariaDB 10.6 on Debian 11 Bullseye

After performing the all above-given commands we can easily install MariaDB 10.6. To check and confirm we can use the APT show command:

apt show mariadb-server

Add MariaDB repository in Debian 11

To install it:

sudo apt install mariadb-server

install mariadb server on Debian 11


5. Check the Database server status

Once the installation is completed we can check the version and status of the Database server, whether it is running in the background or not.

mariadb --version
systemctl status mariadb

Whereas, to stop, restart and disable the service:

sudo systemctl stop mariadb

To enable and disable, so that it will not start automatically:

sudo systemctl enable mariadb
sudo systemctl disable mariadb

For restarting:

sudo systemctl restart mariadb

6. Secure MariaDB installation

If you are about to use a Database in some application via a public network then it is recommended to run a command to secure the MariaDB.


As you run the command, a text-based wizard will open, just follow it. Set the root password for MariaDB, remove demo database, disable remote login and remove anonymous user accounts.

secure MariaDB installation


Uninstallation – MariaDB 10

If you don’t require the Database on your Debian Server or Desktop then use the below commands:

sudo apt remove maridb-server

Remove GPG key

sudo rm /etc/apt/trusted.gpg.d/mariadb_release_signing_key.asc

Remove Repo

sudo rm /etc/apt/sources.list.d/mariadb.list



Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.