Quick install
macOS (Apple silicon / Intel) and Linux (x86_64 / ARM64):~/.local/bin/ff. If ~/.local/bin isn’t on your PATH, it prints the
export line to add. Update anytime with ff upgrade (which similarly verifies release checksums before installing):
Prefer containers?
docker pull ghcr.io/abdelmajidouhamane/ff:latest.
The rest of this page covers Docker and building from source.
Prerequisites
Check Zig first — Fairyfly requires 0.16:
Build from source
The vendors (QuickJS, BearSSL, SQLite, nghttp2) are gitignored — fetch them first (pinned versions, SHA-256 verified), then build:make build runs:
There is no
make build-native target. make build is the only build.Run it
main.js only logs, so it needs no grants. Program loading is a
carve-out: ff start reads ff.json and its main without --allow-read.
Once main.js calls http.serve, start it with the listener scope:
Permissions
The binary is deny-by-default. A loaded script cannot read files, open sockets, inspectprocess.env, spawn processes, or load native libraries
until the launch command grants it.
- Flags are CLI-only. There is no
ff.jsonfield and no environment variable that grants access. - Scopes are comma-split and repeatable:
--allow-read=src,views. - A bare flag grants the whole category:
--allow-netmeans any host and port. ff starttakes the flags afterstart;ff --watchforwards them to the child it restarts.ff testapplies the flags to every test file in that run. The repo’stest/run.shuses--allow-allbecause the suite exercises every category.- A missing grant fails before I/O with
PermissionDenied/PERMISSION_DENIED. FFI uses the same shape without a scope suffix:ffi.dlopen requires --allow-ffi. --allow-runand--allow-ffiare trust-equivalent to full access. Permissions catch mistakes; they are not an OS sandbox.
globalThis.permissions reports the six enabled categories as booleans:
Install on PATH
~/.local/bin isn’t on your PATH, Make tells you; add it (e.g. in ~/.zshrc):
--allow-read=./public.
Installs go to
~/.local/bin/ff, never /usr/local/bin. This project has no sudo make install path — if you need a system-wide binary, copy it there yourself.Uninstall
~/.local/bin/ff only. Zig caches are untouched.
Docker
The image contains theff binary, not your app. Mount the app or bake it into
a derived image:
ff.json inside the image does not carry the permission policy. Put the
--allow-* flags in the container command (or the image CMD). A listener on
port 3000 needs --allow-net=0.0.0.0:3000; static files read with fs need
--allow-read=/app/public (or whichever path the app uses).
The listen port comes from http.serve({ port }) (default 3000). The
runtime has no FF_PORT or --port override. If the app reads PORT, add
--allow-env=PORT and -e PORT=3000, then make the net scope match that port.
io_uring images need a permissive seccomp profile. Docker’s default profile blocks io_uring; run with--security-opt seccomp=unconfined, or build an image withzig build -Dio_uring=falsefor an epoll binary.
Other Make targets
Troubleshooting
Zig version mismatch —zig version must print 0.16.x. With 0.15 or earlier, download 0.16 from the link above and retry.
Make not found — macOS: xcode-select --install. Debian/Ubuntu: sudo apt install build-essential.
macOS: error: sub-compilation of libcxx failed / INFINITY — the selected SDK is the macOS 26/27 one from CommandLineTools, which Zig 0.16.0’s bundled libc++ cannot compile against. Run make doctor; it reports the state. Fix with sudo xcode-select -s /Applications/Xcode.app (the Makefile also selects Xcode automatically when CLT is active).
macOS: ld: unknown architecture arm64e.x1 — an older Xcode linker paired with a newer CLT SDK. The test fixture now builds with zig cc, so make test is unaffected; for other C projects either align xcode-select or set SDKROOT to the Xcode SDK.
ff: command not found after make install — ~/.local/bin isn’t on PATH. Add the export shown by Make, then open a new shell.
Permission denied while installing — prefer make install (user-local). Don’t sudo anything; this project has no system-install path.
Runtime PermissionDenied — the script hit an ungranted API. The message names the flag and scope, for example
http.serve requires --allow-net for '0.0.0.0:3000'. Add the flag to the
same command; ff.json and environment variables cannot grant it.
Docker: PermissionDenied in the logs — add the runtime flags to the
container command (or image CMD). A listener on port 3000 needs
--allow-net=0.0.0.0:3000.
Docker: connection refused — confirm http.serve({ port }) matches the -p mapping and the handler is actually registered (try FF_ECHO=1 smoke mode first). If the logs show PermissionDenied, fix the missing grant before debugging the port.
See also
- Quickstart — first script and server
- Permissions — flags, scopes, denial contract
- Deploy — production start commands and Docker
- CLI — every command and flag