Deno 2 is a secure runtime for JavaScript and TypeScript built on V8 and Rust. Unlike Node.js, Deno has built-in TypeScript support, a permission-based security model, and a standard library without npm being required. Deno 2 introduces npm compatibility and improved backwards compatibility. This guide installs Deno 2 on Ubuntu 26.04 LTS.
Tested and valid on:
- Ubuntu 26.04 LTS
Prerequisites
- Ubuntu 26.04 LTS
- A user account with internet access
Step 1 – Install Deno Using the Official Installer
curl -fsSL https://deno.land/install.sh | sh
Step 2 – Add Deno to PATH
The installer outputs the path instructions. Add to your ~/.bashrc:
export DENO_INSTALL="$HOME/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
source ~/.bashrc
Step 3 – Verify Installation
deno --version
Step 4 – Run a TypeScript File
cat > hello.ts << 'EOF'
const msg: string = 'Hello from Deno 2!';
console.log(msg);
EOF
deno run hello.ts
Step 5 – Use Deno with Network Permissions
cat > server.ts < new Response('Hello Deno!'));
console.log('Listening on http://localhost:8000');
EOF
deno run --allow-net server.ts
Step 6 – Use npm Packages with Deno
deno run --allow-net npm:express
Step 7 – Update Deno
deno upgrade
Conclusion
Deno 2 is installed on Ubuntu 26.04 LTS. Explore its standard library at deno.land/std and benefit from built-in security, TypeScript, and native Web API support.