Skip to main content
Creating a database and deploying a project are separate actions on Pxxl. Simply provisioning a database does not make it visible or reachable inside a project — you must explicitly attach the database as a sub-service and pass its connection URL into the project’s environment variables. Once those two steps are complete and the project is redeployed, your runtime container will have access to the database at startup.
If you created a database but cannot select it from a project, or your application cannot connect at runtime, follow these steps to attach and expose it correctly.
1

Confirm the database is active

Open Dashboard > Database and check that the database status shows active. A database that is still provisioning or in an error state cannot accept connections.
2

Open the project overview or architecture view

Navigate to the project you want to connect the database to.
3

Add the database as a sub-service

In the project overview or architecture view, add the existing database as a sub-service. This registers the database as a dependency of the project and makes the connection details available.
4

Add the database URL to environment variables

In the project Environment settings, add the connection string as an environment variable — typically named DATABASE_URL. Copy the value from the database detail page.
5

Redeploy the project

Trigger a new deployment so the running container starts with the updated environment. Environment variable changes do not take effect in already-running containers.
Use this checklist to verify everything is configured correctly before investigating further.
CheckWhat to confirm
Runtime envs savedDATABASE_URL (or your chosen variable name) appears in the project environment settings and has the correct value
App reads DATABASE_URLYour application code reads the connection string from the environment variable at startup, not from a hardcoded string
Database is activeThe database status in Dashboard > Database shows active, not provisioning or errored
Project was redeployedA deployment ran after the environment variable was added — changes only apply to new deployments
Migrations are safeSchema migrations run as part of a controlled startup step or a separate job, not automatically on every container restart
If your application runs migrations automatically on startup, make sure they are idempotent. Running migrations on every restart in a multi-instance deployment can cause race conditions.
For the complete database setup flow — including provisioning, connection string formats, and backups — see the Database documentation.