What a deployed application needs #
On this page
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 gives the zip's contents and limits, and Node.js Runtime 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. 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.
The manifest #
The manifest requires manifest_version, services, region, egress, audience and packages; a server's manifest also declares health. The manifest describes each member.
Settings your code reads #
A 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 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). A value that is not secret, such as a site title, is written there as {"value": "<text>"} (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 gives the files, limits and recovery steps. Add a database 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 and records in a database.
If sleep when idle 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 gives the timing of the first request after a stop.
Related #
Deploy from your computer walks through a first deploy. Bring an existing application checks code written for another host against these needs.