Adminer is a full database management tool in a single PHP file. It supports MySQL/MariaDB, PostgreSQL, SQLite, MS SQL and more: browse tables, edit rows, run queries, import and export. It’s much smaller than phpMyAdmin and works with PostgreSQL too — but, like any web-based admin tool, it must be locked down.
Option 1: Docker (simplest, isolated)
docker run -d --name adminer --restart unless-stopped \
-p 127.0.0.1:8081:8080 adminer
Reach it through an SSH tunnel:
ssh -L 8081:127.0.0.1:8081 user@your-server
Open http://localhost:8081. If your database runs on the host, use the host’s address as the server — from the container, localhost is the container itself. Add --add-host=host.docker.internal:host-gateway and connect to host.docker.internal (the database must listen on an address reachable from the Docker bridge), or run Adminer on the same Docker network as your database container and use its service name.
Option 2: PHP file behind Nginx
Requires PHP-FPM with the database extensions (php-mysql / php-pgsql).
sudo mkdir -p /var/www/adminer
sudo wget -O /var/www/adminer/index.php https://www.adminer.org/latest.php
sudo chown -R www-data: /var/www/adminer
Nginx server block on a localhost-only port:
server {
listen 127.0.0.1:8081;
root /var/www/adminer;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
}
Reload Nginx and use the same SSH tunnel as above. Nothing is exposed to the internet.
If you must publish it on a domain, put it behind HTTPS and an extra layer: basic authentication, an IP allow-list, or a VPN. Use an unguessable path rather than /adminer.
Logging in
- System: MySQL, PostgreSQL, SQLite…
- Server:
localhost(or127.0.0.1to force TCP) - Username / Password: a database user — on Ubuntu, MySQL’s
rootuses socket authentication and can’t log in from Adminer; use a password-based user. See MySQL users and privileges.
Adminer refuses to log in to databases without a password by default — a sensible safety measure.
Useful features
- SQL command with history.
- Import
.sql/.sql.gz(limited by PHP upload settings — import large dumps from the shell instead:mysql db < dump.sql). - Export tables or the whole database.
- Search across tables.
- Plugins (via
adminer-plugins), and alternative themes (“designs”) by droppingadminer.cssnext to the file.
Keep it updated — or remove it
Old Adminer versions have had security vulnerabilities. Download the latest version when you install it, and update periodically. Many admins simply delete Adminer after the task is done and re-download it when needed — a single file makes that painless.
Alternatives
- Desktop clients over an SSH tunnel — DBeaver, TablePlus, HeidiSQL, DataGrip, pgAdmin Desktop. Nothing web-facing on the server at all. See SSH tunnels.
- phpMyAdmin — MySQL/MariaDB only, more features.
- pgAdmin — full-featured PostgreSQL administration.
- CLI —
mysql,psql; see psql commands.
For one-off database tasks on a VPS, Adminer through an SSH tunnel is hard to beat for convenience.