On this page
deno deploy
deno deploy [OPTIONS] [args]...The deno deploy command provides a command line interface for managing and
deploying applications to Deno Deploy EA, Deno's
platform for hosting JavaScript, TypeScript, and WebAssembly applications.
When called without any subcommands, deno deploy will deploy your local
directory to the specified application.
Authentication Jump to heading
The deploy command uses secure token-based authentication stored in your system's keyring:
- Automatic Authentication: The CLI will prompt for authentication when needed
- Token Storage: Deploy tokens are securely stored using the system keyring
- Token Management: The CLI provides operations to get, set, and delete authentication tokens.
Global options Jump to heading
-h, --help- Show help information--org <name>- Specify the organization name--app <name>- Specify the application name--prod- Deploy directly to production
Subcommands Jump to heading
Create application Jump to heading
Creates a new application in Deno Deploy. When run without flags, an interactive wizard walks you through each step. When any configuration flag is provided, the command runs in non-interactive mode (useful for CI/CD pipelines and scripting).
deno deploy create [root-path]
The optional [root-path] argument sets the local project directory. Defaults
to the current working directory.
General options Jump to heading
-h, --help- Show help information--org <name>- The organization to create the app in--app <name>- The application name (used in the default URL)--allow-node-modules- Includenode_moduleswhen uploading--no-wait- Skip waiting for the first build to complete--dry-run- Validate flags and run through the flow without actually creating anything
Source options Jump to heading
These flags control where the app code comes from:
--source <github|local>- Deploy from a GitHub repo or the local filesystem--owner <name>- GitHub owner/organization (required when source isgithub)--repo <name>- GitHub repository name (required when source isgithub)
Build configuration options Jump to heading
--app-directory <path>- Path to the app directory within the project--framework-preset <preset>- Use a framework preset for build defaults. Supported values:astro,nextjs,nuxt,remix,solidstart,sveltekit,fresh,lume, or""(none)--do-not-use-detected-build-config- Skip auto-detected build settings and use only the provided flags--install-command <command>- Install command (e.g."deno install")--build-command <command>- Build command (e.g."deno task build")--pre-deploy-command <command>- Command to run after building but before deploying
Runtime mode options Jump to heading
--runtime-mode <dynamic|static>- Whether the app runs as a server or a static site
Dynamic mode (server):
--entrypoint <file>- The entrypoint file (e.g.main.ts)--arguments <arg>- Arguments passed to the entrypoint (can be specified multiple times)--working-directory <path>- Working directory for the process
Static mode (static site):
--static-dir <dir>- Directory containing the static files to serve--single-page-app- Serveindex.htmlfor routes that don't match a file (instead of returning 404)
Build resource options Jump to heading
--build-timeout <minutes>- Build timeout. Allowed values:5,10,15,20,25,30--build-memory-limit <megabytes>- Build memory limit in MB. Allowed values:1024,2048,3072,4096--region <region>- Deployment region. Allowed values:us,eu,global
Interactive wizard Jump to heading
When you run deno deploy create without flags, an interactive wizard guides
you through each configuration step:
- Organization - Select which org to create the app in
- App name - Choose a name for your app
- Source - Deploy from GitHub or a local directory
- GitHub repo (if source is GitHub) - Select the owner and repo
- App directory - Pick the directory within your project (auto-detects workspace members)
- Build configuration - Auto-detects framework settings. You can accept the detected config or configure manually (framework preset, install/build commands, runtime mode, etc.)
- Build timeout - How long the build can run
- Build memory limit - How much memory the build gets
- Region - Where to deploy (
us,eu, orglobal) - Confirm - Review and confirm before creating
Examples Jump to heading
Create an app interactively:
deno deploy create
Create a local dynamic app with all flags (non-interactive):
deno deploy create \
--org my-org \
--app my-api \
--source local \
--runtime-mode dynamic \
--entrypoint main.ts \
--install-command "deno install" \
--build-command "deno task build" \
--build-timeout 5 \
--build-memory-limit 1024 \
--region us
Create a static site:
deno deploy create \
--org my-org \
--app my-site \
--source local \
--runtime-mode static \
--static-dir dist \
--single-page-app \
--build-command "deno task build" \
--build-timeout 10 \
--build-memory-limit 2048 \
--region us
Use a framework preset (fewer flags needed since the preset provides defaults):
deno deploy create \
--org my-org \
--app my-fresh-app \
--source local \
--framework-preset fresh \
--build-timeout 5 \
--build-memory-limit 1024 \
--region us
Deploy from a GitHub repo:
deno deploy create \
--org my-org \
--app my-app \
--source github \
--owner my-github-org \
--repo my-repo \
--framework-preset astro \
--build-timeout 10 \
--build-memory-limit 2048 \
--region global
Environment variables management Jump to heading
Manage environment variables for your deployed applications.
deno deploy env
Options:
-h, --help- Show help information--org <name>- The name of the organization--app <name>- The name of the application
List environment variables Jump to heading
deno deploy env list
Lists all environment variables in an application.
Add environment variable Jump to heading
deno deploy env add <variable> <value>
Adds an environment variable to the application.
Options:
--secret- Mark the variable as a secret. Secret values are hidden in the dashboard and inenv listoutput.
deno deploy env add DATABASE_URL "postgresql://user:pass@localhost/db"
# Add a secret environment variable
deno deploy env add API_KEY "sk-secret-value" --secret
Update environment variable value Jump to heading
deno deploy env update-value <variable> <value>
Updates the value of an existing environment variable.
deno deploy env update-value API_KEY "new-api-key-value"
Specifying environment variable contexts Jump to heading
Environment variables can be made available to specific contexts such as Production, Preview, Local, and Build.
deno deploy env update-contexts <variable> [contexts...]
Updates the contexts of an environment variable in the application:
Delete environment variable Jump to heading
deno deploy env delete <variable>
Deletes an environment variable from the application.
deno deploy env delete OLD_API_KEY
Load environment variables from file Jump to heading
deno deploy env load <file>
Loads environment variables from a .env file into the application. The CLI
automatically detects which variables are likely secrets based on their names
(e.g. keys containing SECRET, TOKEN, PASSWORD, etc.) and marks them
accordingly.
Options:
--non-secrets <keys...>- Keys from the.envfile that should be treated as non-secrets, overriding the auto-detection
deno deploy env load .env.production
# Load and treat specific keys as non-secrets
deno deploy env load .env.production --non-secrets PUBLIC_URL SITE_NAME
Database management Jump to heading
Manage database instances for your organization.
deno deploy database
Options:
-h, --help- Show help information--org <name>- The name of the organization
Provision a database Jump to heading
deno deploy database provision <name> --kind <denokv|prisma> [--region <region>]
Creates a new database instance.
Options:
--kind <denokv|prisma>- The type of database to provision (required)--region <region>- The primary region for the database (required for Prisma)
# Provision a Deno KV database
deno deploy database provision my-kv-db --kind denokv
# Provision a Prisma Postgres database
deno deploy database provision my-pg-db --kind prisma --region us-east-1
Link an external database Jump to heading
deno deploy database link <name> [connectionString]
Links an external PostgreSQL database to your organization. You can provide a connection string or use individual flags.
Options:
--hostname <host>- Database hostname (conflicts with connection string)--username <user>- Database username (conflicts with connection string)--password <pass>- Database password (conflicts with connection string)--port <number>- Database port (conflicts with connection string)--cert <cert>- SSL certificate for the connection--dry-run- Test the connection without actually linking
# Link using a connection string
deno deploy database link my-db "postgres://user:pass@host:5432/mydb"
# Link using individual flags
deno deploy database link my-db \
--hostname db.example.com \
--username admin \
--password secret \
--port 5432
# Test the connection first
deno deploy database link my-db "postgres://user:pass@host:5432/mydb" --dry-run
Assign a database to an app Jump to heading
deno deploy database assign <name> [--app <name>]
Assigns a database instance to an application. If --app is not provided, you
will be prompted to select one interactively.
deno deploy database assign my-db --app my-api
Detach a database from an app Jump to heading
deno deploy database detach <name> [--app <name>]
Removes the connection between a database instance and an application.
deno deploy database detach my-db --app my-api
Query a database Jump to heading
deno deploy database query <name> <database> [query...]
Executes a SQL query against a database.
deno deploy database query my-db mydb "SELECT * FROM users LIMIT 10"
List databases Jump to heading
deno deploy database list [search]
Lists all database instances in the organization. Also available as
database ls.
# List all databases
deno deploy database list
# Filter by name
deno deploy database list my-db
Delete a database Jump to heading
deno deploy database delete <name>
Permanently deletes a database instance. Also available as database remove or
database rm.
deno deploy database delete my-old-db
Switch organization and application Jump to heading
Sets the default organization and application for subsequent commands, so you
don't have to pass --org and --app every time.
deno deploy switch [--org <name>] [--app <name>]
When run without flags, an interactive prompt lets you select the org and app.
Options:
--org <name>- The organization to switch to--app <name>- The application to switch to
# Switch interactively
deno deploy switch
# Switch to a specific org and app
deno deploy switch --org my-company --app my-api
Logout Jump to heading
Removes the stored authentication token.
deno deploy logout
Application logs Jump to heading
Stream logs from a deployed application.
deno deploy logs
Options:
-h, --help- Show help information--org <name>- The name of the organization--app <name>- The name of the application--start <date>- The starting timestamp of the logs--end <date>- The ending timestamp of the logs (requires --start)
deno deploy logs --org my-org --app my-app --start "2024-01-01T00:00:00Z"
Sandbox management Jump to heading
Interact with running sandboxes directly from the Deploy CLI.
deno deploy sandbox --help
Options:
-h, --help- Show help information--token <token>- Override the auth token used for sandbox operations--config <path>- Custom path to a Deploy CLI config file--org <name>- Organization that owns the sandboxes
List sandboxes Jump to heading
deno deploy sandbox list --org my-org
Lists every sandbox in the organization along with status details.
Kill a sandbox Jump to heading
deno deploy sandbox kill <sandbox-id> --org my-org
Immediately terminates the specified sandbox when you no longer need it.
SSH into a sandbox Jump to heading
deno deploy sandbox ssh <sandbox-id> --org my-org
Starts an SSH session against a running sandbox for interactive debugging.
Configure cloud connections Jump to heading
The deploy command includes tools to help you configure integrations for use
as Cloud Connections in your
applications.
AWS integration setup Jump to heading
Configure AWS integration for use as a Cloud Connection in your application.
deno deploy setup-aws --org <name> --app <name>
Options:
-h, --help- Show help information--org <name>- The name of the organization (required)--app <name>- The name of the application (required)
deno deploy setup-aws --org my-org --app my-app
Google Cloud Platform integration setup Jump to heading
Configure Google Cloud Platform integration for use as a Cloud Connection in your application.
deno deploy setup-gcp --org <name> --app <name>
Options:
-h, --help- Show help information--org <name>- The name of the organization (required)--app <name>- The name of the application (required)
deno deploy setup-gcp --org my-org --app my-app
Usage examples Jump to heading
Basic deployment Jump to heading
# Deploy current directory to production
deno deploy --prod
# Deploy with specific org and app
deno deploy --org my-company --app my-api --prod
Creating applications Jump to heading
# Start the interactive creation wizard
deno deploy create
# Create with a framework preset
deno deploy create --org my-company --app my-site \
--source local --framework-preset fresh \
--build-timeout 5 --build-memory-limit 1024 --region us
# Create a static site from a GitHub repo
deno deploy create --org my-company --app my-docs \
--source github --owner my-github-org --repo my-docs-repo \
--runtime-mode static --static-dir dist --single-page-app \
--build-command "npm run build" \
--build-timeout 10 --build-memory-limit 2048 --region global
Switching context Jump to heading
# Set a default org and app so you don't have to pass --org/--app every time
deno deploy switch --org my-company --app my-api
# Now these commands use the saved org and app automatically
deno deploy env list
deno deploy logs
Database management Jump to heading
# Provision a Deno KV database
deno deploy database provision my-kv --kind denokv --org my-company
# Link an external PostgreSQL database
deno deploy database link my-pg "postgres://user:pass@host:5432/db" --org my-company
# Assign a database to an app
deno deploy database assign my-kv --app my-api
# Query a database
deno deploy database query my-pg mydb "SELECT count(*) FROM users"
Environment setup Jump to heading
# Set up environment variables
deno deploy env add DATABASE_URL "postgresql://..." --secret
deno deploy env add SITE_NAME "My App"
# Load from .env file
deno deploy env load .env.production
Monitoring Jump to heading
# View recent logs
deno deploy logs --org my-company --app my-api
# View logs for specific time range
deno deploy logs --org my-company --app my-api \
--start "2024-01-01T00:00:00Z" \
--end "2024-01-01T23:59:59Z"
Cloud integration Jump to heading
# Set up AWS integration
deno deploy setup-aws --org my-company --app my-api
# Set up GCP integration
deno deploy setup-gcp --org my-company --app my-api
Getting help Jump to heading
- Use
deno deploy --helpfor general help - Use
deno deploy <subcommand> --helpfor specific subcommand help - Check the Deno Deploy documentation for platform-specific information