PostgreSQL Database Setup
Overview
PostgreSQL serves as the primary database for:
- User data and configurations
- Platform state
- Application data
- Minimum version required: PostgreSQL 13+
Deployment Options
- Managed Service (Recommended)
- Helm Chart
Cloud Provider Options
Digital Ocean Managed Database
- Create new database cluster
- Choose PostgreSQL 13+
- Select plan (minimum 2 vCPU, 4GB RAM)
- Enable connection pooling (recommended: 50 connections)
Neon Serverless PostgreSQL
- Create new project
- Set up new database
- Enable connection pooling
- Note the connection string
Other Providers
- Amazon RDS
- Google Cloud SQL
- Azure Database for PostgreSQL
tip
Managed services handle:
- Automatic backups
- High availability
- Security patches
- Performance monitoring
Bitnami PostgreSQL Chart
- Install PostgreSQL:
helm upgrade --install postgresql oci://registry-1.docker.io/bitnamicharts/postgresql \
--namespace postgresql \
--version 14.3.3 \
--create-namespace \
--set global.postgresql.auth.username=platform \
--set global.postgresql.auth.password=your-secure-password \
--set global.postgresql.auth.database=platform
- Wait for deployment:
kubectl -n postgresql get pods -w
caution
For production use:
- Configure proper resource limits
- Set up regular backups
- Consider high availability setup
Requirements
Minimum Specifications
- PostgreSQL 13 or higher
- 2 vCPU cores
- 4GB RAM
- 20GB storage
Recommended Features
- Connection pooling
- Automated backups
- Point-in-time recovery
- SSL/TLS encryption
Information Collection
Required Values for Platform Installation
- Database hostname
- Port number (default: 5432)
- Database name
- Username
- Password
- SSL mode (e.g.,
require
)
Example Configuration
postgresql:
host: "your-db-host"
port: 5432
user: "platform"
password: "your-secure-password"
database: "platform"
sslMode: "require" # or "disable" for local development
Validation
Test your PostgreSQL connection:
# Using psql client
psql "postgres://username:password@hostname:5432/dbname?sslmode=require"
# Or using connection string
psql "postgresql://username:password@hostname:5432/dbname?sslmode=require"
Troubleshooting
Common issues and solutions:
-
Connection Failures
- Verify credentials
- Check network/firewall rules
- Confirm SSL/TLS settings
- Validate connection string format
-
Performance Issues
- Check connection pool settings
- Monitor resource usage
- Review query performance
- Verify index usage
Next Steps
- ✅ Set up PostgreSQL database
- ✅ Configure connection pooling
- ➡️ Proceed to Redis Setup
Need Help?
Contact [email protected] if you encounter any issues.