Self-host MariaDB with Levelrail
The MariaDB database server on the official image, with a persistent volume, generated root and user passwords, and an application database. It is not published on the host, so reach it from other services in this project at mariadb:3306.
- AuthorMariaDB
- LicenceGPL-2.0-only
- Memory512 MiB
- Services1
How to self-host MariaDB
-
Pull the images
One image is pulled on your server.
Show images
mariadb:11.4.13
-
Create the app
One service starts in a single Compose app, with 1 named volume mount for your data, on port 3306.
-
Fill in the secrets
2 secrets are generated and stored encrypted, 2 settings are preset, you do not have to fill in anything.
-
Open it
Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.
After the first start
- Read the generated passwords from the app secrets, then connect with the application user or as root from a service in the same project.
MariaDB requirements
- Memory
- About 512 MiB
- Architectures
- amd64 unknown, arm64 unknown
- Ports
- 3306
- Domain
- Optional, an sslip.io address is used without one
- Settings
- none to fill in
- License
- GPL-2.0-only, copyleft license
- Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
Install Levelrail first
On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then MariaDB. New to Levelrail? Install it on a fresh VPS first.
docker pull ghcr.io/glincker/levelrail:latest Then levelrail-cli login --device. See Getting started and the MariaDB docs page.
Deploy MariaDB your way
Every format below deploys the same pinned images. Pick the one that fits how you work.
Deploy MariaDB from the CLI
levelrail-cli templates install mariadb --name my-mariadb Deploy MariaDB with the API
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
https://levelrail.example.com/api/v1/service-templates/mariadb/install \
-d '{
"name": "my-mariadb"
}' MariaDB configuration
MariaDB services
| Service | Image | Ports | Volumes |
|---|---|---|---|
| mariadb | mariadb:11.4.13 | 3306 | mariadb_data -> /var/lib/mysql |
MariaDB environment variables
| Variable | Service | Value |
|---|---|---|
| MARIADB_DATABASE | mariadb | Preset by the template |
| MARIADB_PASSWORD | mariadb | Generated at deploy |
| MARIADB_ROOT_PASSWORD | mariadb | Generated at deploy |
| MARIADB_USER | mariadb | Preset by the template |
Ports and volumes
- Ports
- 3306
- Volumes
- 1 named mount: mariadb_data -> /var/lib/mysql
MariaDB FAQ
How much memory does MariaDB need?
The catalog lists about 512 MiB of memory for MariaDB.
Does MariaDB run on arm64?
For MariaDB, arm64 support is not confirmed; amd64 is unknown.
What licence is MariaDB under?
MariaDB is licensed under GPL-2.0-only, which is copyleft, so changes you distribute must be shared under the same terms.
Does MariaDB need configuration before it starts?
No. The template fills in its own defaults and generates secrets at deploy time.
Which database does MariaDB bundle?
The template includes MySQL, running as part of the stack.
Which ports does MariaDB use?
MariaDB listens on port 3306 inside the stack.
Where does MariaDB keep its data?
In a named volume: mariadb_data mounted at /var/lib/mysql.
Can I deploy MariaDB on Dokploy or Dokku?
The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for MariaDB, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image mariadb:11.4.13 is what you deploy there.