Skip to main content

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 start 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 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 remove pgadmin

Configuration

All settings live in pgadmin/defaults.env and can be overridden by adding the same line to your own .env:

VariableDefaultWhat it does
PGADMIN_PORT5050Host-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_PASSWORDadminLogin 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/secret by 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 stop pgadmin
rm -rf "${DATA_PATH_HOST:-~/.laradock/data}/pgadmin"
./laradock start 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_PASSWORD only 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_PASSWORD are only applied when DATA_PATH_HOST/pgadmin is 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 postgres as the host inside pgAdmin's server dialog, not localhost, that only works from your host machine, not from inside another container.
  • Port already in use on your host. Change PGADMIN_PORT in .env and 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 postgres and wait for database system is ready to accept connections before adding the server in pgAdmin.

Need a MySQL/MariaDB GUI instead? See phpMyAdmin. Back to the Getting Started guide.