How to Install Deno on Ubuntu: The Secure JavaScript and TypeScript Runtime

Deno is a secure runtime for JavaScript and TypeScript from Ryan Dahl, who also created Node.js. Built in Rust on top of the V8 engine, it corrects several of Node’s early design decisions: TypeScript runs natively, code is sandboxed unless you explicitly grant permissions, and a complete toolchain — formatter, linter, test runner and bundler — is baked into the single deno executable.

The official Ubuntu repositories do not package Deno, and its rapid release cadence would leave any archived version quickly outdated. The upstream shell installer works but drops a binary into your home directory outside of APT, which makes upgrades and removal a manual affair.

The unofficial deb.griffo.io repository offers a cleaner option: a current, prebuilt Deno package installed with apt and kept up to date through your usual system upgrades.

What Makes Deno Special?

  • 🔒 Secure by default - filesystem, network and environment access are denied until you grant them
  • 🟦 Native TypeScript - runs .ts files directly, no build step required
  • 🧰 Batteries-included tooling - formatter, linter, test runner and bundler all built in
  • 🌐 Web-standard APIs - fetch, URL, WebSocket and more available out of the box
  • 📦 Modern module system - import by URL or via deno.json, with a built-in dependency cache
  • 🟢 npm compatibility - pull in npm packages through npm: specifiers when needed
  • ⚙️ Single executable output - deno compile produces standalone self-contained binaries
  • 📚 Audited standard library - a well-maintained standard library from the Deno team

Why Use the deb.griffo.io Repository?

  • Easy installation and updates through the standard APT workflow
  • Automatic dependency management courtesy of Debian-style packaging
  • Always tracks upstream releases so new Deno versions land without delay
  • No shell installer leaving an unmanaged binary in your home directory
  • Works across supported Ubuntu releases including the current LTS versions

Prerequisites

Before starting, make sure you have:

  • An Ubuntu system (Jammy 22.04 LTS, Noble 24.04 LTS, or newer)
  • sudo privileges
  • curl installed (install it with sudo apt install curl if needed)

Step 1: Add the deb.griffo.io Repository

Add the GPG key and source entry with the commands below:

# Create the keyrings directory
sudo install -d -m 0755 /etc/apt/keyrings

# Download and install the repository GPG key
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg

# Add the repository (auto-detects your distro codename)
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null

# Update the package list
sudo apt update

Step by step:

  1. Create the keyrings directory with permissions suitable for the signing key.
  2. Install the GPG key, dearmoring it into a keyring APT uses for verification.
  3. Add the repository, letting lsb_release -sc fill in your Ubuntu codename automatically.
  4. Update the index so APT can see the packages the repository provides.

Step 2: Update the Package List

If you have not already refreshed the index, do it now:

sudo apt update

Step 3: Install Deno

Install the package directly:

sudo apt install deno

APT fetches the latest packaged Deno and installs any dependencies it needs.

Step 4: Verify the Installation

Confirm Deno is available and reporting versions for its components:

deno --version

The output shows the Deno, V8 and TypeScript versions:

deno 2.4.2
v8 13.7.152.6
typescript 5.8.3

Getting Started with Deno

Here are the workflows to get you going.

Managing Dependencies and Tasks

Modern Deno projects lean on a deno.json file for imports and tasks:

# Initialise a new project
deno init my-app
cd my-app

# Add a dependency from JSR or npm
deno add jsr:@std/http
deno add npm:express

# Run a task defined in deno.json
deno task dev

# Pre-cache dependencies
deno cache main.ts

Running Code

Deno runs JavaScript and TypeScript directly and asks for permissions as required:

# Run a local script
deno run main.ts

# Run a remote script from a URL
deno run https://docs.deno.com/examples/scripts/hello_world.ts

# Grant only what the program needs
deno run --allow-net --allow-read server.ts

# Grant all permissions (use sparingly)
deno run -A main.ts

Those --allow-* flags are central to Deno’s security model: without them a script cannot touch the network or the filesystem.

The Built-in Toolchain

Deno provides the tools most projects would otherwise install separately:

# Format your code
deno fmt

# Lint for common issues
deno lint

# Run the test suite
deno test

# Type-check without executing
deno check main.ts

A test relies on the standard library’s assertions:

import { assertEquals } from "jsr:@std/assert";

Deno.test("adds numbers", () => {
  assertEquals(2 + 2, 4);
});

Installing Tools and Compiling Binaries

Deno can install scripts as global commands and compile projects into standalone executables:

# Install a script as a global command
deno install --global --allow-net -n serve jsr:@std/http/file-server

# Compile a project into a single self-contained binary
deno compile --allow-net --output myserver server.ts
./myserver

Keeping Deno Updated

Since Deno comes from an APT repository, updating it is part of your normal routine:

sudo apt update && sudo apt upgrade

Newly packaged releases are pulled in automatically. There is no need for deno upgrade, which applies only to shell-script installations.

Other Tools from deb.griffo.io

The deb.griffo.io repository packages plenty of other developer tools for Ubuntu:

  • bun - a fast all-in-one JavaScript runtime and toolkit
  • eza - a modern, maintained replacement for ls
  • starship - a fast, minimal prompt for any shell
  • lazygit - a friendly terminal UI for Git

Troubleshooting

Package Not Found

If APT cannot find the deno package after you add the repository:

  1. Confirm you ran sudo apt update once the source was in place.
  2. Check that your Ubuntu release is supported (Jammy, Noble or newer).
  3. Inspect the source entry:
cat /etc/apt/sources.list.d/deb.griffo.io.list

GPG or Key Issues

A NO_PUBKEY or signature error means the signing key needs re-adding:

# Re-download and install the repository GPG key
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg

# Refresh the package list
sudo apt update

A Script Fails with a Permission Error

Because Deno is locked down by default, a PermissionDenied error almost always means you are missing an --allow-* flag. Add --allow-net for network access, --allow-read for file reads, or --allow-env for environment variables, and prefer the smallest set that works over the blanket -A flag.

Uninstalling

Remove Deno with:

sudo apt remove deno

To remove the repository as well:

sudo rm /etc/apt/sources.list.d/deb.griffo.io.list
sudo rm /etc/apt/keyrings/deb.griffo.io.gpg
sudo apt update

Conclusion

Deno is a modern take on the JavaScript runtime: native TypeScript, an opt-in security model and a full toolchain in one binary strip away much of the ceremony that has built up around Node.js. Whether you are writing a quick script, a web server or a command-line tool, there is less to configure and less to install.

Installed via the deb.griffo.io repository, Deno on Ubuntu stays under APT’s management: one command to install, and future releases arriving with your normal upgrades. It is a cleaner setup than a shell installer writing into your home directory, and it keeps Deno current for you automatically.

Resources


Disclaimer: The deb.griffo.io repository is an unofficial community project and is not affiliated with the official Debian or Ubuntu projects, or with the upstream Deno project.