Skip to main content
Haven’t deployed an app yet? Start with the Quick Start Guide to set up your first application, then return here to add a database.

Overview

This guide shows you how to create a database in your environment and connect it to your application.

Supported Databases

Qovery supports the following managed databases on AWS:

PostgreSQL

Most popular relational database

MySQL

Traditional relational database

MongoDB

Document-oriented NoSQL database

Redis

In-memory key-value store

Creating a Database

1

Navigate to Your Environment

In the Qovery Console, go to your project and select the environment where you want to add the database.
2

Add a Database via New Service

Click the New Service button, then either:
  • Select Database from the service type list, or
  • Search directly for the database you want (e.g., “MySQL”, “PostgreSQL”)
3

Configure Basic Settings

Configure your database:
  • Database Type: PostgreSQL, MySQL, MongoDB, or Redis
  • Name: Give your database a name
  • Version: Choose the database version
  • Mode: Managed (uses AWS managed services like RDS, DocumentDB, and ElastiCache)
4

Configure Resources

Set the resource allocation for your database:
  • Instance Type: Select from available AWS instance types
  • Storage Size: Configure storage capacity based on your needs
  • Storage Type: Choose storage performance tier (e.g., gp3, io1)
5

Create and Deploy

Review your settings and click Create. You can choose to create the database alone or create and deploy it immediately.

Connecting Your Application

Qovery automatically injects database credentials as environment variables when your application runs. You’ll have access to a connection URI and individual connection details.

Using the Connection URI

The easiest way to connect is using the connection URI environment variable:
// Node.js with PostgreSQL example
const { Pool } = require('pg');

const pool = new Pool({
  connectionString: process.env.QOVERY_POSTGRESQL_Z9XXXXXX_DATABASE_URL,
});

Available Environment Variables

For each database, Qovery provides:
  • QOVERY_POSTGRESQL_<DBID>_DATABASE_URL - Complete connection string
  • QOVERY_POSTGRESQL_<DBID>_HOST - Database host
  • QOVERY_POSTGRESQL_<DBID>_PORT - Database port
  • QOVERY_POSTGRESQL_<DBID>_LOGIN - Database username
  • QOVERY_POSTGRESQL_<DBID>_PASSWORD - Auto-generated password
  • QOVERY_POSTGRESQL_<DBID>_DEFAULT_DATABASE_NAME - Default database name
Replace POSTGRESQL with your actual database type (MYSQL, MONGODB, REDIS, etc.) and <DBID> with the database ID shown in the Console (visible in the Variables tab of your service).
The exact variable names are always visible in the Variables tab of any service that has the database attached. You can copy them directly from there.

Database Management

Backups

Backups are handled automatically by AWS managed database services (RDS, DocumentDB, ElastiCache).

Best Practices

Choose the appropriate AWS instance type based on your workload. Start with smaller instances and scale up as needed.
Enable automated backups and set an appropriate retention period for your use case.
Database passwords are generated automatically. Store them securely and rotate regularly.

Next Steps

Environment Variables

Manage database credentials securely

Database Configuration

Advanced database configuration

Database Seeding

Initialize your database with sample data

Lifecycle Jobs

Automate database tasks during deployment