Adminer + Multiple Database Types
Lightweight database management in a single PHP file.
Overview
Adminer is a full-featured database management tool written entirely in a single PHP file, originally developed as a lightweight alternative to phpMyAdmin. Despite its minimal footprint of just 470KB, Adminer supports multiple database systems including MySQL, PostgreSQL, SQLite, MS SQL, Oracle, and MongoDB, making it an incredibly versatile tool for database administration. Its clean interface and zero-configuration approach have made it popular among developers who need quick database access without the complexity of larger administration tools.
This stack combines Adminer with PostgreSQL 15 and MySQL 8.0, creating a comprehensive database testing and development environment. The configuration allows you to switch between different database systems from a single web interface, making it ideal for applications that need to support multiple database backends or for comparing query performance across different engines. Adminer connects to each database server through the internal Docker network, providing secure access while exposing only the web interface to the host system.
Developers working on multi-database applications, database administrators managing heterogeneous environments, and teams evaluating different database technologies will find this stack particularly valuable. The combination eliminates the need to install separate management tools for each database type, while the containerized approach ensures consistent behavior regardless of the host operating system. Educational environments also benefit from this setup, as students can explore different SQL dialects and database features from a unified interface.
Key Features
- Single PHP file deployment requiring only 470KB of disk space
- Native support for MySQL, PostgreSQL, SQLite, MS SQL, Oracle, and MongoDB
- Built-in SQL editor with syntax highlighting and query execution
- Database schema visualization and table structure editing
- CSV, SQL, and TSV export capabilities for data migration
- Plugin system supporting tables-filter and tinymce rich text editing
- Multiple visual themes including Nette, Pepa, and Hydra designs
- Cross-database query comparison and performance analysis tools
Common Use Cases
- 1Multi-database application development requiring PostgreSQL and MySQL compatibility testing
- 2Database migration projects comparing schema and data between different engines
- 3Educational environments teaching SQL across multiple database systems
- 4Development teams prototyping applications with different database backends
- 5Legacy system maintenance where multiple database types coexist
- 6Quick database troubleshooting and query debugging in containerized environments
- 7Small to medium businesses managing diverse database infrastructure from a single interface
Prerequisites
- Docker Engine 20.10+ and Docker Compose 2.0+ installed
- Minimum 1GB RAM available for PostgreSQL and MySQL containers
- Port 8080 available on the host system for Adminer web interface
- Basic understanding of SQL and database concepts
- Environment variables configured for POSTGRES_USER, POSTGRES_PASSWORD, and MYSQL_ROOT_PASSWORD
- Familiarity with different SQL dialects if working across multiple database types
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 adminer: 3 image: adminer:latest4 environment: 5 - ADMINER_DEFAULT_SERVER=postgres6 - ADMINER_DESIGN=nette7 - ADMINER_PLUGINS=tables-filter tinymce8 ports: 9 - "8080:8080"10 networks: 11 - adminer-network12 restart: unless-stopped1314 postgres: 15 image: postgres:1516 environment: 17 - POSTGRES_USER=${POSTGRES_USER}18 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}19 - POSTGRES_DB=demo20 volumes: 21 - postgres-data:/var/lib/postgresql/data22 networks: 23 - adminer-network24 restart: unless-stopped2526 mysql: 27 image: mysql:8.028 environment: 29 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}30 - MYSQL_DATABASE=demo31 volumes: 32 - mysql-data:/var/lib/mysql33 networks: 34 - adminer-network35 restart: unless-stopped3637volumes: 38 postgres-data: 39 mysql-data: 4041networks: 42 adminer-network: 43 driver: bridge.env Template
.env
1# Adminer2POSTGRES_USER=postgres3POSTGRES_PASSWORD=secure_postgres_password4MYSQL_ROOT_PASSWORD=secure_root_passwordUsage Notes
- 1Adminer at http://localhost:8080
- 2Server: postgres or mysql
- 3Single file, lightweight
- 4Multiple themes available
- 5SQL export/import
Individual Services(3 services)
Copy individual services to mix and match with your existing compose files.
adminer
adminer:
image: adminer:latest
environment:
- ADMINER_DEFAULT_SERVER=postgres
- ADMINER_DESIGN=nette
- ADMINER_PLUGINS=tables-filter tinymce
ports:
- "8080:8080"
networks:
- adminer-network
restart: unless-stopped
postgres
postgres:
image: postgres:15
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=demo
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- adminer-network
restart: unless-stopped
mysql
mysql:
image: mysql:8.0
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=demo
volumes:
- mysql-data:/var/lib/mysql
networks:
- adminer-network
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 adminer:5 image: adminer:latest6 environment:7 - ADMINER_DEFAULT_SERVER=postgres8 - ADMINER_DESIGN=nette9 - ADMINER_PLUGINS=tables-filter tinymce10 ports:11 - "8080:8080"12 networks:13 - adminer-network14 restart: unless-stopped1516 postgres:17 image: postgres:1518 environment:19 - POSTGRES_USER=${POSTGRES_USER}20 - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}21 - POSTGRES_DB=demo22 volumes:23 - postgres-data:/var/lib/postgresql/data24 networks:25 - adminer-network26 restart: unless-stopped2728 mysql:29 image: mysql:8.030 environment:31 - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}32 - MYSQL_DATABASE=demo33 volumes:34 - mysql-data:/var/lib/mysql35 networks:36 - adminer-network37 restart: unless-stopped3839volumes:40 postgres-data:41 mysql-data:4243networks:44 adminer-network:45 driver: bridge46EOF4748# 2. Create the .env file49cat > .env << 'EOF'50# Adminer51POSTGRES_USER=postgres52POSTGRES_PASSWORD=secure_postgres_password53MYSQL_ROOT_PASSWORD=secure_root_password54EOF5556# 3. Start the services57docker compose up -d5859# 4. View logs60docker 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/adminer-multi-db/run | bashTroubleshooting
- Connection failed to database server: Verify the server name matches the Docker service name (postgres or mysql) in Adminer login
- MySQL authentication plugin error: Add --default-authentication-plugin=mysql_native_password to MySQL command or use mysql:5.7 image
- PostgreSQL connection refused: Ensure POSTGRES_USER and POSTGRES_PASSWORD environment variables are set and containers are fully started
- Adminer shows blank page: Check PHP memory limits and ensure port 8080 is not blocked by firewall
- Cannot import large SQL files: Increase PHP upload limits by mounting custom php.ini with higher upload_max_filesize and post_max_size
- Tables not visible in Adminer: Verify database user has proper SELECT privileges and the correct database/schema is selected
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
Components
adminerpostgresqlmysqlmongodb
Tags
#adminer#database-management#php#lightweight
Category
Database StacksAd Space
Shortcuts: C CopyF FavoriteD Download