Databases
Kuploy provides managed databases that are easy to set up and automatically backed up. All databases run within your project's private network for security.
Supported Databases
| Database | Use Case | Default Port |
|---|---|---|
| PostgreSQL | Relational data, complex queries, ACID compliance | 5432 |
| MySQL | Web applications, read-heavy workloads | 3306 |
| MariaDB | MySQL-compatible, enhanced performance | 3306 |
| MongoDB | Document storage, flexible schemas | 27017 |
| Redis | Caching, sessions, real-time data | 6379 |
Creating a Database
- Navigate to your project
- Click Add Resource → Database
- Select your database type
- Configure settings:
- Name: A unique identifier
- Version: Database version (latest stable recommended)
- Size: CPU and memory allocation
- Click Create
The database is provisioned within minutes.
Database Sizing
| Size | CPU | Memory | Storage | Use Case |
|---|---|---|---|---|
| Starter | 0.5 vCPU | 512 MB | 5 GB | Development, small apps |
| Standard | 1 vCPU | 2 GB | 20 GB | Production workloads |
| Pro | 2 vCPU | 8 GB | 100 GB | High-traffic applications |
| Enterprise | 4 vCPU | 32 GB | 500 GB | Large-scale production |
Internal Connection Strings
Databases are accessible within your project's private network using internal hostnames.
PostgreSQL
# Connection string format
postgresql://[user]:[password]@[host]:5432/[database]
# Example
postgresql://kuploy:abc123xyz@pg-mydb.kuploy.internal:5432/app_production
# Individual components
POSTGRES_HOST=pg-mydb.kuploy.internal
POSTGRES_PORT=5432
POSTGRES_USER=kuploy
POSTGRES_PASSWORD=abc123xyz
POSTGRES_DATABASE=app_production
MySQL
# Connection string format
mysql://[user]:[password]@[host]:3306/[database]
# Example
mysql://kuploy:abc123xyz@mysql-mydb.kuploy.internal:3306/app_production
# Individual components
MYSQL_HOST=mysql-mydb.kuploy.internal
MYSQL_PORT=3306
MYSQL_USER=kuploy
MYSQL_PASSWORD=abc123xyz
MYSQL_DATABASE=app_production
MariaDB
# Connection string format
mysql://[user]:[password]@[host]:3306/[database]
# Example
mysql://kuploy:abc123xyz@mariadb-mydb.kuploy.internal:3306/app_production
# Uses same format as MySQL
MYSQL_HOST=mariadb-mydb.kuploy.internal
MYSQL_PORT=3306
MongoDB
# Connection string format
mongodb://[user]:[password]@[host]:27017/[database]
# Example
mongodb://kuploy:abc123xyz@mongo-mydb.kuploy.internal:27017/app_production
# With auth database
mongodb://kuploy:abc123xyz@mongo-mydb.kuploy.internal:27017/app_production?authSource=admin
# Individual components
MONGO_HOST=mongo-mydb.kuploy.internal
MONGO_PORT=27017
MONGO_USER=kuploy
MONGO_PASSWORD=abc123xyz
MONGO_DATABASE=app_production
Redis
# Connection string format
redis://:[password]@[host]:6379
# Example
redis://:abc123xyz@redis-mydb.kuploy.internal:6379
# Individual components
REDIS_HOST=redis-mydb.kuploy.internal
REDIS_PORT=6379
REDIS_PASSWORD=abc123xyz
Use the Link Resource feature in your application's Environment tab to automatically inject these connection strings.
Backups
Kuploy provides flexible backup options to protect your data.
Manual Backups
Create a backup on-demand:
- Go to your database → Backups tab
- Click Create Backup
- Add an optional description
- Click Create
Backups typically complete within minutes.
Scheduled Backups
Set up automatic backups:
- Go to Backups → Schedule
- Configure your schedule:
- Frequency: Daily, Weekly, or Custom (cron)
- Time: When to run (UTC)
- Retention: How many backups to keep
- Click Save
# Example cron expressions
0 2 * * * # Daily at 2:00 AM UTC
0 3 * * 0 # Weekly on Sunday at 3:00 AM UTC
0 */6 * * * # Every 6 hours
S3 Backup Storage
Store backups in your own S3-compatible storage:
- Go to Backups → Storage
- Click Configure S3
- Enter your credentials:
- Endpoint: S3 endpoint (or compatible service)
- Bucket: Bucket name
- Access Key ID: Your access key
- Secret Access Key: Your secret key
- Region: Bucket region
- Click Test Connection
- Click Save
Supported S3-compatible services:
- Amazon S3
- DigitalOcean Spaces
- Backblaze B2
- MinIO
- Wasabi
Restoring from Backup
- Go to Backups tab
- Find the backup you want to restore
- Click Restore
- Choose restore options:
- In-place: Replace current data (downtime required)
- New database: Create a new database from backup
- Confirm and restore
In-place restoration will overwrite all current data. Create a fresh backup first if needed.
Database Management
Accessing the Database Console
For direct database access:
- Go to your database
- Click Console
- Use the web-based terminal
Or connect via your application using the connection string.
Scaling Your Database
To resize your database:
- Go to Settings → Resources
- Select a new size
- Click Apply
Scaling requires a brief restart. Plan for a few minutes of downtime.
Database Logs
View database logs in real-time:
- Go to your database
- Click Logs
- Filter by severity or search for specific entries
Security
Network Isolation
Databases are only accessible from within your project's private network. External connections are blocked by default.
Enabling External Access
For development or migration purposes:
- Go to Settings → Network
- Enable Public Access
- Whitelist specific IP addresses
- Use the external connection string provided
Only enable public access when necessary. Always use IP whitelisting.
Credential Rotation
Rotate database credentials periodically:
- Go to Settings → Credentials
- Click Rotate Password
- Update your application's environment variables
- Redeploy your application
Best Practices
- Use connection pooling - Reduce connection overhead with tools like PgBouncer
- Enable scheduled backups - Never rely solely on manual backups
- Monitor performance - Check metrics regularly for slow queries
- Size appropriately - Start small and scale as needed
- Use internal networking - Avoid public access in production
- Rotate credentials - Update passwords regularly
- Test restores - Periodically verify your backups work