Run a Deno App

Getting an application running on is essentially working out how to package it as a deployable image. Once packaged it can be deployed to the platform.

In this guide we’ll learn how to deploy a Deno application on

The Hellodeno Application

Our example will be a basic “hello world” example using Deno and Dinatra.

You can get the code for the example from the hellodeno GitHub repository. Just git clone to get a local copy. Here’s all the code:

import {
} from "";

const greeting = "<h1>Hello From Deno on Fly!</h1>";

  get("/", () => greeting),
  get("/:id", ({ params }) => greeting + `</br>and hello to ${}`),

We’ll call this file main.ts. We also want a deps.ts file for dependencies, here it is:

export {
  } from "";

There’s nothing else to run. Deno will manage getting packages for itself.

Running The Application

Run deno run --allow-net main.ts to start the application:

deno run --allow-net main.ts
listening on

And connect to localhost:8080 to confirm that you have a working Deno application by receiving a greeting. Now to package it up for There are a number of ways to do this. You can use flyctl’s own simple builder,

Install Flyctl and Login

We are ready to start working with, and that means we need flyctl, our CLI app for managing apps on If you’ve already installed it, carry on. If not, hop over to our installation guide. Once that’s installed you’ll want to log in to

Configuring the App for

Each Fly App needs a fly.toml file to tell the system how we’d like to deploy it. That file can be automatically generated with the command fly launch command. This command will also generate a Dockerfile for deployment.

fly launch
Creating app in /fly/guides/hellodeno
Scanning source code
Detected Deno app
? Select organization: myorg (myorg)
? Select region: ams (Amsterdam, Netherlands)
Created app empty-sea-2541 in organization myorg
Wrote config file fly.toml
Your app is ready. Deploy with `flyctl deploy`
? Would you like to deploy now? (y/N)

First you’ll be prompted for an organization. Organizations are a way of sharing applications between users. When you are asked to select an organization, there should be one with your account name; this is your personal organization. Select that. Then, pick the region you want to deploy in.

Inside fly.toml

The fly.toml file now contains a default configuration for deploying your app. While creating that file, fly has also created a Fly-side application slot with the same name, “hellodeno”. If we look at the fly.toml configuration file we can see the name in there:

app = "empty-sea-2541"

  app = "run --allow-net ./example.ts"

We can also see a default run command for the main web process. We can change that to refer to ./main.ts.

The flyctl command will always refer to this file in the current directory if it exists, specifically for the app name/value at the start. That name will be used to identify the application to the platform.

The rest of the file contains settings to be applied to the application when it deploys.

Deploying to

We are now ready to deploy our containerized app to At the command line, just run:

fly deploy

This will get the app name empty-sea-2541 from our fly.toml file.

Then, fly will start deploying our application to using the Dockerfile. fly will return you to the command line when it’s done.

Viewing the Deployed App

If you want to find out more about the deployment. The command fly status will give you all the essential details.

fly status
  Name     = empty-sea-2541
  Owner    = dj
  Version  = 0
  Status   = running
  Hostname =

73f825ad 0       fra    run     running 1 total, 1 passing 0        6m34s ago

Connecting to the App

The quickest way to view your application is to run fly apps open which will open your browser on the URL for your application. Run fly apps open /name to get an extra greeting from the app.

If you want to manually enter a URL to check, remember to replace with the hostname you got from fly status and connect to where you should find a greeting - it will normally be upgraded to a secure connection. Use to start with a secure connection. Add /name and you’ll get an extra greeting from the hellodeno application.

Bonus Points

If you want to know what IP addresses the app is using, try fly ips list:

fly ips list
TYPE ADDRESS                              REGION CREATED AT
v4                        global 2021-04-22T23:23:01Z
v6   2a09:8280:1:2958:3b6c:fdfd:70f9:da9d        2021-04-22T23:23:01Z

Arrived at Destination

You have successfully built, deployed, and connected to your first Deno application on