PostgreSQL Database
Advanced open-source relational database
Advanced relational database using PostgreSQL 17 Alpine.
Docker Configuration
Image: postgres:17-alpine
Ports: 5432:5432
Volume: damp_pgsql_data:/var/lib/postgresql/dataDAMP identifies the service using Docker labels. Container name is auto-generated by Docker.
Port Configuration
Default ports: 5432 (host) → 5432 (container)
If port 5432 is occupied on the host machine, DAMP automatically uses the next available port. Check the DAMP interface to see the actual port assigned.
Environment Variables
| Variable | Value | Description |
|---|---|---|
POSTGRES_PASSWORD | postgres | Superuser password |
POSTGRES_DB | development | Default database |
POSTGRES_USER | postgres | Superuser account |
Connection Information
From Host Machine (Windows)
Connect from your Windows host to the PostgreSQL service.
psql -h localhost -p 5432 -U postgres -d developmentConnection Details:
- Host:
localhost - Port:
5432(or actual port shown in DAMP) - User:
postgres - Password:
postgres - Database:
development
Connection String:
postgresql://postgres:postgres@localhost:5432/developmentFrom Project Containers
Connect from your DevContainers or other Docker containers to the PostgreSQL service.
Use the container name or ID shown in the DAMP interface.
# Using container name from DAMP
psql -h [container-name] -U postgres -d developmentLaravel .env Configuration:
DB_CONNECTION=pgsql
DB_HOST=[container-name]
DB_PORT=5432
DB_DATABASE=development
DB_USERNAME=postgres
DB_PASSWORD=postgresReplace [container-name] with the actual container name displayed in DAMP.
Common Operations
Create New Database
psql -h localhost -U postgres
CREATE DATABASE my_app;Import SQL Dump
# From host
psql -h localhost -U postgres development < dump.sql
# From project container (use container name from DAMP)
psql -h [container-name] -U postgres development < dump.sqlBackup Database
pg_dump -h localhost -U postgres development > backup.sqlData Persistence
All databases are stored in the damp_pgsql_data Docker volume and persist across container restarts.