Rock8Cloud
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

  1. Click Add Service in your project
  2. Select Database
  3. Choose PostgreSQL
  4. Select a version (14, 15, 16, or 17) and storage size
  5. Enter a name (e.g., postgres-main, postgres-api)
  6. 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:

VariableDescriptionExample
HOSTDatabase hostname(auto-generated)
PORTDatabase port5432
NAMEDatabase namepostgres-main
USERUsernameapp
PASSWORDPassword(auto-generated)
URLFull connection URLpostgresql://app:pass@host:5432/dbname

Linking to Your Application

  1. Go to your application service → ConfigurationEnvironment Variables
  2. 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 HOST variable 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 USER and PASSWORD variables match what was provisioned
  • If using URL, ensure it's the complete connection string with all components

Database not found

  • Verify the NAME variable matches the provisioned database name
  • The database name is typically the same as the service name you chose during creation

On this page