DATABASE_URL before you deploy. Akter does not provision a database or charge for its storage. You pay your database provider separately from Akter’s compute bill.
If you do not have a database yet, start with Choose a Postgres. Use a separate database and role for each environment that must have isolated data: creating production, staging or dev in Akter does not create or isolate a database for you.
Connection requirements
YourDATABASE_URL must meet these rules:
- Use
postgres://orpostgresql://with a host, no fragment, and no raw whitespace or control characters. Percent-encode special characters in the username and password. - Use a direct, non-pooled connection to the writable database. Transaction-pooler URLs are refused: the runtime requires session semantics, including state that must remain on the same Postgres session. Do not use Neon’s
-poolerendpoint, Supabase’s transaction pooler or PlanetScale’s PgBouncer port. - Include exactly one
sslmodequery parameter, set torequire,verify-caorverify-full. Missing, repeated or other values, includingdisable,preferandno-verify, are refused. - The server certificate must chain to a public certificate authority and match the URL’s host name. Akter checks both for all three accepted
sslmodevalues; useverify-full. A custom root certificate in the URL (sslrootcert) is not used. An endpoint requiring a private or provider-specific CA needs additional trust support; see the RDS caveat. - The login must be able to create and alter the app’s tables. Migrations use the same connection; insufficient permissions fail the deployment at its
migratestep.
Set the connection and deploy
- Create a database and an app role with migration permissions, then copy its direct connection URL.
- Save only the URL in a secure local file outside your deployment directory, for example
../database-url.txt. Do not include quotes or a trailing newline, commit the file, or put the secret in a command argument. The URL looks like this, with your own values:
- From your app directory, replace
PROJECT_IDwith your project’s ID and set the variable for the environment you will deploy:
npx akter instead of bunx akter. Invalid values are refused without echoing the URL. See environment variables for file/stdin input and naming rules.
Deploy-time checks
At deploy, Akter probes your database from the runner region, Flyiad in Northern Virginia, near AWS us-east-1. Choose a database in us-east-1 to keep the network path short. If the measured p50 latency is above 5 ms, Akter warns but still deploys; latency alone is not a refusal. A missing or unreachable database, invalid URL or transaction-pooler connection must be corrected before deployment can proceed.
The probe also budgets database connections. The database-derived runner cap is:
max_connections is the server’s connection limit and in_use is its current usage. Akter reserves 10 connections and budgets 9 per runner. For example, a limit of 100 with 17 connections in use leaves a cap of 8 runners. A cap of zero leaves no room for a runner; reduce competing connections or increase your database’s capacity.
This is a connection ceiling, not a throughput guarantee. Akter handles runner orchestration, but your Postgres capacity and latency still bound the app’s scale.
Change or remove the connection
The URL is encrypted at rest and write-only. A deployment captures its environment variables, includingDATABASE_URL; changing the URL affects the next deployment, not one already running. Akter does not copy data to the replacement database. Rollback uses the selected deployment’s captured connection and does not undo schema or data changes, so keep migrations compatible with both releases.
You can remove DATABASE_URL on every plan:
DATABASE_URL again. Akter does not create a fallback database, and changing plans does not remove the requirement.