Environment Variables
PromptShip automatically injects these variables into every web app process at deploy time. You don't need to set them.
These apply to web apps only. Android apps are built and submitted to the Play Store — they don't have a running container and don't receive these variables. For user-defined secrets, see Secrets.
| Variable | When | Description |
|---|---|---|
PORT |
Always | The port your app must listen on. Bind to 0.0.0.0:$PORT, not localhost. |
DATABASE_URL |
When Postgres attached | PostgreSQL connection string. Format: postgresql://user:pass@host:5432/dbname |
REDIS_URL |
When Valkey attached | Redis-compatible connection string. Format: redis://:pass@host:6379 |
VALKEY_URL |
When Valkey attached | Same as REDIS_URL. Use whichever your library expects. |
CLICKHOUSE_URL |
When ClickHouse attached | ClickHouse connection string. Format: clickhouse://user:pass@host:8123/dbname (HTTP interface, port 8123). |
CLICKHOUSE_NATIVE_URL |
When ClickHouse attached | Same credentials and database, but pointed at the native protocol on port 9000. Use with libraries that speak the native protocol (e.g. clickhouse-driver). |
WEB_CONCURRENCY |
Web processes | Auto-tuned worker count based on CPU tier. Read natively by gunicorn, uvicorn, and Next.js. |
GOMAXPROCS |
Web processes | Go runtime thread limit, matched to CPU tier. Prevents container CPU oversubscription. |
UV_THREADPOOL_SIZE |
Web processes | Node.js libuv I/O thread pool size, matched to CPU tier. |
PROCESS_TYPE |
Always | The process type: web, worker, or cron. |
PROCESS_NAME |
Always | The name of the process (e.g. web, worker, digest). |
You can see which variables will be injected for a given environment by calling get_app. The response includes platform_env_vars per environment.
PORT
Every web app must listen on the PORT environment variable. The platform routes HTTPS traffic to this port inside your container.
Python (Flask)
import os
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 8080)))
Python (gunicorn)
gunicorn --bind 0.0.0.0:$PORT app:app
Node.js
const port = process.env.PORT || 8080;
app.listen(port, '0.0.0.0');
Go
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
http.ListenAndServe(":"+port, nil)
DATABASE_URL
Injected after attaching Postgres with attach_postgres. Available on the next deploy.
Standard PostgreSQL connection string format. Most ORMs and database libraries accept it directly:
Python (SQLAlchemy)
import os
from sqlalchemy import create_engine
engine = create_engine(os.environ['DATABASE_URL'])
Node.js (pg)
const { Pool } = require('pg');
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
Go
db, err := sql.Open("postgres", os.Getenv("DATABASE_URL"))
REDIS_URL / VALKEY_URL
Injected after attaching Valkey with attach_valkey. Both contain the same connection string. Available on the next deploy.
Python (redis-py)
import os
import redis
r = redis.from_url(os.environ['REDIS_URL'])
Node.js (ioredis)
const Redis = require('ioredis');
const client = new Redis(process.env.REDIS_URL);
CLICKHOUSE_URL / CLICKHOUSE_NATIVE_URL
Injected after attaching ClickHouse with attach_clickhouse. Both variables point at the same database with the same credentials, but on different protocols. Available on the next deploy.
CLICKHOUSE_URL— HTTP interface (port 8123). Use with HTTP clients likeclickhouse-connect(Python) or@clickhouse/client(Node).CLICKHOUSE_NATIVE_URL— native protocol (port 9000). Use with native clients likeclickhouse-driver(Python) or the Go/Rust drivers.
Python (clickhouse-connect, HTTP)
import os
from urllib.parse import urlparse
import clickhouse_connect
u = urlparse(os.environ['CLICKHOUSE_URL'])
client = clickhouse_connect.get_client(
host=u.hostname, port=u.port or 8123,
username=u.username, password=u.password or '',
database=u.path.lstrip('/'),
)
Python (clickhouse-driver, native)
import os
from clickhouse_driver import Client
client = Client.from_url(os.environ['CLICKHOUSE_NATIVE_URL'])
Node.js (@clickhouse/client, HTTP)
const { createClient } = require('@clickhouse/client');
const client = createClient({ url: process.env.CLICKHOUSE_URL });