MariaDB Installation for Debian 12: A Clear Guide for New Users
If you're new to Linux servers and databases, this guide is for you. Learning how to install MariaDB on Debian 12 can sound intimidating, but it’s actually quite simple when broken into clear steps. MariaDB is a powerful, open-source database server that is fully compatible with MySQL and is widely used in web development and enterprise applications.
To begin, make sure your system is up to date:
sudo apt update && sudo apt upgrade -y
Then, install MariaDB using the official Debian package repository:
sudo apt install mariadb-server -y
This command will download and install MariaDB along with its necessary dependencies.
After installation, enable and start the MariaDB service:
sudo systemctl enable mariadb
sudo systemctl start mariadb
To check if the server is running correctly:
sudo systemctl status mariadb
Next, secure your installation by running:
sudo mysql_secure_installation
This script helps configure root password access, removes anonymous users, and disables remote root login—all essential steps for better security.
You can now log in to MariaDB with:
sudo mariadb
From here, you’re ready to create databases and users, or run SQL queries.
For a full walkthrough with screenshots and deeper configuration options, check out this helpful guide on how to install MariaDB on Debian 12.
Have questions or ran into issues? Share your experience or troubleshooting tips in the comments below—let’s help each other learn!

