- Documentation
- Technologies
- Deno
Deno
Guara Cloud fully supports Deno applications, including frameworks like Fresh, Oak, Hono, and any other Deno-based project. Deno’s secure-by-default runtime and native TypeScript support make it a great choice for modern web applications.
Supported versions
The following Deno versions are auto-detected by Buildpack:
- Deno 1.46
- Deno 2.0
- Deno 2.1
The version is determined from the deno.json or deno.jsonc configuration file. If no version is specified, the latest stable version is used.
{
"lock": true,
"tasks": {
"start": "deno run --allow-net --allow-read --allow-env main.ts"
}
}
Deploy with Dockerfile
For full control over your build, provide a Dockerfile in the root of your repository.
Deploy with Buildpack
If your repository does not contain a Dockerfile, Guara Cloud automatically detects your Deno project by the presence of a deno.json or deno.jsonc file in the root directory.
The Buildpack will:
- Detect the Deno version from your configuration
- Cache dependencies defined in your import map or
deno.json - Build your application if a
buildtask is defined - Start your application using the
starttask
Make sure your deno.json includes a start task:
{
"tasks": {
"start": "deno run --allow-net --allow-read --allow-env main.ts"
}
}
Port configuration
Your application must listen on the port configured in your service settings. The default is 3000, but you can change it at any time to match your application.
const port = Number(Deno.env.get("PORT")) || 3000;
Deno.serve({ port }, handler);
Example project structure
my-deno-app/
deno.json
deno.lock
main.ts
routes/
index.ts
middleware/
auth.ts
Dockerfile # optional — omit to use Buildpack
Environment variables
These environment variables are commonly used with Deno deployments:
| Variable | Recommended value | Description |
|---|---|---|
PORT | Set by platform | The port your application must listen on |
DENO_ENV | production | Indicates the runtime environment |
DENO_DIR | /app/.cache/deno | Directory for Deno’s module cache |