Skip to main content
A deploy is: get the binary — prebuilt with curl -fsSL …/install.sh | sh (see Installation), pull ghcr.io/abdelmjidouhamane/ff:latest, or build from source (below) — get your code on the box, start it with ff start (or ff server.js), and verify with FF_ECHO before opening traffic.

Permissions

Production runs deny-by-default just like local runs. ff start does not read permissions from ff.json or from environment variables — pass the --allow-* flags on the command line, after start:
Minimum for a normal web service:
  • The listener always binds 0.0.0.0; the scope must name 0.0.0.0:<port>, not the platform’s public hostname or 127.0.0.1.
  • The policy is fixed at launch. There is no signal or API to add a scope while the process runs.
  • --allow-all exists for fully trusted apps but gives up every boundary; do not use it as a deploy default.
  • FF_ECHO is runtime configuration, not app env: it needs no --allow-env, and it does not bypass the listener’s --allow-net.
A missing grant usually fails at startup with PermissionDenied and a non-zero exit; check the process logs before debugging the platform. Full model: Permissions.

Serverless and edge deployments

Fairyfly is built for the serverless shape: one binary, fast cold starts, roughly 5 MB RSS on Apple silicon, no npm install for the core, and a process that exits when the event loop drains. Use ff start as the entrypoint and read the port from the platform:
It runs anywhere a Linux binary or container runs: container-based serverless platforms, edge VMs, and long-lived containers. It is not a V8-isolate runtime, so it does not run inside Cloudflare Workers. Keep the health check short, move CPU-bound work to a Worker, and remember that the process exits when the event loop drains. See Limitations for the connection, response, timer, and worker caps.

Quick look

Build and install

Installs land in ~/.local/bin/ff, not /usr/local/bin. If ff isn’t found after install, add the dir to PATH:
There is no make build-native target. On Linux the I/O backend is io_uring by default; build with zig build -Dio_uring=false for an epoll binary that runs anywhere. See the README’s “I/O backend on Linux” for the kernel and seccomp requirements.

Run with ff start

ff start reads main from ff.json and runs it — this is the production entrypoint:
The listen port comes from http.serve({ port }) in your code (default 3000, binds 0.0.0.0). Match whatever your platform expects:
No FF_PORT, no --port flag. If deploys get connection-refused, the port in code and the platform’s expected port disagree — that’s the first thing to check. The net scope must match the same port.

Docker

ff.json carries the entrypoint, not the permission policy. Keep the --allow-* flags in CMD (or the platform’s start command). If the app reads PORT, add --allow-env=PORT and make the net scope match. The -p mapping must match the port in http.serve({ port }) — the container binds 0.0.0.0 already, so only the mapping can be wrong.
io_uring images need a permissive seccomp profile. The published image is built with io_uring; Docker’s default profile blocks it and the process exits at startup with ff: I/O backend unavailable…. Run with --security-opt seccomp=unconfined, or build your image with zig build -Dio_uring=false for a run-anywhere epoll binary.

Smoke-test before traffic

Start with FF_ECHO=1 so every request returns canned 200 {"message":"ok"} without running app logic. This separates “is the deploy reachable” from “does my code work”:
Echo mode bypasses the handler, not the listener check — the --allow-net grant is still required.

TLS in production

Terminate TLS in Fairyfly with a real certificate (see the TLS guide for the full walkthrough):
Both must be given together; on success the same port serves HTTPS and WSS alongside plain HTTP/WS. The CLI reads --cert / --key / FF_CERT / FF_KEY before the runtime starts, so those paths need no --allow-read — but a tls object inside your app is a runtime read and does. Behind a platform load balancer that terminates TLS for you, skip these and serve plain HTTP. The listener still needs --allow-net=0.0.0.0:<port>.

Practical example: health-checked service

Point your platform’s health check at /health and assert on ok: true.

Troubleshooting

PermissionDenied at startup — the listener port is outside every --allow-net scope. Add --allow-net=0.0.0.0:<port> to the ff start command (or Docker CMD). 127.0.0.1 and the platform hostname will not match the bind address. process.env.PORT is undefined in production — add --allow-env=PORT. The variable is filtered out of process.env, while the platform may still have exported it. ff.json and env vars cannot grant this. TLS files denied in production — CLI --cert / --key are read before the runtime and need no --allow-read. A tls: { cert, key } object in the app is a runtime read: add both paths, or switch to the CLI form. Connection refused after deploy — port mismatch: compare http.serve({ port }), PORT, the --allow-net port, and the Docker -p / platform port. Nothing overrides the code port. ff: command not found — ~/.local/bin isn’t on PATH. Export it and open a new shell. TLS didn’t start — both cert and key required, within size caps (cert ≤ 512KB, key ≤ 256KB), paths readable by the process user. A PermissionDenied message means a runtime tls path lacks --allow-read; a TypeError means a malformed or mismatched pair. App boots but handlers 504 — the 30s watchdog is firing under load. Move heavy work to Worker threads (max 8) and reply early. ff: I/O backend unavailable — this binary uses io_uring (Linux 5.1+, seccomp must allow io_uring_setup/io_uring_enter/io_uring_register). On Docker and most managed platforms the default seccomp profile blocks it: run with --security-opt seccomp=unconfined, or rebuild with -Dio_uring=false (epoll). The published image is an io_uring image.

See also