The deploy command applies a neon.ts policy to a branch. It is a top-level alias of neon config apply, with the same options.
neon deploy [options]
Option
Description
Type
Default
Required
--allow-protected
Apply to a branch marked protected on Neon without asking
boolean
false
No
--branch
Branch ID or name
string
—
No
--config
Path to a neon.ts policy (defaults to the neon.ts next to .neon, or in cwd without one)
string
—
No
--env
Path to a .env file to load into the environment before evaluating neon.ts so Function env values resolve from it. Existing env vars are not overridden. Required Function env (declared required: true, or required: "default-branch" when deploying the default branch) and values that read process.env must be set in this file or the environment.
string
—
No
--env-pull
Pull the branch's Neon env vars (DATABASE_URL, …) into a local .env after a successful apply. On by default; use --no-env-pull to skip (e.g. when injecting env at runtime with neon-env run / neon dev).
boolean
true
No
--project-id
Project ID
string
—
No
--update-existing
Override branch settings that differ from neon.ts without asking
boolean
false
No
--yes, -y
Answer yes to every confirmation: --update-existing and --allow-protected
boolean
false
No
In a terminal, deploy asks before it overrides branch settings that differ from neon.ts or applies to a branch marked protected on Neon. Declining applies nothing.
If neon.ts declares Realtime under preview.realtime, neon deploy enables it on the branch, and the default env pull waits until it's ready and writes NEON_REALTIME_URL and NEON_REALTIME_SECRET.
Without a terminal, there's no prompt. This covers CI, runs with no TTY, and -o json or -o yaml output. In those cases, deploy stops before changing anything and names the flag to re-run with. For scripts, CI, and agents, pass --update-existing to allow the overrides, --allow-protected to allow a protected branch, or -y for both: