← Back to Guides
Profile image for Lavrenti Frobeen

By Lavrenti Frobeen

Published 4th February 2022

Deno is a secure server-side JavaScript runtime, similar to Node.js. Like Node.js, Deno πŸ¦• uses the V8 JavaScript engine under the hood but the rest of runtime is implemented in Rust and Typescript. Fun fact: Deno is an anagram of Node πŸ”„. Both Node.js and Deno were created by Ryan Dahl, who said:

β€œWith Deno we are trying to remove a lot of the complexity inherent in transpiling TypeScript code down to JavaScript with the hope this will enable more people to utilize it.”

If you’re interested in knowing more about Ryan Dahl and his projects, you’ll find this article interesting.

Depending on your development preferences you will choose to deploy your code either using a Dockerfile 🐳 or Buildpack πŸ“¦. We will describe both methods and guide you through the process of deploying Deno on Northflank with each of them. If you are still unsure whether to use Dockerfile or Buildpack, we found Doximity's Buildpacks vs Dockerfiles article comparing them very valuable.

Let’s get to it!

We created a repository based on the Getting Started example from the official Deno site and added some extra files that are needed to be able to deploy on Northflank:

  • For deployment using Dockerfile: Dockerfile.
  • For deployment using Buildpack: Procfile.

The repo can be found here and it has the following structure:

deno-on-northflank/
β”œβ”€ Dockerfile       (needed for Dockerfile deployment)
β”œβ”€ Procfile         (needed for Buildpack deployment)
β”œβ”€ app.ts
└─ deps.ts          (dependency management)

Deploy Deno on Northflank with Dockerfile

  1. Open the repository containing the Deno project. Click on Use this template to create a copy of this repository under your GitHub account.

    GitHub Use this template

  2. Connect your GitHub account to your Northflank account. You can find details on how to do so in our documentation.

    VSC Connect

  3. In your project, create a combined service:

    1. Under Repository, you will see a list of your repositories from which you can choose the Deno repo we just created.

    2. Select the branch main.

    3. Select Dockerfile as the build option and click Verify.

    Dockerfile

    • A combined service handles the build and deployment of your code.

    • Port 8080 will automatically be exposed with the HTTP protocol.

  4. Access the deployment via the unique code.run service URL or finish up by linking a custom domain. You will see Hello World! This is Deno running on Northflank. and your Deno app is ready to be built further! βœ¨πŸ¦•πŸš€βœ¨

Success Dockerfile

Deploy Deno on Northflank with Buildpack

  1. Open the repository containing the Deno project. Click on Use this template to create a copy of this repository under your GitHub account.

    GitHub Use this template

  2. Connect your GitHub account to your Northflank account. You can find details on how to do so in our documentation.

  3. In your project, create a combined service:

    Buildpack basic

    1. Under Repository, you will see a list of your repositories from which you can choose the Deno repo we just created.

    2. Select the branch main.

    3. Select Buildpack as the build option.

    4. Under Advanced build settings in Custom Buildpacks click Add Buildpack and paste the following url: https://github.com/chibat/heroku-buildpack-deno.git.

      Buildpack custom

    • A combined service handles the build and deployment of your code.

    • Port 8080 will automatically be exposed with the HTTP protocol.

  4. Access the deployment via the unique code.run service URL or finish up by linking a custom domain. A page with Hello World! This is Deno running on Northflank. will be displayed and your Deno project is ready for you to edit the app.tsand deps.ts and build great things! βœ¨πŸ¦•πŸš€βœ¨

Buildpack success

Using Northflank to deploy your Deno project

Northflank allows you to deploy your code and databases within minutes. Sign up for a Northflank account and create a free project to get started.

  • Connect with your preferred VCS: GitHub, GitLab or Bitbucket
  • Manage build arguments and environment variables using secret groups
  • Scale vertically and horizontally with multiple replicas per service
  • Observe & monitor with real-time metrics & logs
  • Create pipelines and release workflow as you grow

Share this article with your network