Self-host sshuttle
v2.0.0Poor-man's VPN that tunnels all your traffic via SSH
- Stars
- 13 654
- Requires
- OpenSSH
What is sshuttle?
sshuttle is a command-line tool that builds a VPN-like tunnel from your machine to any host you can reach over SSH, forwarding entire subnets instead of one port forward per service. It captures traffic using the operating system's own firewall facilities - iptables NAT rules or nftables on Linux, pf on macOS, FreeBSD, OpenBSD and pfSense, ipfw, and the TPROXY method when UDP is needed - and multiplexes established connections over a single SSH session, so it avoids the TCP-over-TCP penalty of openssh tunnelling. Convenience options relay DNS queries to the remote resolver, add the extra networks the remote host suggests, and merge discovered remote hostnames into a local hosts file. The far side needs no installation beyond a recent Python: sshuttle uploads its own source and runs it there, and no administrator privileges are required on the remote network, though you do need sudo or root locally. Install it with your package manager or pip and run it in the foreground, as a background daemon, or as a systemd notify service; running it on a router lets a whole LAN share the tunnel. Requires Python 3.10 or greater on both client and server, and Windows support is experimental and limited to IPv4 TCP.
sshuttle alternatives
TunnetTunnet is a self-hosted, open-source mesh VPN replacing Tailscale and ngrok with one stack: mesh, tunnels, SSH, file transfer, and Kubernetes integration.CompareTunnet with sshuttle
LantunnelLantunnel is a self-hosted, open-source mesh VPN connecting devices via direct P2P encrypted paths with relay fallback — no port forwarding needed.CompareLantunnel with sshuttle
ShellHubSelf-hosted, open-source SSH gateway to reach Linux and IoT devices from a web terminal or any SSH client, with session recording, audit logs and firewall rules.CompareShellHub with sshuttle
openvpnOpenVPN is an open-source, self-hosted VPN daemon for remote access and site-to-site tunnels, offering PKI auth, NAT traversal, TUN/TAP devices, and post-quantum TLS.Compareopenvpn with sshuttle
PritunlSelf-hosted distributed VPN server for OpenVPN, WireGuard and IPsec with a web console, SSO and 2FA, MongoDB-backed clustering and site-to-site links.ComparePritunl with sshuttle
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.Comparefxtun.dev with sshuttle
SshwiftySelf-hosted Web SSH & Telnet client enabling browser-based SSH and Telnet connections without additional software. Runs as Docker container with presets, TLS support.CompareSshwifty with sshuttle
mesh-router-tunnelSelf-hosted WireGuard VPN routing domain requests to Docker containers across networks with automatic HTTPS via Caddy.Comparemesh-router-tunnel with sshuttle
Should you self-host sshuttle?
sshuttle scores 69/100 on selfhost.directory (how scoring works) and ranks #10 of 56 in VPN. It has 13 654 GitHub stars, +56 in the last 30 days.
It shipped 1 stable release in the past year. The latest, v2.0.0, came out on 28 September 2026.
Setup is easy: most people get it running in one sitting. It is LGPL-2.1-licensed and written mostly in Python.
Its closest alternative on selfhost.directory is Tailscale (84/100, 38 833 stars). It scores higher overall, so compare the two before you pick. See sshuttle vs Tailscale side by side.
Features
- Automatic remote hostname discovery
- Automatic subnet detection
- Daemon mode with syslog and pidfile
- DNS Tunneling
- IPv6 Supportnat, nft, tproxy and pf methods; can be disabled
- Latency control tuning
- Multiple simultaneous tunnels
- No admin rights needed on remote server
- Passwordless sudo via generated sudoers fileLinux and MacOS; project warns the generated file is insecure
- Router mode for a whole LAN
- Selectable firewall methods
- Subnet and port-range selection with exclusions
- Systemd service support
- UDP forwardingTPROXY method only
- VPN-over-SSH tunneling
sshuttle README
As far as I know, sshuttle is the only program that solves the following common case:
- Your client machine (or router) is Linux, FreeBSD, MacOS, or Windows (experimental).
- You have access to a remote network via ssh.
- You don't necessarily have admin access on the remote network.
- The remote network has no VPN, or only stupid/complex VPN protocols (IPsec, PPTP, etc). Or maybe you are the admin and you just got frustrated with the awful state of VPN tools.
- You don't want to create an ssh port forward for every single host/port on the remote network.
- You hate openssh's port forwarding because it's randomly slow and/or stupid.
- You can't use openssh's PermitTunnel feature because it's disabled by default on openssh servers; plus it does TCP-over-TCP, which has terrible performance.
More in VPN
strongswanSelf-hosted open-source IPsec VPN: an IKEv2/IKEv1 daemon for site-to-site and road-warrior tunnels with X.509 or EAP auth on Linux, FreeBSD, macOS and Windows.
subspaceSelf-hosted, open-source web GUI for running a WireGuard VPN server: per-device configs with QR codes, SAML SSO with G Suite or Okta, and Let's Encrypt TLS.
SwizGuardSelf-hosted stealth VPN wrapping WireGuard in VLESS+REALITY+Vision to appear as HTTPS traffic to Microsoft.com, deployable on a VPS with one command.
TailGuardSelf-hosted Docker container that bridges WireGuard-only devices into a Tailscale network, advertising WG subnets to the tailnet with an optional monitoring web UI.
TailscaleTailscale is an open-source WireGuard mesh VPN client creating secure peer-to-peer networks across devices using a hosted coordination service.
Tailscale DERP DockerA Docker-based self-hosted Tailscale DERP server that relays encrypted traffic between tailnet devices when direct connections fail.
towoneltowonel is an open-source, self-hosted tunnel exposing HTTP(S), TCP, and UDP services behind NAT or CGNAT without inbound ports, using a persistent QUIC tunnel.
Transmission_VPNA self-hosted, open-source Docker container that runs Transmission and its web UI only while an OpenVPN tunnel is active, with presets for many VPN providers.
tsdproxyTSDProxy is an open-source, self-hosted reverse proxy that automatically exposes Docker containers on Tailscale with zero sidecars and automatic HTTPS.
TunnetTunnet is a self-hosted, open-source mesh VPN replacing Tailscale and ngrok with one stack: mesh, tunnels, SSH, file transfer, and Kubernetes integration.
usqueusque is a self-hosted, open-source reimplementation of Cloudflare WARP using MASQUE (RFC 9484) for secure tunnels as SOCKS5/HTTP proxies or TUN interfaces.
wagSelf-hosted WireGuard VPN gateway with MFA, route-based access policies, device enrollment, web admin UI, CLI, HA clustering, and auto TLS via Let's Encrypt.
0 comments