Terminal & Remote Access

Preview a Development Server with SSH Port Forwarding

By TermSquad · Last reviewed

Use SSH port forwarding to open a development server running on TermSquad in your own device’s browser. The local tunnel connects a port on your device to the server’s port on the computer.

If you only need to see the app, or want an agent to test it, you can skip the tunnel: the Browser panel in the agent terminal opens localhost directly on your computer. See Watch and Control Agents in the Browser.

Start the development server

In the TermSquad terminal, enter your repository and run its documented development command. Note the listening port. This example assumes the app responds on 127.0.0.1:3000 on the remote computer.

Keep the server running in its own pane. A message containing a URL does not mean that URL is already reachable from your laptop.

Open the tunnel on your own device

Replace YOUR_HOSTNAME with the value under Settings → SSH access:

ssh -N -L 127.0.0.1:3000:127.0.0.1:3000 agent@YOUR_HOSTNAME

Authenticate, leave this local terminal open, and visit http://127.0.0.1:3000 in your local browser. The explicit local address restricts this example’s listener to your own device. OpenSSH documents the forwarding syntax under the -L option.

If it does not load

  • Confirm the remote server is still running.
  • Check that the last port in the tunnel command matches the app’s listening port.
  • If local port 3000 is occupied, change the first port to 3001 and visit http://127.0.0.1:3001.
  • Make sure SSH connected successfully before testing the browser.

Press Ctrl+C in the local tunnel terminal to close the tunnel. This does not stop the remote server. A tunnel is a private development preview, not a public deployment URL.

See Connect with SSH and terminal panes.