Databases & Storage
PostgreSQL
Add a PostgreSQL relational database to your project
PostgreSQL is a powerful, open-source relational database. Rock8Cloud supports versions 14 through 17.
Create a PostgreSQL Service
- Click Add Service in your project
- Select Database
- Choose PostgreSQL
- Select a version (14, 15, 16, or 17) and storage size
- Enter a name (e.g.,
postgres-main,postgres-api) - Click Create
Rock8Cloud provisions the database with secure credentials and networking handled automatically.
Environment Variables
After creation, Rock8Cloud exposes these variables for your application to connect:
| Variable | Description | Example |
|---|---|---|
HOST | Database hostname | (auto-generated) |
PORT | Database port | 5432 |
NAME | Database name | postgres-main |
USER | Username | app |
PASSWORD | Password | (auto-generated) |
URL | Full connection URL | postgresql://app:pass@host:5432/dbname |
Linking to Your Application
- Go to your application service → Configuration → Environment Variables
- Add the database variables using the names expected by your framework
Common framework patterns:
# Node.js / Prisma / Drizzle
DATABASE_URL=<URL>
# Django
DATABASE_HOST=<HOST>
DATABASE_PORT=<PORT>
DATABASE_NAME=<NAME>
DATABASE_USER=<USER>
DATABASE_PASSWORD=<PASSWORD>
# Rails
DATABASE_URL=<URL>After saving, your application automatically redeploys with the new configuration.
Features
- Versions 14–17 — choose the version that matches your requirements
- Persistent storage — data survives restarts and redeployments
- Network-isolated — only accessible from services within the same project
- Secure credentials — auto-generated usernames and passwords
- Production-grade — managed with automated failover and monitoring
Troubleshooting
Connection refused
- Verify the
HOSTvariable is correct — use the auto-generated hostname provided by Rock8Cloud - Ensure your application service is in the same project as the database
- Check that the database deployment completed successfully
Authentication failed
- Double-check
USERandPASSWORDvariables match what was provisioned - If using
URL, ensure it's the complete connection string with all components
Database not found
- Verify the
NAMEvariable matches the provisioned database name - The database name is typically the same as the service name you chose during creation
Related
- Dragonfly — Redis-compatible in-memory datastore
- S3 Object Storage — S3-compatible object storage
- Environment Variables — Configure secrets and settings