DockHostingDocs
Deploying

Variables

Set your app's environment variables, see the ones we add, and apply changes with a redeploy.

Variables are how your app gets its settings and secrets: API keys, FRONTEND_URL, APP_ENV… They're stored encrypted and given to your app as environment variables.

Set variables

Open your project, then the Variables tab. Add a key and a value, or paste a whole .env file: we split it into variables.

app.dockhosting.dev/dashboard/projects/…/env
The Variables tab of a project

Changes need a redeploy

A running app keeps the variables it started with. After a change, the page offers Redeploy so the app picks it up.

From the terminal:

dock env set API_KEY=abc123 FRONTEND_URL=https://my-app.dockhosting.cloud
dock env set STRIPE_SECRET   # no value: type or pipe it, so it stays out of your shell history
dock env unset OLD_KEY
dock env                     # the names (never the values)

The variables we add

We add these when your app doesn't set them itself. Your own value always wins.

VariableWhat it isExample
PORTThe port your app must listen on3000 (Node), 5000 (Python), 8080 (PHP, Go)
HOSTListen on all interfaces0.0.0.0
APP_URLYour app's public addresshttps://my-app.dockhosting.cloud
HTTPSThe app is served over HTTPSon
TRUSTED_PROXIESTrust our edge's forwarded headers*
DATABASE_URLLinked database's connection URLpostgresql://user:pass@host:5432/db
DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD, DB_CONNECTIONLinked SQL database, Laravel-stylepgsql or mysql
MONGODB_URI, MONGO_URI, MONGO_URLLinked MongoDBmongodb://…
REDIS_URLLinked Redis or Valkeyredis://…

One exception: Laravel with SQLite

If your Laravel .env says DB_CONNECTION=sqlite and you link a SQL database, the database's settings replace the SQLite ones. Otherwise writes would go to a read-only file and fail.

Laravel defaults

For Laravel apps we also set APP_ENV=production, APP_DEBUG=false, SESSION_DRIVER=file, CACHE_STORE=file and QUEUE_CONNECTION=sync when they're missing, and generate an APP_KEY if you have none. Set your own APP_KEY so sessions survive redeploys.

Common mistakes

On this page