MariaDB is an open-source relational database management system (RDBMS) developed as a fork of MySQL. The main goal of the project is to maintain full compatibility with MySQL while offering improved performance, scalability, and stronger security features. MariaDB is widely used across various sectors, from small websites to large-scale business systems, thanks to its stability and community-friendly open-source license.
On May 24, 2024, the development team released MariaDB 11.4, the latest Long Term Support (LTS) version designed for long-term use in production environments. According to endoflife.date, this version will receive Community Support until May 29, 2029, and Enterprise Support until January 16, 2033. With its extended support period, MariaDB 11.4 is an excellent choice for system administrators and developers seeking long-term stability and security.
This tutorial will guide you step-by-step through installing MariaDB 11.4 on Ubuntu 24.04, covering installation, security configuration, database and user creation, and solutions to common issues.
System Update
Before starting the installation, make sure your system is up to date:
sudo apt update && sudo apt upgrade -yAdd the MariaDB Repository
MariaDB 11.4 is not available in Ubuntu 24.04’s default repositories, so we’ll add the official MariaDB repository.
Download the MariaDB repository key:
sudo apt install apt-transport-https curl -y
sudo mkdir -p /etc/apt/keyrings
sudo curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp'Create the repository file:
sudo nano /etc/apt/sources.list.d/mariadb.sourcesAdd the following configuration:
# MariaDB 11.4 repository list
# https://mariadb.org/download/
X-Repolib-Name: MariaDB
Types: deb
# deb.mariadb.org is a dynamic mirror if your preferred mirror goes offline. See https://mariadb.org/mirrorbits/ for details.
URIs: https://deb.mariadb.org/11.4/ubuntu
Suites: noble
Components: main main/debug
Signed-By: /etc/apt/keyrings/mariadb-keyring.pgpInstall MariaDB Server
Once the repository has been added, install MariaDB 11.4 with the following commands:
sudo apt update
sudo apt install mariadb-server -yAfter installation, check the MariaDB service status:
sudo systemctl status mariadbMake sure the status shows active (running).
Secure the MariaDB Installation
MariaDB provides a built-in security script to remove unsafe default configurations and set the root password.
Run the following command:
sudo mariadb-secure-installationYou will be prompted to answer several questions:
- Set the root password
- Remove anonymous users
- Disallow root login remotely
- Remove the test database
- Reload privilege tables
- It is recommended to answer Y (Yes) to all security-related prompts.
Access MariaDB
After completing the configuration, log in to the MariaDB shell:
sudo mariadb -u root -pEnter the root password you set earlier.
Create a New Database and User
Once logged into the MariaDB shell, create a new database:
CREATE DATABASE project_db;Then, create a new user and grant privileges:
CREATE USER 'bitnesia'@'localhost' IDENTIFIED BY 'StrongPassword123!';
GRANT ALL PRIVILEGES ON project_db.* TO 'bitnesia'@'localhost';
FLUSH PRIVILEGES;
exitCommon Troubleshooting
Below are some common issues you might encounter during installation or configuration:
MariaDB Fails to Start
Check the service status:
sudo systemctl status mariadbIf there’s an error, try restarting the service:
sudo systemctl restart mariadbOr inspect the logs for details:
sudo journalctl -xeu mariadbFailed to Log In as Root
If logging in with sudo mariadb -u root -p fails, try accessing directly without a password:
sudo mariadbThen reset the root password:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewStrongPassword123!';
FLUSH PRIVILEGES;MariaDB Port Not Open for Remote Access
Edit the configuration file:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnfFind the line:
bind-address = 127.0.0.1Change it to:
bind-address = 0.0.0.0Restart the service:
sudo systemctl restart mariadbIf your system uses UFW (Uncomplicated Firewall), ensure that port 3306 is open for connections from trusted IPs or networks.
To allow connections from a specific IP:
sudo ufw allow from 192.168.1.10 to any port 3306To allow connections from the entire local network:
sudo ufw allow from 192.168.1.0/24 to any port 3306To allow connections from anywhere (not recommended for public servers):
sudo ufw allow 3306/tcpCheck the firewall rules:
sudo ufw statusConclusion
By following the steps above, you have successfully installed MariaDB 11.4 LTS on Ubuntu 24.04. This version offers long-term stability and high performance, making it suitable for both production database servers and development environments. Remember to maintain security by applying regular updates and performing scheduled data backups.




