VPS Tutorials
Private Database Panels on a VPS: phpMyAdmin, Adminer and CloudBeaver (2026)
Choose a database panel by its actual drivers and edition, deploy private Docker listeners, configure tunnels or authenticated HTTPS, troubleshoot proxy URLs, and protect database credentials and backups.

A browser-based database console is useful for inspecting schemas, exporting data and running occasional queries without an SSH SQL session. It also exposes powerful database operations through a web application. phpMyAdmin and similar tools are common scanner targets, including paths such as /phpmyadmin. Install the panel only after choosing how administrators will reach it.
This guide compares phpMyAdmin, Adminer and CloudBeaver, shows Docker examples, and explains private tunnels, authenticated HTTPS and database permissions. A hidden URL is not access control, and a tunnel does not remove the need to secure SSH and the database.
| phpMyAdmin | Adminer | CloudBeaver | |
|---|---|---|---|
| Database support | MySQL/MariaDB | Several SQL engines; additional systems need plugins | Many drivers; support depends on edition and installed drivers |
| Original approximate image comparison | ~180 MB | ~30 MB | ~500 MB |
| Original memory examples | Moderate | ~20 MB idle | 300 MB–1 GB JVM workload |
| Startup example | Seconds | Seconds | 30–60 seconds |
| Interface | Detailed traditional administration | Compact single-page tool | IDE-style web interface |
| SQL editor | Editor and completion | Basic text input | Rich editor and completion |
| Visual schema tools | Designer | No equivalent built-in designer | ER diagrams where supported |
| Separate team identities | Database accounts plus outer access controls | Database accounts plus outer access controls | Application users; capabilities vary by edition |
| Import/export | Extensive, with configurable limits | Basic workflows | Driver/edition-dependent workflows |
Image sizes, startup times and memory are rough figures from the original comparison, not measurements of current releases. Measure the image and queries you deploy. Adminer's official documentation distinguishes built-in relational support from plugins for engines such as MongoDB and Redis. Do not assume the default CloudBeaver community image includes every driver advertised for paid editions; check its supported-database matrix.
- For MySQL/MariaDB-focused administration, phpMyAdmin offers detailed tools.
- For occasional work with low resource overhead, consider Adminer and the drivers/plugins you need.
- For team access, saved connections and richer SQL tooling, evaluate CloudBeaver's actual edition.
They can coexist: keep a small private tool available and start heavier panels on demand. Allocate different ports.
SSH tunnel for an individual administrator. Bind the panel to 127.0.0.1 and connect from your own machine:
ssh -L 8080:127.0.0.1:8080 user@你的服务器
Open http://127.0.0.1:8080 locally. Traffic travels through SSH; no extra public panel port or domain is needed. Replace the server placeholder, verify its host identity and use a loopback-only local listener. The example forwards phpMyAdmin's port; Adminer and CloudBeaver below use 8081 and 8978, so adapt the destination and local port. The SSH session must remain active. This reduces public exposure; it is not zero attack surface.
HTTPS reverse proxy with authentication for a team.
- Use HTTPS at the proxy and secure its connection to the backend.
- Add Basic Auth or an identity gateway such as Cloudflare Access.
- Restrict source IPs where appropriate and close direct paths around the gateway.
Direct public panel port. Avoid this as the default. A strong database password and Fail2Ban cannot substitute for restricting the panel's exposure. All deployment examples below bind the published port to loopback.
Put phpMyAdmin and its database in a shared Docker network. If following the MySQL 8.4 guide, adding it to that Compose project is a convenient way to reuse the network:
services:
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
container_name: phpmyadmin
restart: unless-stopped
environment:
PMA_HOST: mysql
PMA_PORT: 3306
PMA_ABSOLUTE_URI: https://db.example.com/
UPLOAD_LIMIT: 300M
ports:
- "127.0.0.1:8080:80"
Set PMA_HOST to the database service name on that network, not an arbitrary changing container IP. Services in one Compose project normally share a network and resolve one another by service name. UPLOAD_LIMIT controls upload limits; large SQL imports can also hit PHP memory/execution or proxy limits. Pin a reviewed image version for production instead of treating latest as reproducible.
For PostgreSQL, consider pgAdmin with settings such as PGADMIN_DEFAULT_EMAIL and PGADMIN_DEFAULT_PASSWORD.
If login fails, inspect MySQL grants. An account defined as 'user'@'localhost' may not match a connection originating from the Docker network:
CREATE USER 'appuser'@'%' IDENTIFIED BY '强密码';
GRANT ALL PRIVILEGES ON appdb.* TO 'appuser'@'%';
FLUSH PRIVILEGES;
The password text is a placeholder. The example '%' host match is broad and grants all privileges on one database; replace it with the necessary source range and minimum operations where possible. Do not give a web panel the global root account.
Adminer is a compact PHP application; this container starts a private instance:
docker run -d \
--name adminer \
--restart unless-stopped \
-p 127.0.0.1:8081:8080 \
--network 你的数据库网络名 \
adminer
Replace the database-network placeholder with an existing network shared by the database. The usual login page asks for driver, server and credentials; no separate user directory is required for basic use.
On a shared Docker network, use a service name such as mysql. For a host database, host.docker.internal needs the Linux mapping --add-host=host.docker.internal:host-gateway, and the database must accept that controlled container-network source. A host service bound only to its own loopback is not automatically reachable through the host gateway. Do not solve this by opening the database to the internet.
Adminer handles common queries, export and schema editing without a large interface. Workload still determines memory/CPU. Themes and plugins can be mounted into the container; install only reviewed files and back up customizations.
CloudBeaver brings DBeaver-style editing, diagrams and saved connections to a browser. Check drivers and team-management capabilities for the edition you will run:
services:
cloudbeaver:
image: dbeaver/cloudbeaver:latest
container_name: cloudbeaver
restart: unless-stopped
ports:
- "127.0.0.1:8978:8978"
volumes:
- ./workspace:/opt/cloudbeaver/workspace
environment:
- CB_SERVER_MEMORY=1024m
Persist workspace: connections, queries and application users can be lost on recreation without the workspace volume. Include it in backups and restrict access because it may contain sensitive settings. Join the required database network; the example alone does not create connectivity to another Compose project.
The original guide budgets 300–500 MB idle and up to roughly 1 GB under queries. These are not limits. On a 1 vCPU/2 GB VPS, leave headroom for the host and other services. Verify whether your chosen image honors CB_SERVER_MEMORY and which JVM settings it supports; a heap setting is not a total container memory limit.
Allow startup time; the original example suggests 30–60 seconds. Use logs and health evidence if it does not become ready. Create an administrator through initial setup, then configure individual team users, connection access and least-privilege database credentials. Application permissions do not automatically replace database grants.
For Redis 8 and MongoDB 8, choose tools that support those engines in the installed edition.
Redis often needs only GET, SET and KEYS through redis-cli. For memory analysis or slow-query investigation, RedisInsight uses the redis/redisinsight image and port 5540; install it when needed and keep access private.
Mongo Express, using mongo-express, supports browsing collections and editing documents. Place it on the MongoDB network and configure its connection and authentication. Database authentication and any panel authentication are separate controls.
Inspect ports and loopback prefix 127.0.0.1: on published ports. Unauthenticated public Redis and MongoDB have a history of serious compromise. If using CloudBeaver for these engines, verify drivers and licensing explicitly; its default image must not be assumed to connect to both.
For remote browser access, the original Caddy example adds HTTPS and authentication:
db.example.com {
basicauth {
admin $2a$14$你的密码哈希
}
reverse_proxy 127.0.0.1:8080
}
Replace the password-hash placeholder with a securely generated hash. Recent Caddy versions name this directive basic_auth; the source uses the older spelling. Adapt it for the installed version and validate the configuration before reloading. A reverse proxy on another host/container needs a private reachable backend; its own 127.0.0.1 is not this VPS's listener.
phpMyAdmin can generate incorrect public URLs when $_SERVER['HTTP_HOST'] reflects an internal address such as http://localhost:8080:
- Login redirects to an inaccessible localhost address.
- CSS/JavaScript fail and the page appears unstyled.
- Forms fail due to URL, cookie or CSRF mismatch.
Set PMA_ABSOLUTE_URI to the complete external base URL, including the documented trailing slash, such as https://db.example.com/. Verify Host and X-Forwarded-*, trusted proxy handling and any path rewriting. Blindly changing slash variants is not a substitute for checking the actual URL. See the Caddy reverse-proxy guide; Nginx requires its own header and location configuration. Adminer and CloudBeaver can also need correct base paths, cookies and proxy settings.
A loopback panel binding requires no additional public port, but the database may still be exposed. Inspect ports: "3306:3306" without 127.0.0.1: can publish on all interfaces. Use a reviewed loopback mapping such as "127.0.0.1:3306:3306", or remove unnecessary publication and use a private Docker network.
Docker-published -p 3306:3306 ports may bypass ordinary UFW rules. The original mentions DOCKER_OPTS and DOCKER-USER; do not disable Docker firewall management blindly, as this can break isolation/NAT. Select rules for the actual Docker firewall backend and both IP families. See the UFW and Docker guide. A tunnel does not excuse auditing unrelated database ports.
- Create a dedicated panel account instead of root.
- Grant only the databases it must administer, without unnecessary global privileges.
- Use read-only production access unless a reviewed task needs writes.
- Stop unused panels with
docker compose stop phpmyadmin.
phpMyAdmin and Adminer rely mainly on database accounts and outer access controls. CloudBeaver has application identities; use individual connection credentials where supported. Avoid one shared high-privilege login for the whole team.
Back up CloudBeaver's workspace, including its Compose configuration and secrets securely. Basic phpMyAdmin/Adminer deployments are largely stateless, but preserve Compose, environment configuration and any custom plugins/themes:
cd ~/cloudbeaver
docker compose stop
tar czf ~/cloudbeaver-$(date +%F).tar.gz workspace docker-compose.yml
docker compose start
This stops CloudBeaver while archiving its workspace. Protect and transfer the archive off-server, then test restoration. A panel backup is not a database backup: follow the MySQL backup guide for database consistency and recovery.
Cannot log in to the MySQL server: check PMA_HOST, shared network and source-host grants. Service names are stable within the appropriate Docker network; a valid fixed address can also work when configured deliberately.
Unstyled phpMyAdmin after proxying: check PMA_ABSOLUTE_URI, external base URL/trailing slash, forwarded headers, paths and cookies.
Adminer cannot reach the host database: 127.0.0.1 is the container itself. Use configured host.docker.internal and controlled host connectivity, or a shared database-container network.
CloudBeaver keeps loading: allow startup, then inspect docker compose logs and memory/OOM evidence if it exceeds roughly two minutes; initialization and connection errors are other possibilities.
Large SQL import fails: raise UPLOAD_LIMIT within available resources and check PHP/proxy limits. Multi-gigabyte dumps are usually better restored with the mysql client.
High CPU: inspect request logs and expensive queries; scans are one possible cause, not proof. Restrict any public exposure and investigate legitimate workload too.
A panel can perform whichever operations its credentials allow. Keep it on loopback behind SSH for personal use; for teams, combine authenticated HTTPS, closed bypass paths and individual database permissions. Maintain updates, backups and restore checks for either arrangement.