79/80 tests pass v1.3.10 ARM64 / aarch64

Bun on Termux

Run Bun natively on Android via Termux using a C userland exec wrapper + LD_PRELOAD shim. No proot, no chroot, no root.

bun bash wrapper — arg routing, pkg.json bun-termux C wrapper — userland exec, mmap ld.so ld.so + bun-shim.so LD_PRELOAD — openat, stat, execve, link buno real bun binary (v1.3.10, linux-aarch64) --cwd, --backend env vars on stack /proc/stat, shebangs your JS/TS code full process.env, os.cpus(), Bun.serve()...

What it handles

Zero-Config Installs

Wrapper auto-injects --cwd and --backend=copyfile. Shim intercepts link/linkat for automatic hardlink-to-copy fallback on Android f2fs.

📦

14KB Compiled Binaries

bun build --compile output embeds the 14KB wrapper, not the 100MB runtime. Runs on any Termux + glibc-runner device.

🔧

Deep Shim Coverage

Intercepts openat, stat, access, execve, and link at the glibc level. Spoofs /proc/stat for os.cpus(), translates shebangs automatically.

80 Tests, 18 Categories

CLI, file exec, eval, REPL, test runner, build, package management, scripts, bunx, create, APIs, env vars, network, workers, FFI, and more.

Quick Start

Requires Termux (F-Droid/GitHub), termux-pacman, glibc-runner, and clang on an ARM64 device.

git clone https://github.com/tribixbite/bun-on-termux.git
cd bun-on-termux
make install
chmod +x setup.sh && ./setup.sh
bun --version

Compared to alternatives

Three projects solve the same problem. Different tradeoffs.

Approach
bun-on-termux Bash + C wrapper + shim
bun-termux C wrapper + shim
bun-termux-loader Embedded binary + shim
Shim syscalls
bun-on-termux openat, stat, access, execve, link
bun-termux openat, execve
bun-termux-loader dlopen
Hardlink fallback
bun-on-termux Auto (shim copy)
bun-termux Manual flag
bun-termux-loader Manual flag
bun install
bun-on-termux Auto --cwd + --backend
bun-termux Manual flags
bun-termux-loader N/A
bun init / create
bun-on-termux Works
bun-termux Manual workarounds
bun-termux-loader N/A
Compiled size
bun-on-termux ~14KB
bun-termux ~100MB
bun-termux-loader ~92MB
Test suite
bun-on-termux 80 tests, 18 categories
bun-termux 8 tests
bun-termux-loader None

Full comparison →