# Deploy Express

Express is detected from your `package.json` and runs as a Node.js container on port `8080`. No Dockerfile needed - one is [generated](/platform/deployments/builds#dockerfiles-generated-or-your-own) on Node 22, installing with your lockfile's package manager.

## Serve it

Listen on the routed [port](/create/build-settings#port) - `PORT` is set to it:

```js
const app = require('express')();

app.listen(process.env.PORT || 8080, () => {
  console.log('up');
});
```

`app.listen` binds all interfaces by default - correct for containers. Log with `console.log`/`console.error`; both land in [runtime logs](/platform/observability#runtime-logs).

## Configuration and database

Read [environment variables](/platform/environment-variables#build-time-and-runtime) from `process.env` at startup. For a database, set `DATABASE_URL` from the [Credentials tab](/platform/databases/connect) - pg, mysql2, Prisma, and Drizzle all take it. Connect lazily so [cold starts](/create/scaling#cold-starts) stay short.

## Scaling

Defaults fit a typical I/O-bound API: [concurrency](/create/scaling#concurrency) 80, [scale to zero](/create/scaling#min-instances) when idle. Set min instances to `1` on production if the first request after quiet must be fast.

## Related

- [Connect an app](/platform/databases/connect): DATABASE_URL, TLS, per-environment databases.
- [Builds](/platform/deployments/builds): The generated Node image, step by step.
- [Scaling](/create/scaling): Instances, concurrency, CPU target.
