All skills
denoland avatar

/deno-deploy

@2311d69 official
by Denodenoland/skills99 stars
8

Use when deploying Deno apps to production, asking about Deno Deploy, or working with `deno deploy` CLI commands. Covers deployment workflows, environment variables, KV database access, custom domains, the --tunnel flag for local development, and the `deno deploy` command reference.

Use this Skill: https://skilld.dev/gh/denoland/skills/deno-deploy

This session only. Nothing lands on disk.

referencesRUNTIME.md

≈652 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Deno Deploy Runtime

Overview

Deno Deploy uses the standard Deno runtime. You can use JSR and NPM packages, filesystem operations, network requests, subprocesses, and FFI/native addons.

Current Environment

  • Runtime: Deno 2.5.0
  • Platform: Linux (x64 or ARM64)
  • Permissions: All permissions enabled automatically (--allow-all)

Note: Custom Deno flags cannot be passed to the runtime.

Serverless Lifecycle

Understanding how your app starts and stops is important for building reliable applications.

Startup

Your application starts when a request arrives. If your app crashes before the HTTP server starts, requests return a 502 error.

Tip: Keep startup fast by:

  • Reducing dependencies
  • Using dynamic imports for rarely-used code
  • Avoiding network requests during startup

Idle Shutdown

After 5-10 minutes without requests:

  1. The system sends a SIGINT signal
  2. Your app has 5 seconds to shut down gracefully
  3. If still running, SIGKILL terminates it
// Handle graceful shutdown
Deno.addSignalListener("SIGINT", () => {
  console.log("Shutting down...");
  // Clean up resources, close connections
  Deno.exit(0);
});

Eviction

Even during active traffic, instances may be terminated due to:

  • Infrastructure updates
  • Resource constraints

The system redirects traffic first, then signals shutdown. Long-running connections should expect reconnections.

Cold Start Performance

Cold starts typically complete:

  • ~100ms for simple "hello world" apps
  • A few hundred ms for larger applications

Deno Deploy optimizes cold starts using:

  • Pre-provisioned microVMs
  • Early TCP connection setup
  • File system warmup

Minimizing Cold Start Time

// BAD: Top-level network request delays startup
const config = await fetch("https://api.example.com/config").then((r) =>
  r.json()
);

// GOOD: Lazy load on first request
let config: Config | null = null;
async function getConfig() {
  if (!config) {
    config = await fetch("https://api.example.com/config").then((r) =>
      r.json()
    );
  }
  return config;
}

Limitations

Feature Status
Custom Deno flags Not supported
Persistent filesystem Use Deno KV instead
Long-running background tasks May be interrupted
System tools Available but may change

Documentation

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides safe and standard reference guidelines and deployment documentation for the Deno Deploy CLI. It covers configuration files, environment variables, command references, and databases without introducing dangerous command scripts, malicious prompt adjustments, obfuscated paths, or external download vulnerabilities.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    9/9 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 2311d69. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Steadyupdated 2 months ago
metadata
{
  "author": "denoland",
  "version": "1.5"
}
  • CLI
  • deno
  • deno-deploy
  • deployment
  • environment-variables
  • kv
  • custom-domains
  • production

README badge

README badge for denoland/skills/deno-deploy

Guides deployment of Deno applications to Deno Deploy using the `deno deploy` CLI (requires Deno >= 2.4.2). Covers app creation, production and preview deploys, environment variables across contexts, KV database provisioning, and the `--tunnel` flag for local development.

Generated from the current SKILL.md.

Does this skill cover the deprecated `deployctl` command?
No. This skill uses only the modern `deno deploy` command (requires Deno >= 2.4.2). The `deployctl` command is deprecated and not covered.
Can I use this skill to deploy to other platforms like Vercel or AWS Lambda?
No. This skill applies only to Deno Deploy. For other platforms, use their platform-specific guidance directly.
What should I do if my app connects to a database at startup?
Create the app with `--no-wait`, provision and assign the database with `deno deploy database` commands, then redeploy so the database exists before warmup.
Do I need to add configuration to deno.json before deploying?
Only if you have an existing app on Deno Deploy. For new apps, `deno deploy create` sets up the config automatically. For subsequent deploys, `deno deploy --prod` uses the stored org and app names.
How do I set different environment variables for production and preview deployments?
Deno Deploy supports separate contexts: Production (live traffic), Development (previews), and Build (during builds). You can set different values for the same variable in each context using the CLI.

Generated from the current SKILL.md. These answers refresh after source changes.