Subchapter 1.1
references/AUTHENTICATION.mdMarkdown5 KBView on GitHub
The first time you run deno deploy, it will open a browser for authentication:
deno deploy
# Opens: https://console.deno.com/auth?code=XXXX-XXXXImportant - Browser Device Authorization Flow:
Note: When running deno deploy commands that require authentication, the
user must complete the browser authorization before the deployment can proceed.
To deploy without browser interaction (for CI/CD pipelines or automated workflows):
# Option 1: Environment variable (recommended for CI/CD)
export DENO_DEPLOY_TOKEN="your-token-here"
deno deploy --prod
# Option 2: Inline flag (for one-off commands)
deno deploy --token "your-token-here" --prod- name: Deploy to Deno Deploy
env:
DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }}
run: deno deploy --prodIf the app doesn’t exist yet, create it first in CI/CD using non-interactive flags:
- name: Create and deploy app
env:
DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }}
run: |
deno deploy create \
--org my-org --app my-app \
--source local \
--runtime-mode dynamic --entrypoint main.ts \
--build-timeout 10 --build-memory-limit 2048 --region usAfter the app is created, subsequent deploys only need deno deploy --prod.
Tip: For fully automated deploys without browser prompts, ensure a Deno
Deploy access token is set up. Create one at
https://console.deno.com/account/access-tokens (opens in a new tab), then set it as the
DENO_DEPLOY_TOKEN environment variable.
The Deno Deploy CLI requires an organization context for most operations. To find your org name:
console.deno.com/YOUR-ORG-NAMENote: Commands like deno deploy orgs and deno deploy switch require an
existing org context to work - this is a CLI limitation. Always find your org
name from the console URL first.
Before creating: Check if an app already exists:
cat deno.json | grep -A5 '"deploy"'If no deploy config exists, you need to create the app first. Apps must be created before they can be deployed to.
Interactive creation (opens a browser):
deno deploy create --org your-org-nameThis opens a browser to create the app. Important:
<app-name>.deno.devNon-interactive creation (for AI agents and CI/CD — no browser needed):
deno deploy create \
--org your-org-name \
--app your-app-name \
--source local \
--runtime-mode dynamic \
--entrypoint main.ts \
--build-timeout 5 \
--build-memory-limit 1024 \
--region usThis creates the app and does the initial deploy in one step. No browser
interaction required. See the main skill doc for the full list of create
flags.
Verifying Success: After completion, verify by checking deno.json:
cat deno.json | grep -A5 '"deploy"'You should see:
"deploy": {
"org": "your-org-name",
"app": "your-app-name"
}After this, subsequent deploys only need:
deno deploy --prodSome deno deploy commands are interactive and cannot be run through automated
tools.
deno deploy switchThis opens an interactive menu to select org and app.
Alternative - Use Explicit Flags:
Instead of interactive selection, specify org/app directly:
deno deploy --org your-org-name --app your-app-name --prodThis bypasses the interactive flow.
These commands will error if no org is configured:
deno deploy (without --org flag)deno deploy orgsdeno deploy switchdeno deploy env listdeno deploy logsAlways ensure org context is set via deno.json or --org flag before running these commands.