Self-host fn-knock
v2.5.7Multi-platform secure gateway for NAS and home servers
- Stars
- 198
- Ports
- 7991 (Management web UI), 7999 (Gateway traffic (reverse proxy)), 7998 (Rust control plane API (internal)), 7997 (Auth service (internal)), 7996 (gRPC between Rust and Go (internal))
kcilnk/fn-knockWhat is fn-knock?
fn-knock is a high-performance secure gateway designed for NAS devices, software routers, and home servers. It uses a dual Rust (control plane) and Go (data plane) architecture with embedded SQLite storage, eliminating the need for external Redis or Node.js at runtime. The gateway consolidates reverse proxy, authentication (password, time-based one-time passwords, hardware security keys, OpenID Connect, and LDAP/Active Directory), SSL/ACME certificate management, multi-provider DDNS, WAF protection, IP allowlists, geo-blocking, and tunnel management (FRP and Cloudflared) into a single web console. It supports deployment on fnOS (FPK), OpenWrt (APK/IPK), Docker, Linux (systemd/OpenRC), macOS (launchd), Synology DSM 7 (SPK), and Windows (NSIS installer). The management UI runs on port 7991 and the gateway traffic port defaults to 7999. All configuration is managed through the web interface with optional environment variable overrides for container deployments.
Should you self-host fn-knock?
fn-knock scores 50/100 on selfhost.directory (how scoring works) and ranks #42 of 78 in Security. It has 198 GitHub stars.
It shipped 10 stable releases in the past year. The latest, v2.5.7, came out on 27 October 2026. New versions land roughly every 5 days.
Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Rust.
Its closest alternative on selfhost.directory is pentagi (83/100, 32 639 stars). It scores higher overall, so compare the two before you pick. See fn-knock vs pentagi side by side.
Features
- Audit logs and request logging
- Authentication (TOTP, Passkey, OIDC, LDAP)
- Backup and Restore
- Challenge/CAPTCHA (PoW, Turnstile)
- Embedded SQLite (no external DB)
- IP allowlist and geo-blocking
- Multi-platform deployment
- Multi-provider DDNS
- Reverse Proxy
- Service DiscoveryScans local IPv4 HTTP only; up to 16 CIDRs / 1024 hosts
- SSL/ACME certificate management
- System monitoring and notificationsDefault alert at 80% sustained for 30s; Windows lacks system monitoring
- Tunneling (FRP and Cloudflare Tunnel)
- WAF (Web Application Firewall)
- Web terminal (SSH)Local PTY disabled by default; only remote SSH on Docker, Windows, macOS, Synology
fn-knock README
FAQ
Where to enable request logs?
System Settings → Logs. After enabling, Request Logs appears in sidebar with date-based filtering of matched Host, upstream, and response status.
Why are fnOS share links being blocked?
fnOS share bypass works only for subdomain routing and tunnel modes, not direct mode. Check that /s/... requests route to fnOS; if another path rule or wrong default route captures it, bypass won't work.
How to handle .knock backup import warnings?
Warnings mean config restored but some runtime sync (gateway, WAF, SSL) failed. Keep admin access, check each warning item, manually re-save affected configs. Don't re-import same file repeatedly.
How to update/rollback/uninstall on macOS?
sudo knock update (install new), sudo knock rollback (revert), sudo knock uninstall (remove program/LaunchDaemon, keep config/data/logs), sudo knock uninstall --purge (interactive DELETE to fully wipe).
How to install on OpenWrt?
Install matching .ipk or .apk for your architecture. Access via Services → 敲门 Knock. Upgrade by installing new package; in-app FPK update not applicable. Config and data preserved at /etc/config/fn-knock, /etc/fn-knock/gateway, /etc/fn-knock/data.
Docker upgrade resulted in empty data - how to recover?
Stop writes, confirm old data volume exists. Current version uses SQLite; only Redis-to-SQLite migration runs when upgrading from early Redis versions. Don't delete old volumes or overlay with empty ones. Follow Docker deployment backup/migration steps.
Why should I configure HTTPS early?
HTTPS protects login credentials and session cookies, and is required for Passkey to work. Public domains, FRP, and Cloudflared public ingress should all use trusted certificates.
What's the difference between general blocklist and scanner blocklist?
Scanner blocklist: auto-bans based on unauthenticated anomalous path probing. General blocklist: admin manually bans specific IPs from logs or blocklist page. General blocklist only accepts exact IPv4/IPv6, not CIDR.
Why does login succeed but redirect back to login page?
Check: 1) auth and service domains use same public protocol, 2) root domain, cookie scope, and Passkey RP ID match, 3) browser allows cookies, 4) edge platform doesn't cache login response, 5) reverse proxy passes correct Host/X-Forwarded-Host/X-Forwarded-Proto, 6) system time is accurate.
Should Cloudflared use HTTP or HTTPS for origin?
Use HTTP if fn-knock local gateway has no certificate. Use HTTPS if local gateway has a valid certificate that Cloudflared trusts. When in different containers, use container name or LAN IP instead of localhost.
Do I need DDNS when using tunnels?
Usually not. FRP uses server address and external port; Cloudflared uses the Cloudflare Tunnel bound domain. Only configure DDNS if the tunnel ingress itself depends on a dynamic public IP.
Why can't I access my services from the internet even though the admin panel works?
Check: 1) correct network topology (public IP vs tunnel), 2) external traffic reaches gateway port (7999) not admin port (7991), 3) DNS points to correct ingress, 4) router port forwarding and host firewall allow traffic, 5) tunnel is online and targets correct local gateway, 6) request logs show the request.
How do I reset the admin password?
Use platform-specific reset commands: Docker (see Docker deployment docs), OpenWrt (see OpenWrt deployment), fnOS (re-enter from desktop), macOS (sudo knock reset-panel-password), Windows (use management app 'Clear admin password' or run .\fn-knock-service.exe reset-panel-password as admin).
Which entry point should I use: desktop icon or gateway port?
Use the desktop icon (fnOS/群晖/OpenWrt/macOS/Windows) for configuration, logs, and mode switching. Use the gateway port (default 7999) or external domain for verifying public access, domains, tunnels, or service mappings.
More in Reverse Proxy
frpfrp is a self-hosted, open-source fast reverse proxy that exposes local servers behind NAT or firewalls to the internet via TCP, UDP, HTTP, and HTTPS with P2P support.
fxtun.devfxTunnel is an open-source Go reverse tunnel for HTTP, TCP, UDP with custom subdomains, inspector, and desktop GUI. An ngrok alternative with servers in Russia.
geoblockSelf-hosted forward auth that allows or denies requests by country, ASN, IP range, domain, and HTTP method. Works with Traefik, NGINX, Caddy.
godoxyHigh-performance reverse proxy and container orchestrator for self-hosters
HAProxyHAProxy is a free, very fast and reliable reverse-proxy offering high availability, load balancing, and proxying for TCP and HTTP-based applications.
hotio/caddySelf-hosted Docker image of Caddy web server with Cloudflare DNS and rate limiting modules, WireGuard VPN support, and automatic HTTPS.
idle-lessSelf-hosted Docker reverse proxy that wakes sleeping servers via Wake-on-LAN when traffic arrives, saving power costs with a professional waiting screen during boot.
JauthSelf-hosted reverse proxy with SSL/TLS, SSH key and Telegram login auth, plus optional SSO for multiple domains.
JellyswarrmJellyswarrm is a self-hosted, open-source reverse proxy that merges multiple Jellyfin servers into one unified interface for browsing and playback.
Kong🦍 The API and AI Gateway
LoStackLoStack is a self-hosted Docker and Traefik proxy manager automating service routing, SSO via Authelia, with a 100+ package depot for one-click installs.
LuckySelf-hosted networking suite for routers: IPv6/IPv4 port forwarding, DDNS, reverse proxy, STUN tunneling, WOL, ACME certs, run as one Go binary with a web admin UI.
0 comments