DEV Community

Cover image for Deploy deno in 4 steps

Deploy deno in 4 steps

gokulkrishh profile image Gokulakrishnan Kalaikovan Updated on ・2 min read

What is deno?

Deno is secure run time for javascript & typescript. Deno aims to provides secure scripting environment. It is built on top of V8 engine, Rust and TypeScript. Also deno supports typescript out of the box.


  • Create a simple todo rest api.
  • Use oak middleware for routing etc,
  • Expose routes for GET, POST, DELETE and PUT methods.


API list

  • GET - /
  • GET - /todos
  • POST - /todos (form data)
  • PUT - /todos/:id (form data)
  • DELETE - /todos/:id

Project structure

├── Dockerfile
├── config.js
├── controllers
│   └── todos
│       ├── delete.js
│       ├── get.js
│       ├── post.js
│       └── put.js
├── data
│   └── todos.json
├── fly.toml
├── index.js
└── router.js

Source code

Install & Run

Step 1: Install

curl -fsSL | sh

Step 2: Run

deno run --allow-net --allow-read --allow-write ./index.js


--allow-net is to allow network access
--allow-read is to allow read access to file system
--allow-write is to write to file system.

Step 3: Open https://localhost:8080

Step 4 (optional): denon for deno like nodemon for node

deno install --unstable --allow-read --allow-run -f

denon ./index.js


Denon uses .denonrc.json file in root for configuration

Step 5 (optional): To run using docker

docker build -t app . && docker run -it --init -p 8080:8080 app


Deployed using with docker.

Deploy in 4 steps

  1. Install Flyctl - you'll need it.

  2. Sign up/Log in to Fly - run flyctl auth signup to create an account or flyctl auth login to log in.

  3. Run flyctl apps create - let Fly generate you a name (recommended) or enter one of your own. Generates fly.toml file with config.

  4. Run flyctl deploy - To deploy

Run flyctl info - Fly will deployment details.

Hope this post was helpful. If you have any questions or query comment below.

Follow me on twitter for more web related things.

Discussion (0)

Editor guide