---
title: What a deployed application needs
description: What your application's code and files must provide to deploy and run: the port, the start, the health path, the database settings, and where data lasts.
slug: /concepts/what-a-deployed-application-needs
order: 3
visibility: public
redirects_from: []
---

# What a deployed application needs

This page lists, in one place, what the platform needs from your application's code and files. Each section names the page that gives the detail.

## The server

Your server listens on the port in `PORT`, which the platform's image sets to 8080. The manifest cannot set `PORT`.

The platform starts the application with `npm start`. Put `package.json` at the top of your deploy folder. Add a `scripts.start` entry or put a `server.js` file beside it. The application runs on Node.js 24, whatever its `engines` field says.

[What the deploy zip holds](/cloud/concepts/what-the-deploy-zip-holds/) gives the zip's contents and limits, and [Node.js Runtime](/cloud/backend-packages/nodejs-runtime/#what-an-application-must-do) what the running server must do.

## The health path

For a server, the manifest's `health` member names an absolute path that answers 200. Turn Zero requests it every 3 seconds for up to 180 seconds on a deploy, promote, rollback, restart, or [platform redeploy](/cloud/concepts/glossary/#platform-redeploy). Three 200 answers in a row pass the check, and no redirect is followed.

If no version serves yet, the deploy can refuse `health_path_unserved` when no source file names the last part of the health path. Finding the name only passes the source scan. Your running server still needs to answer that path. See [The deploy health check](/cloud/concepts/the-deploy-health-check/).

## The manifest

The manifest requires `manifest_version`, `services`, `region`, `egress`, `audience` and `packages`; a server's manifest also declares `health`. [The manifest](/cloud/concepts/the-manifest/) describes each member.

## Settings your code reads

A [running copy](/cloud/concepts/glossary/#running-copy) receives the platform's own settings, such as `TURNZERO_CLOUD_API` and `TURNZERO_CLOUD_APP_TOKEN`, as environment variables. [A deployed app's settings](/cloud/concepts/the-settings-a-deployed-copy-receives/) lists each one.

Your own settings come from the manifest's `settings` member. A secret is stored with `store_secret` and bound there by its stored name ([Store a secret](/cloud/getting-started/store-a-secret/)). A value that is not secret, such as a site title, is written there as `{"value": "<text>"}` ([Set a value that is not secret](/cloud/guides/author-the-manifest/#set-a-value-that-is-not-secret)).

## A database

Where the manifest declares a database, a server receives `APP_DATABASE_URL` for its pool, `APP_DATABASE_DIRECT_URL` for work that needs one server session, and `APP_DATABASE_CONNECTION_LIMIT` for the pool's maximum. A function environment receives `APP_DATABASE_URL` alone. It uses pooler port 6432 on a shared database and direct port 5432 on a dedicated database.

The schema lives as ordered `.sql` files in the application's `migrations/` folder. A server's start code applies them before it listens. For a serverless application, the platform applies the files before the version serves at deploy, promote and rollback. [Serverless migrations](/cloud/guides/add-a-database/#serverless-migrations) gives the files, limits and recovery steps. [Add a database](/cloud/guides/add-a-database/#4-keep-the-schema-as-migrations) shows both ways to apply them: the Database package, or code of your own on the `pg` driver.

## Where data lasts: the local file system does not persist

Anything the code writes to the copy's disk, `/tmp` and its home folder included, is lost when the copy is replaced or stops. That happens at a deploy, a promote, a rollback, a restart, and an idle stop, and whenever the platform replaces a copy. Keep files in a [storage area](/cloud/guides/store-files/) and records in a database.

If [sleep when idle](/cloud/guides/plan-and-usage/#2-change-the-size) is on, Turn Zero stops the production copy after 30 minutes without a request. The next request, scheduled run, or deploy starts it again. The stop touches only the copy: the database and its data, stored files, and stored secrets stay as they are. [How the sizes differ technically](/cloud/concepts/how-the-plans-differ-technically/#start-after-idle-and-response-time) gives the timing of the first request after a stop.

## Related

[Deploy from your computer](/cloud/getting-started/deploy-an-application/) walks through a first deploy. [Bring an existing application](/cloud/guides/bring-an-existing-application/) checks code written for another host against these needs.
