Skip to content

Guide · Open source

How to use Deno: install, run your first server and tips

Updated · written with AI from the project's own documentation and checked against our catalogue data

Deno is a runtime that runs JavaScript, TypeScript, and WebAssembly programs outside a web browser. This guide is for developers and students who want to install Deno, write a small TypeScript server and run it. By the end you will have Deno installed and a working local web server.

Denodenoland/deno · ★ 109k · MIT

Quick start

  1. 1Install Deno. Run the install command for your system from the README. Mac and Linux use the shell script, Windows uses PowerShell, and Mac users can use Homebrew.
  2. 2Create server.ts. Make a file called server.ts and paste in the Deno.serve TypeScript example.
  3. 3Run with network permission. Run deno run --allow-net server.ts from the folder containing the file.
  4. 4Open the server. Visit http://localhost:8000 to see Hello, world!.
  5. 5Read the docs. Use the official Deno docs for more guides and reference material.

Install Deno on Mac, Linux or Windows

Deno is installed with a single command for your operating system. The README lists a shell command for Mac and Linux, a PowerShell command for Windows, and a Homebrew option for Mac. The README notes there are several other ways to install Deno and links to a full list in the official docs.

  • Mac or Linux (shell): run the install script from the README
  • Windows (PowerShell): run the PowerShell install command from the README
  • Mac (Homebrew): install with brew
curl -fsSL https://deno.land/install.sh | sh

Write your first Deno program

Deno is most commonly used to build web servers, so the README's first example is one. Create a file called server.ts and add the TypeScript code shown. No separate build step is shown in the README; you run the TypeScript file directly.

  • Create a file named server.ts
  • Paste in the Deno.serve code below
Deno.serve((_req: Request) => { return new Response("Hello, world!"); });

Run the program with permissions

Start the program with the deno run command. The README passes the --allow-net flag, which grants network access to the program. Once it runs, the README says a local web server starts at localhost port 8000.

  • Open http://localhost:8000 in your browser to see the response
  • Deno is designed with secure defaults, so the program needs the flag to use the network
deno run --allow-net server.ts

Learn more and find official resources

The official Deno docs cover writing and running programs, and the Deno Standard Library provides common utilities for Deno programs. The JSR package registry is also linked from the README.

  • Deno Docs: official guides and reference for the runtime
  • Deno Standard Library: officially supported common utilities
  • JSR: open-source package registry for JavaScript and TypeScript
  • Developer Blog: product updates and tutorials from the Deno team

What people use it for

  • Building small web servers or APIs, the use the README shows most often
  • Running TypeScript files without a separate build setup
  • Learning server-side JavaScript or TypeScript
  • Using a runtime with permission-based security, such as granting network access with --allow-net

Frequently asked questions

Is Deno free to use?

Deno's repository is licensed under the MIT licence, according to this directory's listing. The MIT licence generally permits free use, but check the licence file in the repository for the exact terms.

What do I need before installing Deno?

This directory lists no prerequisites for Deno. You install it with the shell, PowerShell or Homebrew command for your system.

How do I install Deno on Windows?

The README gives a PowerShell command: irm https://deno.land/install.ps1 | iex. It also lists Chocolatey, WinGet and Scoop options, with links to the official installation docs.

Why does my Deno server need --allow-net?

Deno uses secure defaults, and the README's example passes --allow-net to let the program use the network. Without that permission, the server example will not be granted network access.

What is Deno's main alternative?

This directory lists Node.js and Bun as comparable projects. The README does not compare Deno's compatibility with Node.js, so test your own code before migrating.

Is Deno only for front-end websites?

No. Deno is a runtime, not a front-end tool, and this guide does not cover browser-side workflows. If you only need to build a website for browsers, Deno may not be the right tool.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Deno suits developers and students who want to run TypeScript without a separate build setup, or who want permission-based security for small servers and APIs. If you only need front-end browser tooling, or need guaranteed Node.js compatibility with no migration effort, the source does not support Deno for that, so consider Node.js or Bun instead.

Install options & downloads