Overview
This template provides a production‑ready pgAdmin instance as a Monk runnable. You can:- Run it directly to get a managed web-based PostgreSQL administration tool
- Inherit it in your own database infrastructure to provide a GUI for PostgreSQL management
What this template manages
- pgAdmin 4 web application
- SQLite or PostgreSQL for pgAdmin metadata
- Web UI for database administration
- Query tool and data editor
- Server monitoring and statistics
- Web UI on port 5050
Quick start (run directly)
- Load templates
- Run pgAdmin with defaults
- Customize credentials (recommended via inheritance)
variables. Secrets added with monk secrets add will not affect this runnable unless you inherit it and reference those secrets.
- Preferred: inherit and replace variables with
secret("...")as shown below. - Alternative: fork/clone and edit the
variablesinpgadmin/pgadmin.yml, thenmonk load MANIFESTand run.
http://localhost:5050 (or the runnable hostname inside Monk networks) using the configured credentials.
Configuration
Key variables you can customize in this template:${monk-volume-path}/pgadmin:/var/lib/pgadmin on the host.
Use by inheritance (recommended for database management)
Inherit the pgAdmin runnable in your database infrastructure and declare a connection. Example:Ports and connectivity
- Service:
pgadminon TCP port5050 - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve the pgAdmin host. - From pgAdmin, connect to PostgreSQL servers on their respective ports (typically
5432)
Persistence and configuration
- Data path:
${monk-volume-path}/pgadmin:/var/lib/pgadmin - Server definitions, query history, and settings are persisted in the data path
Features
- Web-Based: Access from any browser, no desktop client needed
- Query Tool: Interactive SQL editor with syntax highlighting
- Data Editor: View and edit table data
- Schema Browser: Visual database structure exploration
- Backup & Restore: GUI for pg_dump and pg_restore
- Server Monitoring: Real-time server statistics
- Multi-Server: Manage multiple PostgreSQL servers
- User Management: Role-based access control
- Import/Export: CSV, JSON, and other formats
Adding PostgreSQL Servers
After login:- Right-click “Servers” → Register → Server
- General tab: Name your connection
- Connection tab:
- Host:
postgres(or server hostname) - Port:
5432 - Maintenance database:
postgres - Username:
postgres - Password: (save password for convenience)
- Host:
- Click “Save”
Query Tool
Features:- Syntax highlighting for SQL
- Query history
- Auto-completion
- Explain and analyze plans
- Export results to CSV, JSON
- Saved queries
Use cases
pgAdmin excels at:- PostgreSQL database administration
- SQL query development and testing
- Database schema design
- Data exploration and analysis
- Backup and restore operations
- Server monitoring and tuning
- Team database management
Related templates
- See other templates in this repository for complementary services
- Combine with monitoring tools (
prometheus-grafana/) for observability - Integrate with your application stack as needed
Troubleshooting
- If you changed
pgadmin-passwordbut the container has existing data, authentication may fail. Either reset the data volume or update the password inside pgAdmin to match. - Ensure the host volumes are writable by the container user.
- Check logs:
- For connection issues to PostgreSQL:
- Verify PostgreSQL is running and accessible
- Check hostname/IP and port
- Verify PostgreSQL allows connections from pgAdmin container
- Check
pg_hba.conffor access rules
- For performance issues, ensure adequate resources for pgAdmin container
- Store server passwords securely in pgAdmin’s password vault