Guide

SSH tunnels on a VPS

Last updated: 15 November 2026

An SSH tunnel carries traffic through your encrypted SSH connection. It lets you open a service that listens only on the server's 127.0.0.1 (a database admin page, a dashboard) without exposing it to the internet, and it can act as a SOCKS proxy that sends your browser traffic out through the server. Use it only for lawful purposes and follow the acceptable use policy.

Fast VPS from $7.99 a month

See Fast VPS plansHow ordering works

Reach a private service (local forward)

Suppose an app on the server listens on port 3001, bound to localhost (like Uptime Kuma). On your own computer run:

ssh -N -L 8080:127.0.0.1:3001 USER@YOUR-IP

Leave it running and open http://127.0.0.1:8080 in your browser: the page comes from the server. -N means "no remote command, only forward". Press Ctrl+C to close the tunnel. Add -p PORT if SSH is on another port.

A SOCKS proxy through the server (dynamic forward)

ssh -N -D 1080 USER@YOUR-IP

Now set your browser or app to use a SOCKS5 proxy at 127.0.0.1 port 1080. Websites then see the server's IP address. Only the traffic of the apps you point at the proxy goes through it, and DNS goes through it only if the app is set to use the proxy for DNS. For a full VPN see WireGuard.

Keep it tidy

Fast VPS from $7.99 a month.

Questions and answers

What does ssh -L do?
It forwards a port on your computer to a port on or behind the server through the SSH connection, so you can open a service that listens only on the server's localhost.

How do I use my VPS as a SOCKS proxy?
Run ssh -N -D 1080 USER@YOUR-IP and set your browser or app to use a SOCKS5 proxy at 127.0.0.1 port 1080.

Does the SOCKS proxy cover all my traffic?
No, only the apps that you point at the proxy. DNS goes through it only if the app is set to use the proxy for DNS. For all traffic use a VPN such as WireGuard.

How do I stop the tunnel?
Press Ctrl+C in the terminal where it runs.

Ready to try it? Fast VPS from $7.99 a month

See Fast VPS plansHow ordering works