How to install MariaDB 10.7 on Ubuntu 21.04

In this guide we are going to install MariaDB 10.7 development version, but first what is MariaDB?

MariaDB Server is one of the most popular open source relational databases. It’s made by the original developers of MySQL and guaranteed to stay open source. It is part of most cloud offerings and the default in most Linux distributions.

It is built upon the values of performance, stability, and openness, and MariaDB Foundation ensures contributions will be accepted on technical merit. Recent new functionality includes advanced clustering with Galera Cluster 4, compatibility features with Oracle Database and Temporal Data Tables, allowing one to query the data as it stood at any point in the past.

You need to have Ubuntu 20.04 server with non root administrative privileges and a firewall configured with UFW. Check out this for initial server setup guide for Ubuntu 20.04.

Installing MariaDB

Begin by updating your apt repository with the following command on your terminal

$ sudo apt update

After updates are complete you can then install MariaDB server

$ sudo apt install mariadb-server

The installation process will not ask you to set password and this leaves Mariadb insecure. We will use a script that mariadb-server package provides strict access to the server and remove unused accounts. Read more about security script here.

Initial Configuration for MariaDB 10.7

Let us run the security script below:

$ sudo mysql_secure_installation

Testing MariaDB

Check the status of MariaDB with the following command:

$ sudo systemctl status mariadb

Now we can run few database operations to check if its working

Show the user list

# select user,host,password from mysql.user;

Create test database

# create database test_database;


We have learned how to install MariaDB on Ubuntu 21.04 server and secured it using the mysql_secure_installation script. You can now practice running SQL queries to learn more.

About Kipkoech Sang

I am a technology enthusiast who loves to share gained knowledge through offering daily tips as a way of empowering others. I am fan of Linux and all other things open source.
View all posts by Kipkoech Sang →

Leave a Reply

Your email address will not be published. Required fields are marked *