Deno on Miren
Miren auto-detects Node and Bun, but not Deno — so you deploy Deno with a
Dockerfile.miren built on the official Deno image. It runs TypeScript directly, so
there's no separate build step for most apps.
Ask your AI coding agent to "set up this Deno app on Miren" after installing the
Miren agent skills. It adds the Dockerfile.miren, confirms your
server binds 0.0.0.0:$PORT, sets the runtime permissions, and deploys — using this
page as its reference.
Do you need a Dockerfile?
Yes. Miren's JavaScript detection covers Node and Bun (see
JavaScript on Miren); Deno needs a Dockerfile.miren. Miren builds
from it instead of guessing the stack — see
Using Dockerfile.miren.
Miren auto-detects and builds common stacks (Python, Node, Bun, Go, Ruby, Rust) without a Dockerfile. This language isn't one of them yet — if you'd like first-class support, request it.
Bind to the injected port
Miren injects PORT and routes traffic to it, so your server must read PORT and
listen on 0.0.0.0. With the built-in Deno.serve:
const port = Number(Deno.env.get("PORT") ?? "8080");
Deno.serve({ port, hostname: "0.0.0.0" }, () =>
new Response("Hello from Deno on Miren!\n", {
headers: { "content-type": "text/plain" },
}));
Frameworks like Oak or Fresh accept the same port/hostname — pass the injected
PORT and bind 0.0.0.0.
The Dockerfile
Create Dockerfile.miren in your project root:
FROM denoland/deno:2.1.4
WORKDIR /app
COPY . .
RUN deno cache main.ts
EXPOSE 8080
CMD ["run", "--allow-net", "--allow-env", "main.ts"]
deno cache pre-fetches and compiles your dependencies into the image so startup is
fast. Deno runs with no permissions by default, so grant exactly what your app needs —
--allow-net to listen, --allow-env to read PORT, and any others (--allow-read,
--allow-write) your code requires.
.dockerignore
.git
Set up the app
Even with a Dockerfile.miren, Miren needs at least one service defined — it
doesn't use the image's CMD as the start command. Add a Procfile with the full
deno run command (including permissions):
web: deno run --allow-net --allow-env main.ts
Then create .miren/app.toml naming your app and deploy from your project root:
name = "deno-bench"
miren deploy
If no service is defined, the build succeeds but the deploy stops with
no services defined: please define at least one service in a Procfile or .miren/app.toml.
Environment variables
Set variables with miren env set — -e for plain values, -s for secrets (masked in
output and logs). Read them with Deno.env.get("KEY") (needs --allow-env):
miren env set -e LOG_LEVEL=info
miren env set -s DATABASE_URL
miren env set -s API_TOKEN
You can also declare variables in .miren/app.toml:
[[env]]
key = "DATABASE_URL"
value = ""
required = true
sensitive = true
description = "Postgres connection string"
See App Configuration — Environment Variables.
Agent quick reference
- Detection: none — requires
Dockerfile.miren(Node/Bun are detected, Deno is not) - Base image:
denoland/deno:<version>;deno cache main.tswarms deps - Service is required: define a
Procfile(web: deno run --allow-net --allow-env main.ts) — the imageCMDis not used - Permissions: grant
--allow-net+--allow-envat minimum; add others as needed - Port: read
Deno.env.get("PORT"); bind0.0.0.0viaDeno.serve - Env vars:
miren env set -e/-s, or[[env]]inapp.toml; read withDeno.env.get
Next steps
- JavaScript on Miren — Node and Bun (auto-detected)
- Using Dockerfile.miren — how custom builds work
- App Configuration — customize
.miren/app.toml - Deployment — how deploys build and activate