# Deploy AdonisJS

AdonisJS is detected from your `package.json` and runs as a Node.js container on port `3333`. The [generated image](/platform/deployments/builds#dockerfiles-generated-or-your-own) runs your `build` script and starts the compiled server from `build/` on Node 22.

## Serve it

Adonis reads `HOST` and `PORT` from the environment. `PORT` is set for you; set `HOST` in the app's [environment variables](/platform/environment-variables):

```
HOST=0.0.0.0
APP_KEY=<generate one>
NODE_ENV=production
```

`APP_KEY` (from `node ace generate:key`) is required in production.

## Database

Set `DATABASE_URL`, or Lucid's discrete `DB_*` variables, from the [Credentials tab](/platform/databases/connect). Migrations run where the database is reachable:

```bash
node ace migration:run --force
```

## Scaling

Defaults fit a typical API - [concurrency](/create/scaling#concurrency) 80, [scale to zero](/create/scaling#min-instances) when idle.

## Related

- [Connect an app](/platform/databases/connect): DATABASE_URL, TLS, per-environment databases.
- [Environment variables](/platform/environment-variables): Where HOST, PORT, and APP_KEY live.
- [Builds](/platform/deployments/builds): The generated Node image, step by step.
