Deployment
Decide how much of the database you run yourself, then install MariaDB from packages, Docker, or Kubernetes. Your schema and SQL move with you.
The shop works on your laptop. The shop.products table answers the Python query, the checkout page renders, and next week real customers start placing orders. From that moment, someone has to patch the server, take the backups, and get paged when a disk fails at 3 a.m.
Before you pick a machine, decide how much of that work you want. Every option runs the same MariaDB Server underneath, so the products table, your SQL, and your Python code move with you if you change your mind later. What changes is who handles the layers below your schema.
Your schema, SQL, and app
You
You
You
Server settings and tuning
You
You, with support
You and the service
Upgrades and patches
You
You, with support
The service, in a weekly maintenance window
Backups
You
You, with support
The service
Failover
You
You, with support
The service, with replicas
Hardware and OS
You
You
The service
The top row never changes hands, so the choice is only about the operations work under your schema.
A team that already runs Linux servers often starts with MariaDB Community Server and owns every row of the left column. MariaDB Enterprise Platform keeps the same work in your hands, with MariaDB support to call when an upgrade or a failover goes wrong. And when nobody on the team wants the pager, MariaDB Cloud takes backups and hardware off your plate, applies upgrades in a weekly maintenance window, and fails over for you when the service runs with replicas.
Install the Server
If you chose to run it yourself, the next job is a server that starts on boot and gets updates from a known source. Pick the tab that matches where the shop will run.
Distribution packages often trail the current MariaDB release by a few versions. The mariadb_repo_setup script points the apt package manager at MariaDB's own repository instead. Download it, check it against the checksum on the repository setup page (replace <checksum> below), and run it:
curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup
echo "<checksum> mariadb_repo_setup" | sha256sum -c -
chmod +x mariadb_repo_setup
sudo ./mariadb_repo_setupThen install the server, the client, and the mariadb-backup tool:
sudo apt update
sudo apt install mariadb-server mariadb-client mariadb-backup
sudo systemctl status mariadbThe package starts the mariadb service during the install, so the status check only confirms that it's running. By default, the script sets up the newest stable series, currently MariaDB 13.0, a rolling release. The mariadb:lts Docker image runs the 12.3 long-term release instead. To stay on 12.3, run the setup script with --mariadb-server-version="mariadb-12.3". MariaDB Package Repository Setup and Usage lists the checksums and every script option.
Distribution packages often trail the current MariaDB release by a few versions. The mariadb_repo_setup script points the dnf package manager at MariaDB's own repository instead. Download it, check it against the checksum on the repository setup page (replace <checksum> below), and run it:
curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup
echo "<checksum> mariadb_repo_setup" | sha256sum -c -
chmod +x mariadb_repo_setup
sudo ./mariadb_repo_setupThen install the packages and start the service, which also enables it on boot:
sudo dnf install MariaDB-server MariaDB-client MariaDB-backup
sudo systemctl enable --now mariadbPackages from the MariaDB repository use capitalized names (MariaDB-server), unlike the distribution's own mariadb-server package. By default, the script sets up the newest stable series, currently MariaDB 13.0, a rolling release. The mariadb:lts Docker image runs the 12.3 long-term release instead. To stay on 12.3, run the setup script with --mariadb-server-version="mariadb-12.3". MariaDB Package Repository Setup and Usage lists the checksums and every script option.
The official image already carries the server, so you skip the repository setup. One docker run command starts MariaDB Server and creates the shop database and its application user:
The container gets its own name, shop-db, and host port 3307, so it can run next to the mariadb container from the landing page. The lts tag follows the newest long-term release, currently MariaDB 12.3. On a host of its own, publish port 3306 instead. The mariadb-data volume keeps the data directory when you replace the container, so an image upgrade doesn't take the products table with it. On first start, the image gives the shop_app user full privileges on the shop database. Docker Official Image Environment Variables lists the rest.
The MariaDB Enterprise Kubernetes Operator is part of MariaDB Enterprise Platform, and it pulls images with your customer credentials. Set those up first, then install the operator from its two Helm charts:
The values.yaml file names the mariadb-enterprise pull secret. Next, store the database password in a Kubernetes Secret, then describe the server as a MariaDB custom resource and apply it with kubectl apply -f mariadb.yaml:
Install the operator with Helm covers the values.yaml file, and the operator Quickstart covers the rest of the MariaDB resource.
The installation guide also covers Windows. On macOS, install with Homebrew or the .pkg installer.
Secure the Server
The mariadb-secure-installation script offers to set a root password and to remove root accounts reachable from other hosts, anonymous users, and the test database. Debian and Ubuntu packages already ship without the anonymous users and the test database, so there the script mostly confirms that the install is clean:
The shop code should never connect as root, because a bug in a checkout query would then have the power to drop every table. Connect with sudo mariadb and create an account that can only read and write rows in the shop database, and only from the subnet your application servers use:
The Docker and Kubernetes tabs already created the shop_app user with full rights on the shop database, so there you narrow its privileges if you need to. CREATE USER and GRANT cover host patterns, roles, and TLS requirements.
Point the Python code at the new host as the shop_app user, and the shop is ready for its first real customer.
Keep Going
This page is: Copyright © 2026 MariaDB. All rights reserved.
Last updated
Was this helpful?

