Deno Deploy deployment workflows - use when user says "deploy to deno deploy", "push to deno deploy", "ship to deno deploy", or asks about deploying Deno apps to Deno Deploy
This skill provides guidance for deploying applications to Deno Deploy.
deno deploy, NOT deployctlAlways use the deno deploy command. Do NOT use deployctl.
deployctl is for Deno Deploy Classic (deprecated)deno deploy is the modern, integrated command built into the Deno CLIdeployctl, stop and use deno deploy insteaddeno deploy subcommand was introduced in Deno 2.4When a user asks to deploy to Deno Deploy, follow this decision tree:
Before running any checks, find where the Deno app is located:
# Check if deno.json exists in current directory
if [ -f "deno.json" ] || [ -f "deno.jsonc" ]; then
echo "APP_DIR: $(pwd)"
else
# Look for deno.json in immediate subdirectories
find . -maxdepth 2 -name "deno.json" -o -name "deno.jsonc" 2>/dev/null | head -5
fi
Decision:
deno.json is in the current directory → use current directorydeno.json found in a subdirectory → use that subdirectory (if multiple found, ask user which one)deno.json found → ask user where their app is locatedAll subsequent commands must run from the app directory. Either cd to it or use absolute paths.
CRITICAL: Run these checks BEFORE attempting any deno deploy commands. Many deploy CLI commands (including deno deploy orgs) fail without an org already configured - you cannot discover orgs via CLI.
# Check Deno version
deno --version | head -1
# Check for existing deploy config WITH org
grep -E '"org"|"app"' deno.json deno.jsonc 2>/dev/null || echo "NO_DEPLOY_CONFIG"
# Detect framework
if [ -d "islands" ] || [ -f "fresh.config.ts" ]; then echo "Framework: Fresh"; \
elif [ -f "astro.config.mjs" ] || [ -f "astro.config.ts" ]; then echo "Framework: Astro"; \
elif [ -f "next.config.js" ] || [ -f "next.config.mjs" ]; then echo "Framework: Next.js"; \
elif [ -f "nuxt.config.ts" ]; then echo "Framework: Nuxt"; \
elif [ -f "remix.config.js" ]; then echo "Framework: Remix"; \
elif [ -f "svelte.config.js" ]; then echo "Framework: SvelteKit"; \
elif [ -f "_config.ts" ]; then echo "Framework: Lume (check imports)"; \
else echo "Framework: Custom/Unknown"; fi
If deploy.org AND deploy.app exist in config:
deno deploy --prodIf NO deploy config exists (no org/app found):
⚠️ DO NOT run deno deploy or deno deploy orgs - they will fail with "No organization was selected" error.
First, ask the user for their org name:
"What is your Deno Deploy organization name? You can find it by visiting https://console.deno.com - look at the URL, it will be something like
console.deno.com/YOUR-ORG-NAME. For personal accounts, this is usually your username."
Once you have the org name, run the create command yourself:
deno deploy create --org <ORG_NAME>After the command completes, verify:
grep -E '"org"|"app"' deno.json deno.jsonc
| Error | Agent Response |
|---|---|
| "No organization was selected" | You hit this because you didn't check config first. Ask user for org name (see Step 2). |
| "No entrypoint found" | Look for main.ts, mod.ts, src/main.ts, server.ts - suggest --entrypoint flag |
| "authorization required" | Token expired/missing - guide user to re-authenticate or set up CI/CD token |
| "Minimum Deno version required" | User needs to upgrade Deno: deno upgrade |
These commands will error if no org is configured - do not try them to "discover" orgs:
deno deploy (without --org flag)deno deploy orgsdeno deploy switchdeno deploy env listdeno deploy logsThe first time you run deno deploy, it will open a browser for authentication:
deno deploy
# Opens: https://console.deno.com/auth?code=XXXX-XXXX
Important - Browser Device Authorization Flow:
For Claude: When running deno deploy commands, prompt the user:
"Please complete the authorization in your browser, then let me know when you're done."
To deploy without browser interaction (for CI/CD pipelines or automated workflows):
Create a Deploy Token in the web UI:
Use the token:
# 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
For GitHub Actions:
- name: Deploy to Deno Deploy
env:
DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }}
run: deno deploy --prod
For Claude: If the user wants fully automated deploys without browser prompts, ask:
"Do you have a Deno Deploy access token set up? If not, you can create one at https://console.deno.com/account/access-tokens, then set it as the
DENO_DEPLOY_TOKENenvironment 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 by looking for a deploy key in deno.json:
cat deno.json | grep -A5 '"deploy"'
If no deploy config exists, create an app:
deno deploy create --org your-org-name
This opens a browser to create the app. Important:
<app-name>.deno.devFor Claude: Prompt the user:
"Please complete the app creation in your browser, then let me know when done."
Verifying Success: The CLI output may not clearly indicate success. After the user confirms completion, verify by checking deno.json:
cat deno.json | grep -A5 '"deploy"'
You should see output like:
"deploy": {
"org": "your-org-name",
"app": "your-app-name"
}
If the deploy key exists with org and app values, the app was created successfully.
Before your first deployment, create an app:
deno deploy create --org <organization-name>
This opens a browser to create the app in the Deno Deploy console. The app name becomes your URL: <app-name>.deno.dev
Note: The create command does NOT accept --prod. Use --prod only with deno deploy (the deploy command itself).
Some deno deploy commands are interactive and cannot be run through Claude's Bash tool. For these, ask the user to run them in their own terminal:
deno deploy switch
This opens an interactive menu to select org and app. Claude cannot run this - ask the user:
"Please run
deno deploy switchin your terminal to select your organization and app. Let me know when you've completed the selection."
Instead of interactive selection, specify org/app directly:
deno deploy --org your-org-name --app your-app-name --prod
This bypasses the interactive flow and works through Claude.
deno deploy --prod
Verifying Deployment Success: The CLI output can be verbose. Look for these indicators of success:
.deno.dev or .deno.net - this is your live deploymenthttps://console.deno.com/<org>/<app>/builds/<id>After deployment, confirm success by extracting the production URL from the output. The format is typically:
https://<app-name>.<org>.deno.net or https://<app-name>.deno.dev
deno deploy
Preview deployments create a unique URL for testing without affecting production.
deno deploy --org my-org --app my-app --prod
If Deno Deploy can't find your main file:
deno deploy --entrypoint main.ts --prod
Or add to deno.json:
{
"deploy": {
"entrypoint": "main.ts"
}
}
For static sites (Lume, Vite builds, etc.), you have two options:
Point Deno Deploy at your built directory. Configure in deno.json:
{
"deploy": {
"entrypoint": "main.ts",
"include": ["_site"]
}
}
Only needed if you want custom routing, headers, or logic:
// serve.ts
import { serveDir } from "jsr:@std/http/file-server";
Deno.serve((req) =>
serveDir(req, {
fsRoot: "_site",
quiet: true,
})
);
Then deploy with:
deno deploy --entrypoint serve.ts --prod
deno deploy env add DATABASE_URL "postgres://..."
deno deploy env list
deno deploy env delete DATABASE_URL
deno deploy env load .env.production
Variables can apply to different environments:
# Set which contexts a variable applies to
deno deploy env update-contexts API_KEY Production Preview
Available contexts: Production, Preview, Local, Build
deno deploy logs
deno deploy logs --start 2026-01-15 --end 2026-01-16
deno deploy setup-aws --org my-org --app my-app
deno deploy setup-gcp --org my-org --app my-app
Deno Deploy supports multiple frameworks. The CLI auto-detects your framework and configures the build appropriately.
| Framework | Detection Files | Build Command | Notes |
|---|---|---|---|
| Fresh | islands/, fresh.config.ts |
deno task build |
Deno-native, island architecture |
| Astro | astro.config.mjs, astro.config.ts |
npm run build or deno task build |
Static or SSR |
| Next.js | next.config.js, next.config.mjs |
npm run build |
Requires nodeModulesDir: "auto" |
| Nuxt | nuxt.config.ts |
npm run build |
Vue SSR framework |
| Remix | remix.config.js |
npm run build |
React SSR framework |
| SolidStart | app.config.ts with solid |
npm run build |
SolidJS SSR |
| SvelteKit | svelte.config.js |
npm run build |
Svelte SSR framework |
| Lume | _config.ts with lume import |
deno task build |
Deno-native static site |
deno task build
deno deploy --prod
# If using npm
npm run build
deno deploy --prod
# If using Deno tasks
deno task build
deno deploy --prod
Next.js requires Node.js compatibility mode:
Ensure deno.json has:
{
"nodeModulesDir": "auto"
}
Build and deploy:
npm install
npm run build
deno deploy --prod --allow-node-modules
These npm-based frameworks follow a similar pattern:
npm install
npm run build
deno deploy --prod
If you encounter issues with node_modules:
deno deploy --prod --allow-node-modules
deno task build
deno deploy --prod
For custom servers or apps without a recognized framework:
main.ts, server.ts)deno deploy --entrypoint main.ts --prod
| Command | Purpose |
|---|---|
deno deploy --prod |
Production deployment |
deno deploy |
Preview deployment |
deno deploy create --org <name> |
Create new app |
deno deploy env add <var> <value> |
Add environment variable |
deno deploy env list |
List environment variables |
deno deploy env delete <var> |
Delete environment variable |
deno deploy env load <file> |
Load vars from .env file |
deno deploy env update-contexts <var> [contexts] |
Set variable contexts |
deno deploy logs |
View deployment logs |
deno deploy setup-aws |
Configure AWS integration |
deno deploy setup-gcp |
Configure GCP integration |
This error occurs because the CLI needs an organization context. Unfortunately, commands like deno deploy orgs also fail without this context.
Solution:
Find your org name manually: Visit https://console.deno.com - your org is in the URL path (e.g., console.deno.com/donjo means org is donjo)
Specify org explicitly:
deno deploy --org your-org-name --prod
Or create an app with org:
deno deploy create --org your-org-name
# Complete the browser flow when prompted
For Claude: When you see this error, ask the user:
"What is your Deno Deploy organization name? You can find it by visiting console.deno.com - look at the URL, it will be something like
console.deno.com/your-org-name."
Specify your entry file:
deno deploy --entrypoint main.ts --prod
Or add to deno.json:
{
"deploy": {
"entrypoint": "main.ts"
}
}
Fresh 2.0 requires building before deployment:
deno task build
deno deploy --prod
Check what's currently set:
deno deploy env list
Add missing variables:
deno deploy env add MISSING_VAR "value"
Deno Deploy runs on the edge (globally distributed). Keep in mind:
deno deploy env, not .env files at runtime