docker.recipes

MariaDB + Adminer

beginner

MariaDB database with Adminer, a lightweight database management tool.

Overview

MariaDB is a community-developed fork of MySQL created by the original MySQL developers after Oracle's acquisition of MySQL AB. Born from concerns about MySQL's future under Oracle, MariaDB has evolved into a robust database server that maintains MySQL compatibility while introducing advanced features like the Aria storage engine, Galera clustering, and enhanced JSON support. This makes it an ideal drop-in replacement for MySQL with superior performance and additional capabilities. This stack combines MariaDB with Adminer, a lightweight database management tool that provides a clean web interface for database administration. Unlike heavyweight alternatives like phpMyAdmin, Adminer is distributed as a single PHP file and supports multiple database systems beyond just MySQL/MariaDB. The combination creates a complete database solution where MariaDB handles data storage and processing while Adminer provides intuitive database management through a web browser. Developers working on PHP applications, WordPress sites, or any MySQL-compatible projects will find this stack invaluable for both development and production environments. The pairing is particularly useful for teams that need quick database access without installing desktop database tools, or for scenarios where you need to manage multiple database types through a single interface. MariaDB's enhanced features combined with Adminer's simplicity make this an excellent choice for startups, development teams, and anyone migrating away from Oracle's MySQL ecosystem.

Key Features

  • Aria storage engine with crash-safe MyISAM replacement and better caching
  • Galera Cluster support for synchronous multi-master replication built into MariaDB
  • Thread pool connection handling for improved performance under high concurrency
  • Single-file Adminer deployment supporting MySQL, PostgreSQL, SQLite, and Oracle databases
  • MariaDB's Oracle compatibility mode for easier enterprise application migration
  • System-versioned tables enabling temporal queries and data history tracking
  • Adminer's plugin system for extending functionality with custom themes and features
  • ColumnStore storage engine for analytical workloads and data warehousing

Common Use Cases

  • 1WordPress and PHP application hosting with enhanced MySQL compatibility
  • 2Development environments requiring quick database setup and web-based management
  • 3Small to medium business applications migrating away from Oracle MySQL
  • 4Multi-database environments where developers work with MariaDB, PostgreSQL, and SQLite
  • 5High-availability web applications utilizing MariaDB's Galera clustering capabilities
  • 6Data analytics projects leveraging MariaDB's ColumnStore engine for warehousing
  • 7Remote database administration where desktop tools aren't available or practical

Prerequisites

  • Minimum 1GB RAM for MariaDB with 128MB additional for Adminer web interface
  • Port 3306 available for MariaDB database connections from external clients
  • Port 8080 available for Adminer web interface access
  • Basic understanding of SQL and relational database concepts
  • Familiarity with web-based database administration tools
  • Knowledge of environment variable configuration for database credentials

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 mariadb:
3 image: mariadb:11
4 container_name: mariadb
5 restart: unless-stopped
6 environment:
7 MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
8 MARIADB_DATABASE: ${MARIADB_DATABASE}
9 MARIADB_USER: ${MARIADB_USER}
10 MARIADB_PASSWORD: ${MARIADB_PASSWORD}
11 volumes:
12 - mariadb_data:/var/lib/mysql
13 ports:
14 - "3306:3306"
15 networks:
16 - mariadb-network
17
18 adminer:
19 image: adminer:latest
20 container_name: adminer
21 restart: unless-stopped
22 ports:
23 - "8080:8080"
24 depends_on:
25 - mariadb
26 networks:
27 - mariadb-network
28
29volumes:
30 mariadb_data:
31
32networks:
33 mariadb-network:
34 driver: bridge

.env Template

.env
1MARIADB_ROOT_PASSWORD=rootpassword
2MARIADB_DATABASE=myapp
3MARIADB_USER=appuser
4MARIADB_PASSWORD=changeme

Usage Notes

  1. 1Docs: https://mariadb.com/kb/en/documentation/ | Adminer: https://www.adminer.org/
  2. 2Access Adminer at http://localhost:8080, select 'MySQL', server: mariadb
  3. 3Login with root/MARIADB_ROOT_PASSWORD or MARIADB_USER/MARIADB_PASSWORD
  4. 4Backup: docker exec mariadb mariadb-dump -u root -p --all-databases > backup.sql
  5. 5MySQL-compatible, most MySQL tools and drivers work
  6. 6Data persisted in mariadb_data volume

Individual Services(2 services)

Copy individual services to mix and match with your existing compose files.

mariadb
mariadb:
  image: mariadb:11
  container_name: mariadb
  restart: unless-stopped
  environment:
    MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
    MARIADB_DATABASE: ${MARIADB_DATABASE}
    MARIADB_USER: ${MARIADB_USER}
    MARIADB_PASSWORD: ${MARIADB_PASSWORD}
  volumes:
    - mariadb_data:/var/lib/mysql
  ports:
    - "3306:3306"
  networks:
    - mariadb-network
adminer
adminer:
  image: adminer:latest
  container_name: adminer
  restart: unless-stopped
  ports:
    - "8080:8080"
  depends_on:
    - mariadb
  networks:
    - mariadb-network

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 mariadb:
5 image: mariadb:11
6 container_name: mariadb
7 restart: unless-stopped
8 environment:
9 MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
10 MARIADB_DATABASE: ${MARIADB_DATABASE}
11 MARIADB_USER: ${MARIADB_USER}
12 MARIADB_PASSWORD: ${MARIADB_PASSWORD}
13 volumes:
14 - mariadb_data:/var/lib/mysql
15 ports:
16 - "3306:3306"
17 networks:
18 - mariadb-network
19
20 adminer:
21 image: adminer:latest
22 container_name: adminer
23 restart: unless-stopped
24 ports:
25 - "8080:8080"
26 depends_on:
27 - mariadb
28 networks:
29 - mariadb-network
30
31volumes:
32 mariadb_data:
33
34networks:
35 mariadb-network:
36 driver: bridge
37EOF
38
39# 2. Create the .env file
40cat > .env << 'EOF'
41MARIADB_ROOT_PASSWORD=rootpassword
42MARIADB_DATABASE=myapp
43MARIADB_USER=appuser
44MARIADB_PASSWORD=changeme
45EOF
46
47# 3. Start the services
48docker compose up -d
49
50# 4. View logs
51docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/mariadb-adminer/run | bash

Troubleshooting

  • Connection refused to MariaDB: Ensure container is fully started by checking logs with docker logs mariadb
  • Adminer shows 'MySQL server has gone away': Increase MariaDB's max_allowed_packet setting or wait_timeout values
  • Access denied for user error: Verify MARIADB_USER and MARIADB_PASSWORD environment variables match login credentials
  • Adminer interface not loading: Check that port 8080 isn't blocked by firewall and container started successfully
  • Character encoding issues: Set MariaDB charset to utf8mb4 in my.cnf for full Unicode support
  • Slow query performance: Enable MariaDB's thread pool with thread_handling=pool-of-threads configuration

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space