This tiny deployment wrapper runs the official eceasy/cli-proxy-api:latest image
on Back4app Containers and uses CLIProxyAPI's native PostgreSQL store for
persistent config and OAuth credentials.
No custom sync daemon is required.
- Sign up at Neon.
- Create a project/database.
- Copy the pooled PostgreSQL connection string.
- Make sure it ends with (or otherwise enables)
sslmode=require.
Example only:
postgresql://user:password@ep-example-pooler.us-east-2.aws.neon.tech/neondb?sslmode=require
Never commit the real DSN to GitHub.
The repository only needs:
Dockerfile
start.sh
README.md
There are no secrets in the repository.
In Back4app:
- Build new app / New App
- Containers / Web Deployment
- Connect GitHub
- Select this repository
- Use the Free plan
- Set the service port to 8317 if Back4app asks for it.
Add these environment variables:
PGSTORE_DSN=<your Neon pooled connection string>
PGSTORE_SCHEMA=public
PGSTORE_LOCAL_PATH=/tmp/cpa
MANAGEMENT_PASSWORD=<a long random secret>
PROXY_API_KEY=<another long random secret>
Use different values for MANAGEMENT_PASSWORD and PROXY_API_KEY.
For PROXY_API_KEY, use a 32-byte/64-character hex string. For example:
openssl rand -hex 32The wrapper intentionally restricts this key to letters, digits, ., _, and -
so it can be inserted into YAML safely.
After the deployment is ready, Back4app gives you an HTTPS URL similar to:
https://your-app-name.b4a.run
Open the management UI:
https://your-app-name.b4a.run/management.html
Log in with MANAGEMENT_PASSWORD.
Your API base URL is:
https://your-app-name.b4a.run/v1
Your client API key is PROXY_API_KEY.
Use the management UI's OAuth page for Codex, Claude, Antigravity, etc.
CLIProxyAPI writes the resulting auth records to its native PostgreSQL store.
The local /tmp/cpa/... files are only an ephemeral mirror.
When Back4app replaces/restarts the container, CLIProxyAPI restores the config and auth records from Neon.
- Use one Back4app replica only. CLIProxyAPI's PostgreSQL backend is not meant to synchronize the same OAuth credential across multiple live replicas.
- Keep
PGSTORE_DSN,MANAGEMENT_PASSWORD, andPROXY_API_KEYonly in Back4app environment variables. - A fresh Neon project is easiest for the first deployment.
- If a previous failed CPA deployment already seeded an unsafe example config
into the database, delete that Neon project and create a fresh one, or delete
the
configrow frompublic.config_storebefore retrying. - Back4app Free currently has tight RAM/CPU limits. If the container reports OOM, reduce concurrency/providers; persistence is not the cause.