Host your own MariaDB server on local or cloud infrastructure, giving you full control over configuration, security, and cost.
Self-hosting avoids recurring fees, keeps data on your infrastructure, and lets you fine-tune performance and security to match internal policies.
Have Docker (or Podman) installed, open TCP port 3306, and reserve at least 2 GB RAM plus persistent storage for /var/lib/mysql.
Run one command: docker run --name mariadb -e MARIADB_ROOT_PASSWORD=StrongPass123 -e MARIADB_DATABASE=shop -e MARIADB_USER=app -e MARIADB_PASSWORD=AppPass123 -p 3306:3306 -v /srv/mariadb/data:/var/lib/mysql -d mariadb:10.11
. It pulls the image, boots the server, and mounts data on the host.
MARIADB_ROOT_PASSWORD
sets the super-user password. MARIADB_DATABASE
, MARIADB_USER
, and MARIADB_PASSWORD
create an application database and user on first start. -v
binds host storage for durability.
Connect with docker exec -it mariadb mysql -uroot -p
and run the DDL in the next code block to create Customers
, Orders
, Products
, and OrderItems
.
Install mysql_fdw
in PostgreSQL, create a foreign server, and import the schema so you can SELECT
from MariaDB tables inside PostgreSQL.
Place data on redundant storage, schedule dumps with mariabackup
, and pin to a specific MariaDB image tag for predictable upgrades.
Do not expose port 3306 to the internet without a firewall, and never forget to back up the host volume before upgrading the image.
No. You can install native packages with apt
or yum
, but Docker simplifies upgrades and isolation.
Use mariabackup --backup
for hot backups or mysqldump --single-transaction
for logical dumps. Store backups off-site.
Yes. Start a secondary container, configure server_id
values, and run the CHANGE MASTER TO
command to enable replication.