phpMyAdmin and Adminer: database panels
How to install a web panel for a database on VDS and lock it down so it doesn’t become an entry door: password access, address restrictions, alternatives.
Updated August 23, 2026
A web panel is convenient for one-off edits and viewing tables. It is also the most common cause of server compromise: /phpmyadmin URLs are brute-forced automatically, and the login form gives direct access to the data.
Adminer: a single file
Adminer is a single PHP file and supports MySQL, PostgreSQL, and SQLite. There is nothing to install:
mkdir -p /var/www/tools
curl -L -o /var/www/tools/adminer.php \
https://github.com/vrana/adminer/releases/latest/download/adminer.php
chown www-data:www-data /var/www/tools/adminer.php
You need a working PHP-FPM. It's best to rename the file to something non-obvious — this isn't protection, but it eliminates mass scanning.
phpMyAdmin
apt install -y phpmyadmin
The package connects to Apache automatically; for Nginx, specify the path manually:
location /db-panel {
alias /usr/share/phpmyadmin;
index index.php;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
}
Required protection
Never install the panel without these three items.
Access only from your address:
location /db-panel {
allow 203.0.113.10;
deny all;
}
An additional password at the web server level:
apt install -y apache2-utils
htpasswd -c /etc/nginx/.htpasswd admin
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
And the third is HTTPS only: Let's Encrypt certificate. Without it, the database password is sent in plain text.
Best option: no panel exposed externally
If your address is dynamic, don't expose the panel at all. Set up an SSH tunnel and work with a desktop client — DBeaver, TablePlus, HeidiSQL:
ssh -L 3307:127.0.0.1:3306 root@YOUR_ADDRESS -N
Details — remote access. This way, nothing except SSH is exposed externally, and you simply don't need the panel.
Common mistakes
| Symptom | Cause |
|---|---|
The browser downloads adminer.php | PHP is not connected to this path |
#1045 Access denied | The database user is bound to a different host |
| Importing a large dump is interrupted | upload_max_filesize and max_execution_time are too small; it's better to import from the console |
Thousands of requests to /phpmyadmin in the logs | Routine scanning — the panel should be closed |
| The panel works, but the site doesn't | The shared PHP-FPM pool is exhausted by the panel's heavy requests |
Dumps through a web panel on large databases time out. A real backup is made from the console on a schedule — database backups.