Supports Vercel deployment Β· Vercel deploy β
Stackedge runs any web app (Node.js, PHP, Go, Python, static sites...) in the background and exposes it through a Tor onion service. It works the same on an Android phone (Termux), a Debian/Ubuntu VPS, Fedora, Arch, Alpine or a Mac - no fixed ports, no fixed paths.
Your apps start immediately, Tor is installed and bootstrapped for you, and after a server reboot everything comes back on its own.
Features
-
Run any app from any folder - Node.js, PHP, Go, Python, anything with a command.
-
Any port: use
--port 8080,--port 4242, or none at all and stackedge picks a free one. -
Works everywhere: Termux, Linux servers, VPS, macOS. The Tor binary and all paths are auto-detected - nothing is hardcoded to one machine.
-
Installs Tor for you if it is missing (
apt,dnf,pacman,apk,zypper,brew, Termuxpkg). -
Survives reboots:
stackedge daemon installregisters a systemd service (or cron@reboot, or a shell hook on Termux) that restores your apps on boot. -
Coexists with a system Tor daemon: if the default control port is taken, stackedge automatically moves to a free one.
-
Built-in Security Engine: a lightweight Node.js reverse proxy with Nginx-style security headers, rate limiting, request limits, method and Host validation, path-traversal blocking, access logging and an audit score. Enabled by default, no Nginx required.
-
Vercel deployment: publish any app through its own Vercel FRPS gateway with
stackedge vercel init,deploy,probeandconnect. No incoming device port is needed. -
CLI similar to pm2:
start,stop,restart,delete,list,resurrect,logs, plusstackedge security <status|enable|disable|audit|fix|headers|logs|rules|reset>.
Open-source and focused on privacy & decentralization.
- Requirements
- Install
- Usage
- Commands
- Boot integration (reboots)
- Configuration
- Security Engine
- Data directory
- Dashboard & Screenshots
- Tor onion testing
- Project philosophy
- Support
Android / Termux
pkg update -y && pkg upgrade -y
pkg install nodejs git -y
Linux server / VPS (Debian, Ubuntu, Fedora, Arch, Alpine...)
Node.js 18+ (node -v to check). Everything else - including Tor - is installed for you.
Optional runtimes for your apps
Termux: pkg install php golang python -y
Debian: sudo apt install php golang python3 -y
npm install -g stackedge
If you plan to publish through Tor, run the one-shot setup. It installs Tor if missing and registers boot integration so your apps come back after a reboot. Vercel-only and local apps do not need Tor:
stackedge setup
Prefer to do it by hand? Then just run the two pieces separately:
stackedge daemon install # start apps on boot (systemd / cron / shell hook)
Verify:
stackedge # shows the command list
stackedge daemon status
Navigate to the project you want to host and start it:
cd ~/my-react-app
stackedge start blog --tor -- npm start
blogis the app name.- Everything after
--is the command used to start the app. - Pick
--tor,--vercel,--tor --vercel, or--local. With no provider flag, Stackedge asks interactively. --torpublishes an onion service;--vercelpublishes through the generated FRPS gateway;--tor --vercelkeeps both;--localdisables Tor and public publishing.--localcannot be combined with--toror--vercel. Older apps without provider data default to Tor for compatibility.
Output:
β blog running in background on port 45123
logs: /home/you/.stackedge/logs/blog.log
π http://generated-onion-address.onion
The onion URL is printed only for apps with Tor enabled. Vercel-only apps print the generated
deployment path instead, and local-only apps print Tor disabled.
Stackedge never forces ports. Pick one:
stackedge start api --port 8080 --tor -- node server.js
stackedge start site --port 4242 --vercel -- python3 -m http.server
stackedge start blog --local -- npm start # free port is picked for you
The port is also taken from, in this order:
--portflag- the command itself (
--port 4000,127.0.0.1:4000,http.server 8080) - the
PORTenvironment variable - any free port the OS hands out
Your app receives it through the PORT (and SSL_PORT) environment variables, so frameworks
that already honour PORT work without changes.
Apps that bind a specific interface can use --host:
stackedge start lan --host 10.0.0.5 --port 3000 --tor -- npm start
| Command | Description |
|---|---|
stackedge start <name> [--port <n>] [--ssl-port <n>] [--host <ip>] [--tor] [--vercel] [--local] -- <cmd> |
Start an app with a chosen hosting provider |
stackedge stop <name> |
Stop an app (kills its whole process group) |
stackedge restart <name> |
Restart an app on the same ports |
stackedge delete <name> |
Remove an app; updates Tor config only for Tor apps |
stackedge list |
Table of apps, states, ports and onion URLs |
stackedge list --full |
Same, plain text, never truncated (easy to copy) |
stackedge onion [name] |
Print the complete onion URL of one app (or all) |
stackedge resurrect |
Restore app processes, Tor onion services, and Vercel FRPC tunnels |
stackedge logs <name> [-n 100] |
Show recent app logs |
stackedge daemon <install|uninstall|status> |
Manage boot integration |
stackedge setup |
Install Tor if missing + install boot integration (for Tor apps) |
stackedge security status |
Show engine state, config path and score |
stackedge security enable / disable |
Turn the security engine on or off |
stackedge security audit |
Run configuration checks and print a score |
stackedge security fix |
Apply safe automatic fixes |
stackedge security headers |
Show currently injected HTTP headers |
stackedge security logs [-n 100] |
Show recent security events |
stackedge security rules |
Show active security rules |
stackedge security reset |
Restore the default security configuration |
stackedge start <name> --vercel -- <cmd> |
Start an app and generate its Vercel deployment |
stackedge vercel init <name> |
Generate a unique Vercel FRPS project and credentials |
stackedge vercel deploy <name> <url> |
Save the Vercel URL for the generated deployment |
stackedge vercel probe <name> |
Verify deployment identity, auth, worker polling and routing |
stackedge vercel connect <name> |
Start the outbound FRPC tunnel in the background |
stackedge vercel disconnect <name> |
Stop the tunnel |
stackedge vercel reconnect <name> |
Restart the tunnel |
stackedge vercel status [name] |
Show deployments and tunnel state |
stackedge vercel logs <name> [-n 100] |
Show tunnel logs |
stackedge vercel remove <name> |
Remove a Vercel deployment |
Stackedge generates one FRPS deployment per app. In --vercel mode, Tor is not installed and
not started; the app's torState becomes disabled and any old onion URL is cleared. Use
--tor --vercel when you want both publishing paths, or run stackedge vercel init <app> on an
existing Tor app to add Vercel without disabling Tor. The generated project is copied to
<your-project>/stackedge-vercel so it is easy to deploy from the app root; the CLI keeps its own
copy in ~/.stackedge/vercel/<app>/project.
The FRPC client stays inside this CLI and dials the deployment outbound through the local
Stackedge security proxy.
The generated config.json carries the service ID and token, so Hobby deployments work
without setting Vercel environment variables. Keep the generated project private because
that file contains a live bearer token. No VPS or incoming device port is required.
stackedge start myapp --port 3000 --vercel -- npm start
# deploy ./stackedge-vercel to Vercel
stackedge vercel deploy myapp https://myapp.vercel.app
stackedge vercel probe myapp
stackedge vercel connect myappTo add Vercel to an app that is already running locally:
stackedge start myapp --port 3000 --local -- npm start
stackedge vercel init myappThe generated api/gateway.js exports a Node HTTP server. Fluid compute is recommended so
/_frpc/poll can stay open for up to 20 seconds. The CLI starts multiple FRPC workers that pull
requests from the gateway and POST results back through /_frpc/result.
Always run stackedge vercel probe <app> before relying on the deployment. Public HTTP requests
can land on a different Vercel instance than the FRPC worker. For reliable Vercel routing, add a
free user-owned Redis database and set one of:
REDIS_URLREDIS_CONNECTION_STRINGSTACKEDGE_REDIS_URL
Upstash REST credentials are also accepted with UPSTASH_REDIS_REST_URL and
UPSTASH_REDIS_REST_TOKEN; KV_REST_API_URL and KV_REST_API_TOKEN are aliases. The generated
gateway uses a short-lived Redis request/result mailbox so every instance can serve public traffic.
Without Redis, the gateway falls back to an in-memory mailbox for local development only.
Probe results:
pull-redis: reverse pull with Redis is active.pull-memory: reverse pull with local in-memory state only.legacy: the deployment is outdated and must be redeployed.
Trade-offs:
- Without Redis, setup is simpler and still free, but Vercel can send a visitor request to a different instance than the FRPC workers, so routing is not reliable.
- With Redis, routing is cross-instance reliable, but the app needs a user-owned free Redis database, shared bodies are capped at 6 MiB, and requests can wait for the next worker poll.
- WebSocket tunnels are not used on Vercel because sockets are pinned to one Function instance; cookies do not affect Vercel instance affinity.
- Vercel Blob was not chosen as the default Redis-free mailbox because its free tier has monthly operation limits and higher latency.
stackedge daemon install picks whatever fits the machine:
- systemd (system service) - when running as root, or when passwordless
sudois available. Writes/etc/systemd/system/stackedge.serviceand enables it. - systemd (user service) - otherwise, writes
~/.config/systemd/user/stackedge.serviceand enables login lingering, so apps start on boot without anyone logging in. - cron
@reboot- for servers without systemd. - Shell hook - Termux and other systems: the line is added to
~/.bashrc/~/.zshrc/~/.profile, which is how apps are restored when Termux is opened.
Remove it again with stackedge daemon uninstall (your apps and data stay untouched) and
inspect it with stackedge daemon status.
On boot, stackedge resurrect restarts every app process. It publishes onion services only for
apps with Tor enabled and restarts FRPC workers only for Vercel deployments that have a saved URL.
Local-only apps restart without Tor or FRPC.
Termux auto-resurrect by hand (same thing the shell hook does):
echo 'if command -v stackedge >/dev/null; then stackedge resurrect >/dev/null 2>&1 & fi' >> ~/.bashrc
All settings are optional environment variables - nothing is hardcoded to one machine.
| Variable | Default | Meaning |
|---|---|---|
TOR_BIN |
auto-detected | Path to the tor binary |
STACKEDGE_HOME |
~/.stackedge |
Where apps, logs and Tor data live |
STACKEDGE_TOR_CONTROL_PORT |
9051 |
Tor control port (auto-moves if taken) |
STACKEDGE_TOR_SOCKS_PORT |
0 (disabled) |
Expose a local SOCKS port from Tor |
STACKEDGE_APP_HOST |
127.0.0.1 |
Address onion traffic is forwarded to |
STACKEDGE_BOOTSTRAP_TIMEOUT |
180000 |
How long to wait for Tor (ms) |
PORT / SSL_PORT |
auto | Default ports for the next start |
The Tor variables apply only to apps with Tor enabled. Vercel-only and local-only apps ignore
them and do not start or install Tor during stackedge start.
Example on a VPS where another Tor already owns 9051:
export STACKEDGE_TOR_CONTROL_PORT=9151
stackedge start blog -- npm start
Stackedge puts a lightweight HTTP security proxy in front of your app for both Tor onion traffic and Vercel FRPC traffic. No Nginx install, no extra system packages - the proxy is plain Node.js, so it works on Termux, Linux, VPS and macOS.
Tor network -> onion service --\
-> Stackedge Security Engine -> application port
Vercel FRPC -> HTTP request ---/ | rate limit / host + method + path checks
| body + header limits / timeouts
| security headers / access log
When security is enabled (the default), stackedge start allocates a loopback-only proxy
port for the app and starts the proxy as a detached process. Tor's HiddenServicePort 80 and
the Vercel FRPC target both point at that proxy instead of the application. The app itself keeps
listening on 127.0.0.1; public traffic never gets a direct route to the backend port. stop,
restart, delete and resurrect manage the proxy along with the app.
Edit ~/.stackedge/security.json (created with defaults on first write). All fields are
optional and are merged with the defaults:
{
"security": {
"enabled": true,
"headers": {
"x-frame-options": "DENY",
"x-content-type-options": "nosniff",
"referrer-policy": "strict-origin-when-cross-origin",
"x-xss-protection": "0",
"content-security-policy": "default-src 'self'"
},
"rateLimit": {
"enabled": true,
"requests": 100,
"window": 60,
"blockDuration": 300
},
"requestLimits": {
"maxBodySize": "10mb",
"maxHeaderSize": "16kb",
"timeout": 30000
},
"methods": ["GET", "POST", "HEAD", "OPTIONS"],
"directoryListing": false,
"pathTraversalProtection": true,
"hostValidation": true,
"allowedHosts": [],
"accessLog": true,
"connectionLimit": 100,
"cluster": {
"enabled": true,
"workers": "auto"
},
"tls": { "enabled": false, "cert": "", "key": "" }
}
}Notes on the defaults:
content-security-policyis intentionally strict. Applications that load external scripts, fonts or images need a custom CSP; change it, don't remove the whole header.allowedHostsis optional. Onion hostnames from the registry andlocalhostare accepted automatically.tlsprotects the local hop when other devices on the LAN can reach the proxy. The proxy still listens on127.0.0.1only. Certificate paths may be absolute or relative to~/.stackedge.cluster.workers: "auto"forks one proxy worker per detected CPU core (capped at 16) so traffic is not stuck on a single core. Set a number from1to64to tune it, orcluster.enabled: falsefor a single process. Rate limiting and the audit score stay global across workers; the per-worker connection cap isconnectionLimit / workers.- Only the security proxy is forked. Your app command is still started once: arbitrary apps cannot safely be duplicated (they may not be cluster-aware or may share writable state).
- Rule changes are picked up when the proxy restarts: run
stackedge restart <name>(orstackedge security enablefor every app). stackedge start --ssl-portkeeps the virtual443mapping pointed straight at the app's TLS listener. The security engine currently filters the HTTP (80) mapping only.- Tor clients do not have a meaningful public client IP. When a request arrives from loopback the rate limiter uses one shared bucket, so it protects the backend from flooding but cannot distinguish individual onion users. Don't rely on IP blocking for onion services.
Rejected and completed requests are written as JSON lines to
~/.stackedge/logs/security.log. Query strings and header values are not logged. Application
output stays in ~/.stackedge/logs/<name>.log.
stackedge security status # is it on, where is the config, current score
stackedge security headers # effective headers
stackedge security rules # effective rules
stackedge security logs -n 50 # recent security events
stackedge security audit # checks + score
stackedge security fix # safe fixes, e.g. restore missing critical headers
stackedge security enable # enable and restart all proxies
stackedge security disable # stop proxies and point Tor straight at apps
stackedge security reset # restore defaults
security audit checks real state: Tor reachability, loopback bindings, wildcard listeners on
backend ports, required headers, size limits, rate limiting, traversal/Host/directory rules,
access logging, TLS, running proxies and process privileges.
STACKEDGE SECURITY AUDIT
[PASS] Tor service running - control port is open
[PASS] Application bound to localhost - 1 app(s) bound to loopback
[PASS] Security headers enabled - 5 headers active
[WARN] TLS for local connections - not configured
Security Score: 85/100
1 recommendation available.
~/.stackedge/
βββ apps.json # registry: apps, ports, onion addresses, proxy state
βββ security.json # security engine rules and headers
βββ logs/ # <name>.log for every app + security.log
βββ tor/
βββ torrc # regenerated from the registry on every change
βββ control-port # control port actually in use
βββ hidden/ # onion keys, one folder per app
Created automatically on first run. Older ~/.tor data is imported once so existing onion
addresses are kept.
Dashboard View of running apps
Running Logs in Stackedge
Quick .onion testing (no Tor install required)
π 4everproxy Tor Proxy
- Useful for basic availability checks
- No local Tor setup required
- Not recommended for privacy-critical use
- Some onion services may not fully load due to proxy limitations
For development, debugging and serious privacy testing, use Tor Browser or a local Tor daemon.
-
Open-source: learn, modify and contribute.
-
Privacy-focused: Tor integration keeps your apps accessible anonymously.
-
Decentralized hosting: your phone or your VPS becomes your own server.
Built for developers, hackers and privacy enthusiasts who like Termux and building things.
Check out my other projects and tutorials: here
If you value open-source and anonymity, support me so I can keep building decentralized hosting tools:
License
MIT License - open source for everyone.
.png)

