SSH port forwarding from your Mac's menu bar.
PortForward is a small, native macOS menu bar app for SSH local port forwarding. Set up your tunnels once, then connect and disconnect each one with a single click. It uses the system ssh and your existing ~/.ssh/config, so there are no extra keys, passwords or daemons to manage.
- One-click tunnels. Click a connection in the menu to connect or disconnect it.
- Picks up where you left off. Connections that were on when you quit reconnect automatically the next time the app opens.
- Live status. A green dot marks active connections and a red dot marks failed ones, with the error shown right in the menu. The menu bar icon fills in while any tunnel is up.
- Several ports per host. Forward as many ports as you need over a single SSH connection, and run several hosts at once.
- Works with your SSH config. Use any host alias from
~/.ssh/config. Authentication goes through your SSH agent and config. - Saves as you type. Valid changes save automatically. Incomplete entries are flagged in Settings and never replace a working configuration.
- Local by default. Forwarded ports listen on
127.0.0.1. Turn on Allow connections from other devices for a connection to share its ports with your network. - Lightweight. Native AppKit, no dependencies, no Dock icon.
- macOS 13 Ventura or later
- Xcode 26 or later to build
- Key-based SSH access to your servers (for example, through
ssh-agentor the macOS Keychain)
- Clone this repository and open
PortForward.xcodeprojin Xcode. - Select the PortForward scheme and My Mac.
- Press Run (⌘R).
To keep a copy, choose Product → Archive, or copy PortForward.app from the build products folder into /Applications.
- Click the ⇄ icon in the menu bar and choose Settings….
- Click + to add a connection, then fill in:
- Name — optional. Shown in the menu; defaults to the host.
- Host — a hostname or an alias from
~/.ssh/config. - User — optional. Leave blank to use your SSH config.
- Allow connections from other devices — optional. Lets other devices on your network use the forwarded ports.
- Under Forwarded Ports, click + and enter the Port on remote server. Set the Port on this Mac only if it should differ.
- Close Settings and click the connection in the menu to connect.
Your service is then available at localhost:LOCAL_PORT on your Mac.
For each connection, PortForward runs one ssh process equivalent to:
ssh -N -T -o BatchMode=yes -o ExitOnForwardFailure=yes \
-o ControlMaster=no -o ControlPath=none \
-L BIND_ADDRESS:LOCAL_PORT:localhost:REMOTE_PORT [-l USER] HOST-
BIND_ADDRESSis127.0.0.1, or0.0.0.0when Allow connections from other devices is on. macOS may ask whether to accept incoming connections the first time. -
localhostin the forward is resolved on the remote server, so you reach services bound to the server's loopback interface. -
BatchMode=yesmeans the app never prompts for passwords. If SSH needs one, the connection fails and shows the error instead. -
ExitOnForwardFailure=yesfails fast if a port can't be bound, for example when it's already in use. -
Editing or removing a connection disconnects it once the change saves.
Settings, the connections to restore on launch, and a record of running SSH processes are kept in ~/Library/Application Support/PortForward/. When the app quits, it stops its SSH processes. On the next launch, it cleans up any left behind by a crash, after verifying each one by PID and a unique marker on its command line.
PortForward is released under the MIT License.