How to set up Adminer with Docker to manage databases
May 24, 2026
/
Domantas P.
/
9 min Read
To manage Docker databases with Adminer, run Adminer as a Docker container, connect it to your database service, and use its browser interface to browse tables, edit records, run SQL queries, and import or export data.
Adminer works with PostgreSQL, MySQL, MariaDB, SQLite, and other database systems, making it useful for Docker projects that need lightweight database management. In this guide, you’ll learn how to install Adminer with Docker, deploy it using Hostinger’s Docker template, connect it to a Docker database, and manage database content from a VPS.
How to install Adminer with Docker
You can install Adminer with Docker by running the official Adminer image as a container and exposing its web interface on port 8080. This setup is useful when you already have a Docker database container and need a lightweight browser-based tool to manage it.
Before installing Adminer, make sure Docker is running on your server:
docker --version
If Docker is installed correctly, the command returns the current Docker version.
1. Install Adminer with Docker CLI
The fastest way to install Adminer is to run it as a standalone Docker container:
docker run -d --name adminer -p 8080:8080 adminer
This command starts Adminer in the background, names the container adminer, and maps port 8080 on your server to port 8080 inside the container.
After the container starts, open Adminer in your browser:
http://your-server-ip:8080
Replace your-server-ip with your VPS IP address or domain name.
To confirm that Adminer is running, use:
docker ps
The output should show a running container named adminer with port 8080 exposed.
2. Install Adminer with Docker Compose
Docker Compose is better when Adminer and your database need to run together. It lets you define the Adminer service, database service, network, and persistent storage in one file.
First, create a project directory:
mkdir adminer-docker cd adminer-docker
Then create a docker-compose.yml file:
nano docker-compose.yml
Add the following configuration to run Adminer with PostgreSQL:
services: postgres: image: postgres:17 container_name: postgres restart: unless-stopped environment: POSTGRES_USER: admin POSTGRES_PASSWORD: strong_password POSTGRES_DB: app_db volumes: - postgres_data:/var/lib/postgresql/data networks: - db_network adminer: image: adminer container_name: adminer restart: unless-stopped ports: - "8080:8080" networks: - db_network volumes: postgres_data: networks: db_network:
Save the file and start both containers:
docker compose up -d
This configuration creates a PostgreSQL database container, an Adminer container, a shared Docker network, and a persistent database volume. The shared network allows Adminer to reach the PostgreSQL container using the database service name instead of localhost.
Open Adminer in your browser:
http://your-server-ip:8080
When the login screen appears, choose PostgreSQL as the system and use the database service name, username, password, and database name from your Compose file. For the example above, the server value is postgres, the username is admin, and the database name is app_db.
3. Check the Adminer container status
After installation, check whether the Adminer container is running:
docker ps
For more details about the Adminer container, run:
docker logs adminer
If Adminer is not running, restart it:
docker restart adminer
For Docker Compose setups, restart all services from the project directory:
docker compose restart
Adminer is ready to use once the container is running and the web interface is available on port 8080. Next, connect Adminer to your Docker database using the correct database type, server name, username, password, and database name.
How to deploy Adminer with Hostinger Docker template
You can deploy Adminer with Hostinger’s Docker template to skip manual container setup and launch a ready-made database management interface on a VPS. This method is useful if you want to manage Docker databases through Adminer without writing a Docker Compose file from scratch.
Hostinger’s Docker catalog includes an Adminer template described as a full-featured database management interface that supports 11+ database systems. The catalog also lets users deploy Docker applications directly from the template page.
1. Choose the Adminer Docker template
Open Hostinger’s Adminer Docker template page and select a VPS plan for the deployment. The template page displays the recommended VPS configuration and a Deploy option to launch Adminer on the selected server.
The Adminer template is suitable for lightweight database management because it gives you a browser-based interface for common database tasks, such as browsing tables, editing records, running SQL queries, importing or exporting data, and managing users or permissions.
2. Deploy Adminer on a Hostinger VPS
After choosing the Adminer template, follow the deployment flow in hPanel. The exact screen labels can vary, but the process usually follows this order:
- Select the Adminer Docker template.
- Choose a new or existing VPS.
- Confirm the selected VPS plan and server location.
- Start the deployment.
- Wait until Hostinger finishes provisioning the VPS and installing the template.
Once the deployment is complete, open the Adminer interface using the server address or access URL provided in hPanel. Adminer normally runs through a web interface, so you only need a browser to reach the login screen.
3. Connect Adminer to your database
Deploying Adminer creates the database management interface, but it does not replace your database server. To start managing data, connect Adminer to an existing database using the database type, host, username, password, and database name.
On the Adminer login screen, enter your database connection details. For example, choose PostgreSQL or MySQL as the system, then enter the database host in the Server field.
Use the database container name as the server value if Adminer and the database run on the same Docker network. Use the database host, private IP address, or domain name if the database runs outside the Adminer deployment.
For better security, avoid using a root database account for routine database management. Create a dedicated database user with only the permissions required for browsing, editing, importing, or exporting the target database.
After logging in, Adminer will show the selected database and its available tables. From there, you can inspect schemas, edit records, execute SQL queries, and import or export database data from the browser.
How to connect Adminer to a Docker database
Adminer connects to a Docker database through the database container’s network address. In most Docker Compose setups, this means using the database service name as the Adminer server value instead of localhost.
For example, if your docker-compose.yml file defines a PostgreSQL service named postgres, enter postgres in the Server field on the Adminer login screen:
services: postgres: image: postgres:17 environment: POSTGRES_USER: admin POSTGRES_PASSWORD: strong_password POSTGRES_DB: app_db adminer: image: adminer ports: - "8080:8080"
With this setup, use the following Adminer login details:
- System: PostgreSQL
- Server: postgres
- Username: admin
- Password: strong_password
- Database: app_db
The postgres value works because Docker Compose creates an internal network where services can reach each other by service name. The Adminer container can use that service name to find the PostgreSQL container.
Do not use localhost as the server value in this setup. Inside the Adminer container, localhost points to the Adminer container itself, not to the database container.
Connect Adminer to PostgreSQL
To connect Adminer to a PostgreSQL container, select PostgreSQL in the System field and use the PostgreSQL service name as the server value.
For this Compose configuration:
services: postgres: image: postgres:17 environment: POSTGRES_USER: admin POSTGRES_PASSWORD: strong_password POSTGRES_DB: app_db
Use these values on the Adminer login screen:
- System: PostgreSQL
- Server: postgres
- Username: admin
- Password: strong_password
- Database: app_db
After logging in, Adminer displays the app_db database. You can then browse tables, inspect rows, run SQL queries, and manage records from the browser.
Connect Adminer to MySQL or MariaDB
To connect Adminer to a MySQL or MariaDB container, select MySQL in the System field and use the MySQL or MariaDB service name as the server value.
For this MySQL example:
services: mysql: image: mysql:8.4 environment: MYSQL_ROOT_PASSWORD: strong_root_password MYSQL_DATABASE: app_db MYSQL_USER: admin MYSQL_PASSWORD: strong_password adminer: image: adminer ports: - "8080:8080"
Use these values on the Adminer login screen:
- System: MySQL
- Server: mysql
- Username: admin
- Password: strong_password
- Database: app_db
For MariaDB, the process is the same. Select MySQL as the system, enter the MariaDB service name in the Server field, and use the database credentials defined in your Compose file.
Connect Adminer to a database outside the Adminer container
If your database does not run in the same Docker Compose project as Adminer, use the database host instead of a service name.
The server value can be:
- The database container name, if both containers share the same Docker network.
- The private IP address of another VPS.
- The domain name or hostname of a remote database server.
- The host gateway address, if the database runs directly on the Docker host.
For local host-based databases, you may need to use:
host.docker.internal
On Linux servers, host.docker.internal is not always available by default. If it does not resolve, add a host gateway mapping when starting the Adminer container:
docker run -d --name adminer -p 8080:8080 --add-host=host.docker.internal:host-gateway adminer
Then use this value in Adminer:
- Server: host.docker.internal
This tells the Adminer container to connect to a database service running on the Docker host instead of another container.
How to fix common connection errors
If Adminer cannot connect to your Docker database, check the server value first. Most connection errors occur because Adminer is configured to connect to localhost instead of the database service name, container name, or host address.
Next, confirm that the database container is running:
docker ps
For Docker Compose setups, check all services from the project directory:
docker compose ps
If the database container is stopped, restart the Compose stack:
docker compose restart
If the credentials fail, compare the username, password, and database name in Adminer with the environment variables in your docker-compose.yml file. The values must match exactly.
Adminer is connected correctly when the login screen opens the selected database and shows its tables, schemas, or SQL command interface.
How to manage Docker databases with Adminer
Adminer lets you manage Docker databases from a browser after you connect it to your database container. You can use it to inspect tables, run SQL queries, edit records, import or export data, and manage database users without installing a desktop database client.
Browse tables and inspect records
After logging in, Adminer shows the selected database and its available tables. Open a table to view its columns, indexes, data types, and stored records.
This is useful when you need to check whether your application is writing data correctly. For example, after submitting a form in a Dockerized web application, you can open the related table in Adminer and confirm that the new row was created.
Use this workflow for quick database checks:
- Select the target database.
- Open the table you want to inspect.
- Review the table structure, indexes, and records.
- Use filters or sorting to find specific rows.
For larger databases, avoid loading too many records at once. Use filters, limits, or SQL queries to inspect only the data you need.
Run SQL queries
Adminer includes an SQL command interface for running queries directly against your Docker database. This is useful for testing database logic, checking application data, creating tables, or troubleshooting failed migrations.
For example, you can run a simple query to inspect user records:
SELECT id, email, created_at FROM users ORDER BY created_at DESC LIMIT 10;
You can also use SQL queries to check whether a specific table exists:
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';
Run read-only queries first when working on production data. Use SELECT statements to inspect the database before running UPDATE, DELETE, ALTER, or DROP commands.
Edit database records
Adminer lets you create, update, and delete records from the browser interface. This helps when you need to fix a test record, update a configuration value, or remove incorrect sample data from a development database.
To edit a record, open the table, find the target row, and choose the edit option. Adminer will show the available columns and their current values. After updating the field, save the change and refresh the table to confirm the new value.
Use record editing carefully on live databases. A direct database edit bypasses application-level validation, potentially creating inconsistent data if the value does not match the application’s expected format.
Import and export database data
Adminer supports database import and export, which is useful for moving data between environments or creating quick backups before making changes.
Use exports when you need to:
- Save a copy of a database before testing changes.
- Move data from a local Docker setup to a VPS.
- Transfer selected tables between development and staging environments.
- Review database contents outside Adminer.
Use imports when you need to restore a database dump or add existing data to a new Docker database container.
Before importing data, confirm that the target database is correct. Importing an SQL file into the wrong database can overwrite tables or create duplicate records, depending on the dump content.
Manage database users and permissions
Adminer can help manage database users and permissions if the connected database account has enough privileges. This is useful when you need to create a dedicated user for an application, limit access to specific databases, or review existing privileges.
For routine database management, avoid using the root or default administrator account. Create a dedicated database user with only the permissions needed for the task.
For example:
- Use read-only permissions for reporting or inspection.
- Use read and write permissions for application users.
- Reserve administrator permissions for schema changes, user management, and maintenance tasks.
This approach reduces the risk of accidental changes because each database user has a clear purpose and limited access.
Use Adminer for lightweight database checks
Adminer works best for quick, focused database management tasks. It is useful when you need to inspect Docker database data, test queries, edit individual records, or export small databases without opening a heavyweight database administration tool.
For long-running database maintenance, large imports, or complex production workflows, use Adminer together with proper backups, database logs, command-line tools, and access controls. This keeps Adminer useful as a lightweight interface while preserving safer workflows for critical database operations.
Why use Adminer for lightweight database management?
Adminer is useful for lightweight database management because it provides a browser-based interface for common database tasks without requiring a full database administration suite. When Adminer runs in Docker, you can start it as a separate container, connect it to your database service, and stop or remove it when direct database access is no longer needed.
This setup works well for Docker projects where you need to inspect tables, run SQL queries, edit records, or export data quickly. For example, you can use Adminer to check whether a Dockerized application writes new user records correctly or whether a database migration created the expected columns.
Adminer also supports multiple database systems, including PostgreSQL, MySQL, MariaDB, and SQLite. This makes it practical for VPS users who manage several Docker stacks with different database engines.
Use Adminer when you need a simple database interface for development, debugging, staging, or small VPS projects. For advanced production workflows, combine Adminer with proper backups, database logs, access controls, and dedicated database administration tools.
Is Adminer the right tool for Docker database management?
Adminer is the right tool for Docker database management if you need a lightweight, browser-based interface for routine database tasks. It works well for inspecting tables, running SQL queries, editing records, and importing or exporting data from a Docker database container.
Adminer is especially useful for development, debugging, staging, and small VPS projects. You can run it as a separate container, connect it to your database service, complete the task, and then stop the container. This keeps your Docker stack simple while still giving you direct database access when needed.
For larger production environments, Adminer should be used with stricter security controls. Protect the interface with HTTPS, firewall rules, limited database users, and strong passwords. Avoid exposing Adminer publicly unless access is restricted.
Choose Adminer if you want a simple database management interface for Dockerized PostgreSQL, MySQL, MariaDB, SQLite, or similar databases. Use a dedicated database administration tool if you need advanced monitoring, complex performance analysis, or team-based database workflows.