MariaDB
Generated on 30 Nov 2026 from the MariaDB catalog page
The MariaDB database was born after Oracle acquired MySQL. With the original core MySQL team, we have added functionality to the MariaDB database that competes with legacy database systems like Oracle at a fraction of the cost. We have added columnar analytics, JSON functionality and Oracle compatibility, and we offer a fully managed cloud database service that offers the full breadth of MariaDB database solutions supporting private, public, hybrid and multicloud strategies.
Today, the MariaDB database is recognized as a distinct database around the world. MariaDB is the new “M” in the LAMP stack, it’s the default over MySQL in the majority of Linux distributions, it’s replacing Oracle and other legacy databases at increasing rates and it’s available in every cloud. MariaDB is everywhere.
Software Included
Creating an App using the Control Panel
Click the Deploy to DigitalOcean button to create a Droplet based on this 1-Click App. If you aren’t logged in, this link will prompt you to log in with your DigitalOcean account.
Creating an App using the API
In addition to creating a Droplet from the MariaDB 1-Click App using the control panel, you can also use the DigitalOcean API. As an example, to create a 4GB MariaDB Droplet in the SFO2 region, you can use the following curl command. You need to either save your API access token to an environment variable or substitute it in the command below.
curl -X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer '$TOKEN'' -d \
'{"name":"choose_a_name","region":"sfo2","size":"s-2vcpu-4gb","image":"mariadb"}' \
"https://api.digitalocean.com/v2/droplets"Getting Started After Deploying MariaDB
Deploy MariaDB Community Server on Ubuntu 24.04. This image installs a pinned MariaDB release from the official MariaDB apt repository, enables UFW for SSH and MySQL/MariaDB client access, and walks you through mysql_secure_installation on first SSH login.
1. SSH in and finish secure setup
ssh root@YOUR_DROPLET_IP
On first login, the image runs /opt/digitalocean_mariadb/setup_mariadb.sh, which launches interactive mysql_secure_installation. Complete that wizard before using the database in production. Typical prompts:
- Set a root password (choose a strong password and store it somewhere safe)
- Remove anonymous users
- Disallow remote root login (recommended unless you have a specific need)
- Remove the test database
- Reload privilege tables
Until the wizard succeeds, it will run again on the next login. After it finishes successfully, the hook is removed from /root/.bashrc.
2. Where credentials live
This 1-Click does not pre-generate a root password file (there is no /root/.digitalocean_password by default).
| Credential | Location |
|---|---|
MariaDB root password |
The password you set during mysql_secure_installation — keep your own secure copy |
| SSH access | Your DigitalOcean SSH key or the root password emailed at Droplet create time |
If you need a written record on the Droplet after setup, create one yourself with restricted permissions, for example:
install -m 600 /dev/null /root/.digitalocean_password
# then store only what you need, e.g. root_mysql_pass=...
3. Log in to MariaDB
On the Droplet (after secure setup):
mariadb -u root -p
If unix_socket auth is still enabled for local root (common before or instead of a password), you can also use:
sudo mariadb
4. Create a database and application user
Prefer an application user instead of connecting as root from your apps:
CREATE DATABASE appdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'appuser'@'%' IDENTIFIED BY 'choose_a_strong_password';
GRANT ALL PRIVILEGES ON appdb.* TO 'appuser'@'%';
FLUSH PRIVILEGES;
For localhost-only apps, use 'appuser'@'localhost' instead of '%'.
Connect as that user:
mariadb -u appuser -p -h 127.0.0.1 appdb
5. Firewall and remote access
UFW is enabled with:
| Port | Service |
|---|---|
22/tcp |
SSH (rate-limited) |
3306/tcp |
MariaDB |
HTTP/HTTPS (80 / 443) are not opened — this image has no web UI.
Check rules:
ufw status
MariaDB packages typically listen on 127.0.0.1 until you allow remote clients. To accept connections from other hosts:
- Edit the server config (commonly under
/etc/mysql/mariadb.conf.d/) and setbind-address = 0.0.0.0(or a specific private IP). - Restart MariaDB:
systemctl restart mariadb - Ensure the MariaDB user host matches the client (
'appuser'@'%'or a specific IP). - Prefer a DigitalOcean Cloud Firewall that allows
3306only from trusted sources — do not leave the database open to the whole internet.
From another machine (only after bind-address and grants allow it):
mariadb -u appuser -p -h YOUR_DROPLET_IP appdb
For a safer alternative without exposing 3306, use an SSH tunnel:
ssh -L 3307:127.0.0.1:3306 root@YOUR_DROPLET_IP
mariadb -u appuser -p -h 127.0.0.1 -P 3307 appdb
6. Secure the install
- Finish
mysql_secure_installationon first login and keep the root password private. - Do not use the MariaDB
rootaccount from applications; create least-privilege users per database. - Keep
Disallow root login remotelyenabled unless you have a controlled need. - Restrict who can reach port
3306with a Cloud Firewall (or rely on SSH tunnels and leave MariaDB bound to localhost). - Keep the Droplet patched (
apt update/apt upgrade) and rotate passwords if they may have been exposed. - See MariaDB security documentation for TLS, users, and hardening guidance.
Managing MariaDB
Start, stop, restart, status
systemctl start mariadb
systemctl stop mariadb
systemctl restart mariadb
systemctl status mariadb
Update
Marketplace images are rebuilt from the pinned application_version in template.json. On an existing Droplet you can upgrade packages carefully with apt after reviewing MariaDB upgrade notes; for a clean Marketplace pin, create a new Droplet from the updated 1-Click snapshot and migrate data.