Databases
↓ Download .mdDatabases
Create PostgreSQL, MongoDB, and Redis databases in seconds, with automatic credentials and localhost access.
Available Databases
| Database | Type | Common Use |
|---|---|---|
| PostgreSQL | Relational | APIs, web apps, structured data |
| MongoDB | Document (NoSQL) | Flexible apps, semi-structured data |
| Redis | Cache/Key-Value | Cache, queues, sessions, real-time |
Creating a Database
- Go to your stack and click New App
- Select Database as the type
- Choose the desired database (PostgreSQL, MongoDB, or Redis)
- Set a name
- Click Create
PodCubo creates the database automatically with:
- Generated credentials (username and password)
- Persistent volume for data storage
- Access via
localhostwithin the stack
Connecting Your App to the Database
A stack in PodCubo is a pod: all containers share the same local network. This means your app and your database communicate via localhost, exactly like your development environment.
To connect your app to the database, use an environment variable with the connection string. Go to your app's edit screen, in the Environment Variables section, and add the database connection string.
PostgreSQL
DATABASE_URL=postgresql://username:password@localhost:5432/defaultdbFor Java/JDBC applications:
DATABASE_URL=jdbc:postgresql://localhost:5432/defaultdb?user=username&password=passwordMongoDB
DATABASE_URL=mongodb://username:password@localhost:27017/defaultdb?authSource=adminRedis
REDIS_URL=redis://default:password@localhost:6379After adding, click Save & Restart to apply.
Tip: Credentials (username and password) are available in the database app's Connection section. Just copy the connection string from there.
Reading the variable in your application
// Node.js
const dbUrl = process.env.DATABASE_URL;# Python
import os
db_url = os.environ["DATABASE_URL"]// Go
dbUrl := os.Getenv("DATABASE_URL")Why localhost?
All containers in a stack run inside the same pod and share the same network interface. Each service listens on its default port:
| Service | Port |
|---|---|
| PostgreSQL | localhost:5432 |
| MongoDB | localhost:27017 |
| Redis | localhost:6379 |
| Your app | localhost:3000 (or whatever port you configured) |
This is secure (no one from outside can access it), fast (zero network latency), and simple (works just like your local environment).
Connecting Remotely
If you need to access the database from external tools like DBeaver, pgAdmin, or MongoDB Compass, PodCubo provides access via external domain with TLS.
The connection string for remote access is different from the local one, it uses the database's public domain instead of localhost.
PostgreSQL (remote)
PodCubo supports PostgreSQL connections via STARTTLS. Configure your client with:
- Host: the app's domain (e.g.,
my-postgres-xxxx.podcubo.com) - Port:
5432 - SSL: Required
- Username and password: same as in the Connection section
Remote connection string:
postgresql://username:[email protected]:5432/defaultdb?sslmode=requireMongoDB (remote)
mongodb://username:[email protected]:27017/defaultdb?authSource=admin&tls=trueRedis (remote)
rediss://default:[email protected]:6379Important: For remote access, always use the connection string with the external domain and TLS. The
localhostconnection string only works within the stack.
Automatic Backups
PodCubo backs up your databases automatically: you pick the schedule and we handle the rest — a dump on time, stored on our storage, ready to restore. No need to bring your own bucket or storage.
Works with PostgreSQL, MongoDB, and Redis.
How it works
- On the database app, go to the Backup section
- Pick a schedule: daily, every 12h, every 6h, or every 3h
- That's it. From there PodCubo dumps on schedule and stores it automatically.
Retention
Backups are kept for up to 90 days with smart rotation: all from the last day, one per day for the past week, one per week for the past month, and one per month up to 90 days. You keep history without storage growing forever.
Restore
In the app's Backup section you see the full history and restore any backup with one click.
Heads up: restore is destructive — it overwrites the database's current data with the chosen backup. PodCubo asks for confirmation before running it.
Your backups survive
If you delete the app or the stack, your backups are not deleted — they stay on our storage and can be restored to a new database later.