Create a Database
--cpu, --memory, --database, or --username to customize it.
To supply a password, use --password-from-env VARIABLE_NAME or --password-stdin.
Databases are also available in the dashboard and through MCP’s create_database tool.
Connect an App
Pass the database URL as an environment reference:env:
connect_services. Both deploy a new version.
Connect from Your Machine
Print a connection command for Postgres or Redis:psql or redis-cli installed. The output contains credentials.
For other clients, use beam db KIND credentials NAME. Redis also supports connect --node-redis and --ioredis for TLS connection examples.
Serverless or Always On
Databases shut down after 300 idle seconds by default. To avoid cold starts, keep one replica running:--min-replicas 1 at creation for always-on mode. Each database has one writable replica; clients should reconnect after restarts or resource changes.
Credentials and Lifecycle
beam db postgres delete web-db deletes the service and credentials, but keeps the durable disk. Use beam disk list to find it. See disk snapshots for backups.