ssh port forward command
Generate SSH port forwarding commands for local, remote, and SOCKS tunnels
Build SSH tunnel commands for database access, internal dashboards, reverse forwarding, and browser proxy workflows, then copy the exact command you need.
Choose a forwarding mode, fill in the connection details, and copy a ready-to-run SSH command.
Forwarding mode
Forward a local port on your machine to a service reachable from the SSH server, such as MySQL, PostgreSQL, Redis, or an internal web panel.
Tunnel options
Generated command
Copy the command and run it in Terminal on your machine.
ssh -L 127.0.0.1:5432:127.0.0.1:5432 -p 22 -i ~/.ssh/id_ed25519 -N ubuntu@bastion.example.comAfter the tunnel command is ready, keep the rest of the workflow in DartShell
Manage SSH hosts, file transfer, and database access in one Mac workspace after the forwarding step is set up.
What this SSH port forward tool helps with
Tunnel databases without changing security groups
Use local forwarding when a database should stay private but still needs to be reachable from your laptop through SSH.
Share a local service through a remote machine
Reverse forwarding is useful for callbacks, demos, or webhook debugging when your local app needs a remotely reachable address.
Send traffic through a SOCKS proxy
Dynamic forwarding creates a reusable proxy endpoint for browsers and other tools that support SOCKS5.
Common SSH port forwarding examples
Forward local port 5432 to a remote PostgreSQL server
ssh -L 127.0.0.1:5432:127.0.0.1:5432 -N ubuntu@bastion.example.comExpose local port 3000 through a remote server
ssh -R 0.0.0.0:8080:127.0.0.1:3000 -N ubuntu@bastion.example.comCreate a SOCKS proxy on local port 1080
ssh -D 127.0.0.1:1080 -N ubuntu@bastion.example.comRelated guides
Guides for the tunnel you just generated
Connect to MySQL over SSH on Mac
Reach a database that only listens on a private network through an SSH tunnel.
Connect through an SSH jump host
Set up ProxyJump and a bastion host for production servers from a Mac.
SSH local port forwarding on Mac
Open a remote web app or database port on localhost with an SSH tunnel.
SSH with a private key on Mac
Sort out key permissions, passphrases, and authentication failures.