MariaDB + Adminer
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:114 container_name: mariadb5 restart: unless-stopped6 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/mysql13 ports: 14 - "3306:3306"15 networks: 16 - mariadb-network1718 adminer: 19 image: adminer:latest20 container_name: adminer21 restart: unless-stopped22 ports: 23 - "8080:8080"24 depends_on: 25 - mariadb26 networks: 27 - mariadb-network2829volumes: 30 mariadb_data: 3132networks: 33 mariadb-network: 34 driver: bridge.env Template
.env
1MARIADB_ROOT_PASSWORD=rootpassword2MARIADB_DATABASE=myapp3MARIADB_USER=appuser4MARIADB_PASSWORD=changemeUsage Notes
- 1Docs: https://mariadb.com/kb/en/documentation/ | Adminer: https://www.adminer.org/
- 2Access Adminer at http://localhost:8080, select 'MySQL', server: mariadb
- 3Login with root/MARIADB_ROOT_PASSWORD or MARIADB_USER/MARIADB_PASSWORD
- 4Backup: docker exec mariadb mariadb-dump -u root -p --all-databases > backup.sql
- 5MySQL-compatible, most MySQL tools and drivers work
- 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 file2cat > docker-compose.yml << 'EOF'3services:4 mariadb:5 image: mariadb:116 container_name: mariadb7 restart: unless-stopped8 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/mysql15 ports:16 - "3306:3306"17 networks:18 - mariadb-network1920 adminer:21 image: adminer:latest22 container_name: adminer23 restart: unless-stopped24 ports:25 - "8080:8080"26 depends_on:27 - mariadb28 networks:29 - mariadb-network3031volumes:32 mariadb_data:3334networks:35 mariadb-network:36 driver: bridge37EOF3839# 2. Create the .env file40cat > .env << 'EOF'41MARIADB_ROOT_PASSWORD=rootpassword42MARIADB_DATABASE=myapp43MARIADB_USER=appuser44MARIADB_PASSWORD=changeme45EOF4647# 3. Start the services48docker compose up -d4950# 4. View logs51docker compose logs -fOne-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 | bashTroubleshooting
- 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
Shortcuts: C CopyF FavoriteD Download