Subchapter 1.5
references/FRAMEWORKS.mdMarkdown6 KBView on GitHub
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 |
When creating an app with deno deploy create in non-interactive mode, you can
specify --framework-preset to auto-configure build commands and runtime
settings. The available presets are: Fresh, Next, Remix, Astro,
SvelteKit, Nuxt, Lume, SolidStart.
When a preset is specified, you can omit --install-command, --build-command,
--pre-deploy-command, and --runtime-mode — they are inferred from the
preset.
If you don’t specify a preset, the CLI still auto-detects your framework from
the project files. Use --do-not-use-detected-build-config to skip
auto-detection and specify everything manually.
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"; fideno task build
deno deploy --prodWhen a Fresh app uses PostgreSQL (e.g., await initDb() at startup), you must
provision the database before the app can successfully warm up. The Fresh
auto-detection preset also has a known issue, so use manual build config.
Complete deployment sequence:
# 1. Create the app with --no-wait (warmup will fail without a database — that's expected)
deno deploy create \
--org <ORG_NAME> --app <APP_NAME> \
--source local \
--do-not-use-detected-build-config \
--install-command "deno install" \
--build-command "deno task build" \
--pre-deploy-command "echo ready" \
--runtime-mode dynamic --entrypoint main.ts \
--build-timeout 5 --build-memory-limit 1024 --region us \
--no-wait
# 2. Provision a PostgreSQL database
deno deploy database provision my-db --kind prisma --region us-east-1
# 3. Assign it to the app (this injects DATABASE_URL, PGHOST, etc.)
deno deploy database assign my-db --app <APP_NAME>
# 4. Redeploy — now the database exists, so warmup succeeds
deno deploy --prodWhy this order matters:
await initDb() in main.ts, which
runs during warmup--no-wait on the first deploy lets you continue to the database setup
without blockingWhy --do-not-use-detected-build-config:
--framework-preset fresh can fail with an API
error# If using npm
npm run build
deno deploy --prod
# If using Deno tasks
deno task build
deno deploy --prodNext.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-modulesThese npm-based frameworks follow a similar pattern:
npm install
npm run build
deno deploy --prodIf you encounter issues with node_modules:
deno deploy --prod --allow-node-modulesdeno task build
deno deploy --prodFor custom servers or apps without a recognized framework:
main.ts, server.ts)deno deploy --entrypoint main.ts --prodFor 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 --proddeno deploy setup-aws --org my-org --app my-appdeno deploy setup-gcp --org my-org --app my-app