pgAdmin
What is pgAdmin?
pgAdmin is the standard web-based admin GUI for PostgreSQL, browse schemas, run queries, manage roles, and inspect query plans. There's nothing to "install", Laradock runs it straight from the official dpage/pgadmin4 image and points it at your postgres container.
Start pgAdmin
pgAdmin is useless without a Postgres server to point at, so start both together:
- Laradock CLI
- Docker Compose
./laradock start postgres pgadmin
docker compose up -d postgres pgadmin
pgadmin depends on postgres in pgadmin/compose.yml, so Compose starts postgres first automatically even if you just start pgadmin on its own.
Stop pgAdmin
- Laradock CLI
- Docker Compose
./laradock stop pgadmin
docker compose stop pgadmin
This stops the container without deleting its saved server list. Data lives under DATA_PATH_HOST/pgadmin.
To delete the container entirely (the data on disk is still untouched):
- Laradock CLI
- Docker Compose
./laradock remove pgadmin
docker compose rm -sf pgadmin
Configuration
All settings live in pgadmin/defaults.env and can be overridden by adding the same line to your own .env:
| Variable | Default | What it does |
|---|---|---|
PGADMIN_PORT | 5050 | Host-side port for the web UI (container port 80). |
PGADMIN_DEFAULT_EMAIL | [email protected] | Login email for the pgAdmin app itself (not a Postgres credential). |
PGADMIN_DEFAULT_PASSWORD | admin | Login password for the pgAdmin app itself. |
Log in
Open http://localhost:5050 and sign in with PGADMIN_DEFAULT_EMAIL / PGADMIN_DEFAULT_PASSWORD ([email protected] / admin by default).
Connect to your Postgres server
Once logged in, add a new server in pgAdmin's UI:
- Host:
postgres(the container name) - Port:
5432(container-internal port) - Username/Password: your
POSTGRES_USER/POSTGRES_PASSWORD(default/secretby default)
pgAdmin remembers this server definition in its own storage (DATA_PATH_HOST/pgadmin), so you only need to add it once, it's still there next time you log in.
Reset pgAdmin (forget saved servers and login)
To wipe pgAdmin's own storage, saved server list, app login, preferences, without touching your actual Postgres data:
- Laradock CLI
- Docker Compose
./laradock stop pgadmin
docker compose stop pgadmin
rm -rf "${DATA_PATH_HOST:-~/.laradock/data}/pgadmin"
- Laradock CLI
- Docker Compose
./laradock start pgadmin
docker compose up -d pgadmin
The next start re-applies PGADMIN_DEFAULT_EMAIL/PGADMIN_DEFAULT_PASSWORD as if it were a brand-new install, and you'll need to re-add your Postgres server connection. Your actual databases (in the postgres container's own DATA_PATH_HOST/postgres volume) are completely unaffected.
Common issues
- pgAdmin login and Postgres login are different things.
PGADMIN_DEFAULT_EMAIL/PGADMIN_DEFAULT_PASSWORDonly get you into the pgAdmin app itself, you still add and authenticate against your actual Postgres server separately inside the UI. - Credential changes don't take effect.
PGADMIN_DEFAULT_EMAIL/PGADMIN_DEFAULT_PASSWORDare only applied whenDATA_PATH_HOST/pgadminis created for the first time. If you change them afterward, either reset pgAdmin (loses saved servers/settings, Postgres data is untouched) or change the user from inside pgAdmin's own user management. - Can't reach Postgres by container name. Use
postgresas the host inside pgAdmin's server dialog, notlocalhost, that only works from your host machine, not from inside another container. - Port already in use on your host. Change
PGADMIN_PORTin.envand restart:./laradock restart pgadmin. - "Unable to connect to server" right after first boot. Postgres needs a few seconds to initialize on a truly fresh
DATA_PATH_HOST. Run./laradock logs postgresand wait fordatabase system is ready to accept connectionsbefore adding the server in pgAdmin.
Need a MySQL/MariaDB GUI instead? See phpMyAdmin. Back to the Getting Started guide.