Deploy Deno apps
DollarDeploy deploys Deno apps to your own server with automatic HTTPS, no Dockerfile required. It works with any project whose deno.json exposes build and start tasks (for example a Nitro deno-server build).
How it works
When your repository contains a deno.json or deno.jsonc, DollarDeploy detects the app type as Deno automatically. On build it installs Deno, runs deno ci (a clean, reproducible install from your deno.lock, when present, or deno install if DENO_FORCE_INSTALL=1 or no deno.lock found) and then deno task build. On the server the app runs under systemd with deno task start, behind the managed Nginx reverse proxy.
The app should listen on the PORT environment variable. DollarDeploy assigns it and defaults to 3000 (Nitro and most Deno servers honour PORT out of the box).
Configure your app
Your deno.json needs a build and a start task. A typical setup looks like this:
{
"tasks": {
"build": "deno run -A vite build",
"start": "deno run -A ./.output/server/index.mjs"
}
}
A few things to keep in mind:
- Environment variables are provided by DollarDeploy through the app's
.envfile. If yourstarttask uses--env-file, point it at.env(for example--env-file=${ENV_FILE:.env}) so it does not fail on a missing file. - Native npm modules. If your app uses native npm packages (for example
libsql,sharp,esbuild) together with"nodeModulesDir": "manual", set in app envBUILD_MATCH_ARCH=1so the build runs on the same CPU architecture as your server and the bundled binaries load correctly. - better-auth. Set a high-entropy
BETTER_AUTH_SECRET(at least 32 characters). DollarDeploy suggests one for you, or generate it withopenssl rand -base64 32. - Drizzle ORM. DollarDeploy suggests a pre-start command that runs
drizzle-kitthrough Deno:deno run -A --node-modules-dir npm:drizzle-kit push --config drizzle.config.ts.
Deploy
- Create a new app from your GitHub repository. DollarDeploy reads the repository and sets the app type to Deno, the port to
3000, and the start task tostart. - Pick a server and a hostname.
- Review the suggested environment variables and add any your app requires.
- Build and deploy. DollarDeploy installs Deno on the server, starts the app with
deno task start, configures Nginx, and issues an HTTPS certificate.
You can do the same from the CLI or with DollarDeploy AI.
Essential settings
- App type: Deno
- Build:
deno task build(override with a custom build command if needed) - Start:
deno task start(the start script is thedeno.jsontask name,startby default) - Port:
3000(or whatever your app reads fromPORT) BUILD_MATCH_ARCH=1when the app uses native npm modulesBETTER_AUTH_SECRETwhen the app uses better-auth
Install, build, and start commands can all be overridden in the app settings if your project does not follow the defaults.
Example repository
huksley/deno-starter — a Deno starter that deploys to DollarDeploy out of the box.