How to Install MariaDB on Ubuntu 25.04 (Step-by-Step Guide for 2025)
Here is a step-by-step guide to installing MariaDB on Ubuntu 25.04 (or similar versions) :
✅ Step 1: Update Your System
sudo apt update && sudo apt upgrade -y
This ensures all your packages are up-to-date.
✅ Step 2: Install MariaDB Server
sudo apt install mariadb-server -y
This will install the latest MariaDB version available from Ubuntu’s default repositories.
✅ Step 3: Secure MariaDB Installation
sudo mariadb-secure-installation
You'll be asked several prompts :
- Set root password? → Yes
- Remove anonymous users? → Yes
- Disallow root login remotely? → Yes
- Remove test database? → Yes
- Reload privilege tables now? → Yes
✅ Step 4: Enable and Start MariaDB
sudo systemctl enable mariadb
sudo systemctl start mariadb
To check its status :
sudo systemctl status mariadb
✅ Step 5: Test the Installation
Log in to the MariaDB shell :
sudo mariadb
Then, type :
SELECT VERSION();
Type 'exit;' to leave the shell.
✅ Optional: Allow Remote Connections
1. Open config :
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
2. Find the line :
bind-address = 127.0.0.1
Replace it with :
bind-address = 0.0.0.0
3. Restart MariaDB :
sudo systemctl restart mariadb
4. Allow MariaDB through firewall (if active) :
sudo ufw allow 3306
✅ Done!
MariaDB is now installed and running on your Ubuntu 25.04 system.
Tags :