TechEarl

How to Run Adminer in Docker (Database GUI Without Installing One)

Adminer is a single-PHP-file database GUI that talks to MySQL, MariaDB, PostgreSQL, MongoDB, SQLite, and more. One Docker container, browser at localhost:8080, no installer, no GUI app to update.

Ishan Karunaratne⏱️ 5 min readUpdated
Share thisCopied
Adminer in a Docker container: a single-file PHP database GUI that talks to MySQL, MariaDB, PostgreSQL, MongoDB, SQLite, and others. No installer, browse at localhost:8080.

A database GUI is the thing you want for ten minutes a day. Installing pgAdmin or MySQL Workbench is a heavy ask for that. Adminer is a single PHP file that does most of what those do — browse tables, run queries, edit rows, dump and restore — and the Docker image is one line, no setup.

How do I run Adminer in Docker?

bash
docker run -d --name adminer -p 8080:8080 adminer

Open http://localhost:8080. The login page asks for the database engine (MySQL, PostgreSQL, MariaDB, MongoDB, etc.), host, user, password, and database name. Fill in your container's connection details and you're in.

Try it with your own values

Configure container name and port.

Why Adminer over phpMyAdmin or Workbench

  • Single PHP file (1 MB) versus phpMyAdmin's many files and many MB.
  • Multi-database — MySQL, MariaDB, PostgreSQL, MongoDB, SQLite, MS SQL, Oracle, Firebird, SimpleDB, Elasticsearch (read-only), ClickHouse. phpMyAdmin is MySQL/MariaDB only.
  • No install, no upgrade hassle — just pull the latest Adminer image when you want updates.
  • Fast — page loads are sub-second; the UI is HTML-first.

The trade-off versus full-featured GUIs (DBeaver, TablePlus, pgAdmin): less polish, fewer query-builder UIs, no native cross-database connection management. For day-to-day "browse, query, edit a row, dump a table," Adminer is plenty.

Connect Adminer to a database container

The classic Compose pattern:

yaml
services:
db:
image: postgres:17
environment:
POSTGRES_PASSWORD: change-me
volumes:
db-data:/var/lib/postgresql/data
adminer:
image: adminer
ports:
"::host_port:8080"
depends_on:

Open http://localhost:8080. In the Adminer login form:

  • System: PostgreSQL
  • Server: db (the Compose service name)
  • Username: postgres
  • Password: change-me
  • Database: leave empty to see all, or postgres

For MySQL:

  • System: MySQL
  • Server: mysql (or whatever you named the MySQL service)
  • Username: root
  • Password: the value of MYSQL_ROOT_PASSWORD

For MongoDB:

  • System: MongoDB
  • Server: mongo
  • Username: the value of MONGO_INITDB_ROOT_USERNAME
  • Password: the value of MONGO_INITDB_ROOT_PASSWORD

The Adminer container talks to the database container via Compose service-name DNS — no port publishing needed on the database itself.

Default to one database (skip the login form's "System" picker)

If you only ever use Adminer for one engine, set the default:

yaml
services:
  adminer:
    image: adminer
    ports:
      - "8080:8080"
    environment:
      ADMINER_DEFAULT_SERVER: db
      ADMINER_DEFAULT_DRIVER: pgsql   # or 'server' for MySQL

The login form arrives pre-filled — just type your password.

Practical usage: dump and restore a single table

The Adminer Export button on any table writes SQL or a CSV to your downloads. The Import button reads it back. Fast, no command-line gymnastics. For full database dumps the mysqldump / pg_dump route is more efficient; for "I need to copy this one table to my local DB," Adminer is the easiest path.

Common pitfalls

  • Adminer can't reach 127.0.0.1. Inside the Adminer container, 127.0.0.1 is the Adminer container's loopback, not the database. Use the database container's service name (db, mysql, etc.) on the same Docker network.
  • MySQL 8 caching_sha2_password errors from Adminer. Adminer ships with a PHP MySQL driver that may not support the modern auth plugin. Either upgrade Adminer (newer images bundle a newer driver), or switch the MySQL user to mysql_native_password.
  • Port 8080 already in use. Adminer listens on 8080 inside the container; publish to a different host port if 8080 is taken (-p 8081:8080).
  • Adminer exposed to the network. The container has no built-in auth gating beyond the per-DB login. Don't publish it on a non-loopback interface unless the host is private.

What to do next

FAQ

Sources

Authoritative references this article was fact-checked against.

TagsDockerAdminerDatabase GUIMySQLPostgreSQLDevOps

Found this useful? Pass it on.

Copied

Ishan Karunaratne

Software Systems Architect · Senior Software Engineer · Engineering Leadership

Software systems architect and senior software engineer with more than two decades designing, building, and running production software, Linux systems, and DevOps infrastructure, and lately working AI into the stack. Now a CTO, though what I write here is drawn from the full arc of that work, across architecture, engineering, and operations, not any single job.

Keep reading

Related posts