DEV Community

Cover image for Run Linux in the Browser - unkernel WebAssembly Linux
GitHubOpenSource
GitHubOpenSource

Posted on

Run Linux in the Browser - unkernel WebAssembly Linux

TL;DR: unkernel is a Linux 7.x kernel compiled into a single WebAssembly module that uses a real MMU and scheduler. It runs unmodified aarch64 binaries by emulating the CPU while executing kernel syscalls, file I/O, and networking natively within the Wasm environment.
Best for: Developers who need to run Linux CLI tools, package managers, or full OS environments directly in the browser or Node.js.
Repository snapshot: ⭐ 3 507 stars · 🍴 234 forks · TypeScript · GPL-2.0
Daily picks: Follow GitHub Open Source on Telegram


What it is

unkernel is an open-source TypeScript project that compiles a Linux 7.x kernel into a single WebAssembly module. It boots standard distributions like Alpine Linux to a shell in under 300ms, running unmodified aarch64 binaries inside the browser or Node.js.

How it works

Instead of traditional virtualization, unkernel emulates the CPU while executing kernel syscalls, file I/O, and networking natively within the WebAssembly environment. It features a real Memory Management Unit supporting fork, mmap, and copy-on-write behavior, alongside persistent storage through ext4 disk images saved in IndexedDB.

Key features

  • Boots Alpine Linux to a working shell in less than 300ms.
  • Executes standard aarch64 binaries including Python, Node, and OpenSSL.
  • Real MMU implementation for proper memory handling.
  • Persistent storage backed by browser IndexedDB.
  • TypeScript SDK for seamless web app integration.

Getting started

Clone the repository from GitHub and install it via your preferred package manager. Use the TypeScript SDK to initialize and boot the kernel instance inside your web application or Node.js script.

When not to use it

Do not use unkernel as a replacement for your primary development server when handling heavy compute workloads. It is optimized for sandboxed tooling, demos, and lightweight portable environments.


Discuss

Would you use this to provide a 'try it now' experience for your CLI tool, or is the browser-based Linux environment too heavy for your users?

Curated from the repository README and metadata. No hands-on test is claimed; evaluate it in a sandbox before production use.

Top comments (0)