# Self-host MariaDB with Adminer

> A MariaDB 11.8 server paired with the Adminer web console, already wired together. The database is not published on the host, so other services in this project reach it at db:3306. Sign in to Adminer with server db, user root and the generated root password.

- Page: https://levelrail.com/templates/mariadb-adminer/
- JSON: https://levelrail.com/templates/mariadb-adminer.json
- Category: Database Tools
- Licence: Apache-2.0 (Permissive license)
- Source: https://github.com/vrana/adminer
- Upstream docs: https://www.adminer.org/

## Requirements
- Memory: about 512 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 5.5.1

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| adminer | adminer | 5.5.1 | 8080 | none |
| db | mariadb | 11.8.9 | none | mariadb_data -> /var/lib/mysql |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| adminer | ADMINER_DEFAULT_SERVER | preset |
| db | MARIADB_ROOT_PASSWORD | generated |

## Deploy

### CLI

```bash
levelrail-cli templates install mariadb-adminer --name my-mariadb-adminer
```

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain adminer=app.example.com.

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/mariadb-adminer/install \
  -d '{
    "name": "my-mariadb-adminer"
  }'
```

Create a token in the dashboard first. Name, env and domains are the request fields.

## First run
1. Open the page and sign in with system MySQL, server db, user root and the generated root password from the app secrets.

## Questions

### Can I deploy MariaDB with Adminer 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 with Adminer, 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 adminer:5.5.1, mariadb:11.8.9 is what you deploy there.

Self-host MariaDB with Adminer, MariaDB with Adminer docker compose file, deploy MariaDB with Adminer on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
