Adminer plugin for automatic database login in development environments. Reads credentials from environment variables and bypasses the login form on first request.
This plugin extends the official Adminer Docker image to provide seamless database access without manual authentication. Configure your database connection through environment variables, and the plugin handles login automatically.
Key features:
- Automatic login on container start
- Support for MySQL, PostgreSQL, SQLite, Oracle, MS SQL, MongoDB, and Elasticsearch
- Configurable base path for reverse proxy deployments
- Multi-architecture Docker image (amd64, arm64)
- Built-in health check
Warning: This plugin disables authentication entirely. Use only in development environments where the database interface is not exposed to untrusted networks.
docker run -p 8080:8080 \
-e ADMINER_SERVER=your-db-host \
-e ADMINER_USERNAME=your-user \
-e ADMINER_PASSWORD=your-password \
msav/adminer-autologinOpen http://localhost:8080 to access the database immediately.
Pull from Docker Hub:
docker pull msav/adminer-autologinOr from GitHub Container Registry:
docker pull ghcr.io/mvandrew/adminer-autologinRun with all configuration options:
docker run -p 8080:8080 \
-e ADMINER_DRIVER=pgsql \
-e ADMINER_SERVER=postgres \
-e ADMINER_USERNAME=postgres \
-e ADMINER_PASSWORD=postgres \
-e ADMINER_DB=mydb \
-e ADMINER_BASE_PATH=/ \
msav/adminer-autologinCreate a docker-compose.yml file:
services:
db:
image: postgres:17-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: appdb
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
adminer:
image: msav/adminer-autologin
ports:
- "8080:8080"
environment:
ADMINER_DRIVER: pgsql
ADMINER_SERVER: db
ADMINER_USERNAME: postgres
ADMINER_PASSWORD: postgres
ADMINER_DB: appdb
depends_on:
db:
condition: service_healthy
volumes:
pgdata:Start the stack:
docker compose up -dservices:
mysql:
image: mysql:8
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: appdb
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 5
adminer:
image: msav/adminer-autologin
ports:
- "8080:8080"
environment:
ADMINER_DRIVER: server
ADMINER_SERVER: mysql
ADMINER_USERNAME: root
ADMINER_PASSWORD: rootpass
ADMINER_DB: appdb
depends_on:
mysql:
condition: service_healthyIf you run Adminer directly on a host machine, copy autologin.php to the Adminer plugins directory and set the required environment variables in your web server configuration.
Requirements:
- Adminer 5.0.0 or later
- PHP 8.0 or later
Steps:
- Download
autologin.phpfrom this repository - Place it in your Adminer plugins directory (typically
plugins-enabled/) - Set environment variables in your PHP-FPM pool or web server:
Apache (in virtualhost or .htaccess):
SetEnv ADMINER_SERVER localhost
SetEnv ADMINER_USERNAME dbuser
SetEnv ADMINER_PASSWORD dbpass
SetEnv ADMINER_DRIVER serverNginx with PHP-FPM (in location block):
fastcgi_param ADMINER_SERVER localhost;
fastcgi_param ADMINER_USERNAME dbuser;
fastcgi_param ADMINER_PASSWORD dbpass;
fastcgi_param ADMINER_DRIVER server;| Variable | Required | Default | Description |
|---|---|---|---|
ADMINER_DRIVER |
No | server |
Database driver (see supported drivers below) |
ADMINER_SERVER |
Yes | — | Database host address |
ADMINER_USERNAME |
Yes | — | Database username |
ADMINER_PASSWORD |
No | empty | Database password |
ADMINER_DB |
No | empty | Default database to select after login |
ADMINER_BASE_PATH |
No | / |
Base URL path for reverse proxy setups |
| Driver | Database |
|---|---|
server |
MySQL / MariaDB |
pgsql |
PostgreSQL |
sqlite |
SQLite 3 |
sqlite2 |
SQLite 2 |
oracle |
Oracle |
mssql |
Microsoft SQL Server |
mongo |
MongoDB |
elastic |
Elasticsearch |
If an unrecognized driver is specified, the plugin defaults to MySQL (server).
When deploying Adminer behind a reverse proxy at a subpath like /adminer, set ADMINER_BASE_PATH to match:
docker run -p 8080:8080 \
-e ADMINER_BASE_PATH=/adminer \
-e ADMINER_SERVER=db \
-e ADMINER_USERNAME=user \
-e ADMINER_PASSWORD=pass \
msav/adminer-autologinNginx proxy configuration:
location /adminer/ {
proxy_pass http://adminer:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}Traefik labels (Docker Compose):
adminer:
image: msav/adminer-autologin
environment:
ADMINER_BASE_PATH: /adminer
# ... other env vars
labels:
- "traefik.http.routers.adminer.rule=PathPrefix(`/adminer`)"
- "traefik.http.services.adminer.loadbalancer.server.port=8080"For cleaner configuration, use an .env file:
ADMINER_DRIVER=pgsql
ADMINER_SERVER=postgres
ADMINER_USERNAME=postgres
ADMINER_PASSWORD=postgres
ADMINER_DB=appdbReference it in docker-compose.yml:
adminer:
image: msav/adminer-autologin
ports:
- "8080:8080"
env_file:
- .envIf you see the message "Auto-login not triggered" instead of the database interface:
- Verify that both
ADMINER_SERVERandADMINER_USERNAMEare set - Check that environment variables are passed correctly to the container
- Inspect container environment:
docker exec <container> env | grep ADMINER
- Confirm the database container is running and healthy
- Verify the
ADMINER_SERVERvalue matches the database service name (in Compose) or hostname - Check that the database accepts connections from the Adminer container network
- Test connectivity:
docker exec <adminer-container> nc -zv <db-host> <port>
- The plugin defaults to MySQL if
ADMINER_DRIVERis not set or contains an invalid value - Check the supported drivers list and use exact values (case-sensitive)
- If accessing through a reverse proxy, ensure
ADMINER_BASE_PATHmatches the proxy path exactly - The path should not have a trailing slash (use
/adminer, not/adminer/)
MIT License. See LICENSE for details.