Docs

Databases

PostgreSQL, MySQL and Redis on your own server, linked to your apps.

What you get

  • Each database runs in its own container on one of your servers, on a private network. Only apps linked to it on the same server can connect.
  • Engines: PostgreSQL 17 or 16, MySQL 8.4, and Redis 8 (Valkey).
  • Memory: 256 MB, 512 MB, 1 GB or 2 GB.
  • How many databases a team and each server may run depends on the plan (Free: 2 per team, 2 per server). See Limits.

Create a database

  1. 1

    Open the project

    Open the project and environment the app is in, then click Databases.
  2. 2

    Fill in the form

    Under New database in your environment, pick a Name, Type, Version, Server and Memory.
  3. 3

    Create it

    Click Create database. The status changes to running when it is ready. Owners, admins and developers can create databases.

An app can use a database only after you link them. The app must be in the same environment and on the same server.

  1. 1

    Open the database

    Open the database and go to Linked apps.
  2. 2

    Pick the app

    Choose the App. Leave Variable empty to use the default name, or type another name for a second database of the same kind. Click Link app.
  3. 3

    Deploy the app

    The link applies on the app's next deploy. Redeploy the app to give it the variables now. Unlink also applies on the next deploy.

Connection variables

  • PostgreSQL and MySQL: DATABASE_URL, for example postgresql://user:password@host:5432/name.
  • Redis: REDIS_URL, for example redis://default:password@host:6379/0.
  • Laravel apps also get DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD, or REDIS_HOST, REDIS_PORT and REDIS_PASSWORD, when the link uses the default variable name.
  • The app's Environment tab lists these names under From linked databases, with the values hidden.
  • The database page shows Host, Port, Database and User under Connect. Owners and admins can click Show password; each time is recorded in Activity.

Resize

  • On the database page, pick a new Memory size and click Resize. The database must be running.
  • The database restarts with the new memory cap and keeps its data. Linked apps reconnect after a few seconds.
  • A larger size is refused when the server does not have enough free memory. Pick a smaller size or resize the server first.

Rotate the password

  • Owners and admins click Rotate password, read the note and click Rotate the password. The database must be running.
  • CloudPloy sets a new password and redeploys every linked app that was deployed, so the apps get it.
  • PostgreSQL and MySQL move to a second login with the new password; Redis gets the new password beside the old one. The old login or password keeps working until the linked apps are redeployed (at most 30 minutes), then stops working.
  • The database does not restart. An older MySQL or Redis database may restart once, on its first rotation, to get ready for this.
  • Anything outside CloudPloy that uses the old password must be updated by hand.

Public access

Connect from your laptop or a BI tool. It is off for every database until an owner or admin turns it on, and it is never open to everyone.

  • On the database page, under Public access, list the IPv4 addresses or ranges that may connect (at most 10, each a /16 or narrower, public addresses only). Add my current IP adds the address you browse from. Click Turn on public access.
  • CloudPloy opens one port (from 20000 to 20999) for those addresses only: in the server firewall, and on a server CloudPloy launched in your AWS account also in its security group. On a server you connected yourself only the server firewall is set; open the port in any firewall your provider runs in front of it.
  • Connections must use TLS. Copy the external connection string and add the password from Connect: PostgreSQL with sslmode=require, MySQL with --ssl-mode=REQUIRED, Redis with rediss://. Connections without TLS are refused.
  • Each database has its own certificate authority. Download the CA certificate to check the server too (sslmode=verify-ca, --ssl-ca, --cacert).
  • The database restarts for a few seconds when you turn it on or off or change the addresses. Turn off, or deleting the database, closes the port everywhere. Each change is recorded in Activity.
  • The same works over the API (POST /v1/databases/{id}/public-access) and the MCP tool set_database_public_access.

Also on the database page

  • Restart, Stop and Start.
  • Backups and restore: see Backups and restore.
  • Logs and current use: see Logs and metrics.
  • Delete database: type the name to confirm. It removes the container and its data from the server and cannot be undone. Backups in your S3 bucket stay until their retention ends.