1# Framework-Specific Deployment23Deno Deploy supports multiple frameworks. The CLI auto-detects your framework and configures the build appropriately.45## Framework Detection67| Framework | Detection Files | Build Command | Notes |8|-----------|-----------------|---------------|-------|9| **Fresh** | `islands/`, `fresh.config.ts` | `deno task build` | Deno-native, island architecture |10| **Astro** | `astro.config.mjs`, `astro.config.ts` | `npm run build` or `deno task build` | Static or SSR |11| **Next.js** | `next.config.js`, `next.config.mjs` | `npm run build` | Requires `nodeModulesDir: "auto"` |12| **Nuxt** | `nuxt.config.ts` | `npm run build` | Vue SSR framework |13| **Remix** | `remix.config.js` | `npm run build` | React SSR framework |14| **SolidStart** | `app.config.ts` with solid | `npm run build` | SolidJS SSR |15| **SvelteKit** | `svelte.config.js` | `npm run build` | Svelte SSR framework |16| **Lume** | `_config.ts` with lume import | `deno task build` | Deno-native static site |1718## Framework Presets for `deno deploy create`1920When 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`.2122When a preset is specified, you can omit `--install-command`, `--build-command`, `--pre-deploy-command`, and `--runtime-mode` — they are inferred from the preset.2324If 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.2526## Detect Framework Script2728```bash29if [ -d "islands" ] || [ -f "fresh.config.ts" ]; then echo "Framework: Fresh"; \30elif [ -f "astro.config.mjs" ] || [ -f "astro.config.ts" ]; then echo "Framework: Astro"; \31elif [ -f "next.config.js" ] || [ -f "next.config.mjs" ]; then echo "Framework: Next.js"; \32elif [ -f "nuxt.config.ts" ]; then echo "Framework: Nuxt"; \33elif [ -f "remix.config.js" ]; then echo "Framework: Remix"; \34elif [ -f "svelte.config.js" ]; then echo "Framework: SvelteKit"; \35elif [ -f "_config.ts" ]; then echo "Framework: Lume (check imports)"; \36else echo "Framework: Custom/Unknown"; fi37```3839## Fresh (Deno-Native)4041```bash42deno task build43deno deploy --prod44```4546## Fresh + PostgreSQL4748When 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.4950**Complete deployment sequence:**5152```bash53# 1. Create the app with --no-wait (warmup will fail without a database — that's expected)54deno deploy create \55 --org <ORG_NAME> --app <APP_NAME> \56 --source local \57 --do-not-use-detected-build-config \58 --install-command "deno install" \59 --build-command "deno task build" \60 --pre-deploy-command "echo ready" \61 --runtime-mode dynamic --entrypoint main.ts \62 --build-timeout 5 --build-memory-limit 1024 --region us \63 --no-wait6465# 2. Provision a PostgreSQL database66deno deploy database provision my-db --kind prisma --region us-east-16768# 3. Assign it to the app (this injects DATABASE_URL, PGHOST, etc.)69deno deploy database assign my-db --app <APP_NAME>7071# 4. Redeploy — now the database exists, so warmup succeeds72deno deploy --prod73```7475**Why this order matters:**76- Fresh + PostgreSQL apps typically call `await initDb()` in `main.ts`, which runs during warmup77- If no database is assigned, the connection fails and the deploy is marked as failed78- Using `--no-wait` on the first deploy lets you continue to the database setup without blocking7980**Why `--do-not-use-detected-build-config`:**81- The Fresh auto-detection and `--framework-preset fresh` can fail with an API error82- Manual build config is more reliable — see [Troubleshooting](TROUBLESHOOTING.md#fresh-auto-detection--preset-fails)8384## Astro8586```bash87# If using npm88npm run build89deno deploy --prod9091# If using Deno tasks92deno task build93deno deploy --prod94```9596## Next.js9798Next.js requires Node.js compatibility mode:991001. Ensure `deno.json` has:101 ```json102 {103 "nodeModulesDir": "auto"104 }105 ```1061072. Build and deploy:108 ```bash109 npm install110 npm run build111 deno deploy --prod --allow-node-modules112 ```113114## Nuxt / Remix / SvelteKit / SolidStart115116These npm-based frameworks follow a similar pattern:117118```bash119npm install120npm run build121deno deploy --prod122```123124If you encounter issues with node_modules:125```bash126deno deploy --prod --allow-node-modules127```128129## Lume (Static Sites)130131```bash132deno task build133deno deploy --prod134```135136## Custom / No Framework137138For custom servers or apps without a recognized framework:1391401. Ensure you have an entrypoint (e.g., `main.ts`, `server.ts`)1412. Deploy directly:142 ```bash143 deno deploy --entrypoint main.ts --prod144 ```145146## Static Site Deployment147148For static sites (Lume, Vite builds, etc.), you have two options:149150### Option 1: Direct Directory Deployment151152Point Deno Deploy at your built directory. Configure in `deno.json`:153154```json155{156 "deploy": {157 "entrypoint": "main.ts",158 "include": ["_site"]159 }160}161```162163### Option 2: Custom Server Wrapper164165Only needed if you want custom routing, headers, or logic:166167```typescript168// serve.ts169import { serveDir } from "jsr:@std/http/file-server";170171Deno.serve((req) =>172 serveDir(req, {173 fsRoot: "_site",174 quiet: true,175 })176);177```178179Then deploy with:180181```bash182deno deploy --entrypoint serve.ts --prod183```184185## Cloud Integrations186187### AWS Integration188189```bash190deno deploy setup-aws --org my-org --app my-app191```192193### GCP Integration194195```bash196deno deploy setup-gcp --org my-org --app my-app197```