Deploy an app with a Postgres database

Deploy your app and Postgres together without turning database setup into a separate project. Tokay detects the connection your code expects, creates the database, and supplies the URL through the same environment variable.

Last updated

The database follows the app

You can move from code to a working Postgres connection in one deployment. Push or paste the app, and Tokay shows the detected connection with the Service's environment variables before anything goes live.

When you deploy, we create the database, generate its credentials, and supply the URL through DATABASE_URL or the variable your code already reads. The connection uses the format expected by the app's database library.

If the app should use an existing Postgres database, store that URL as a Project secret under the same variable name and choose it during setup.

Every process shares the same data

Tokay connects each Service in the Project to the same Postgres resource, so adding a worker or scheduled job does not create another round of database setup. The web app, background work, and scheduled tasks all receive the same connection and secrets.

Migrations stay part of the deploy

Database changes are part of the normal release, which saves you from coordinating a separate production procedure. Tokay rehearses each migration against a copy of your data before it reaches production.

If a migration would remove data, you see the impact and decide whether to continue. We take a snapshot before an approved destructive change. See deploy database migrations safely for the full workflow.

Your AI agent can deploy the whole system

A coding agent like Claude Code or Codex can return a verified app and database without handing the provisioning work back to you. When the submitted code expects Postgres, Tokay creates the resource and supplies the connection. The agent can complete the rest of setup, deployment, and verification through Tokay's GraphQL API.

Point your agent to app.tokay.io/llms.txt for the deployment protocol.

Tokay has a very generous free tier with no credit card. Get started.

Related guides