Access your computer's localhost from your phone
Last updated:
You are building a web app and want to see it on a real phone, or you want to peek at a dashboard that only listens on localhost:3000. Port forwarding in RoamTerm opens that port on your phone through the same encrypted connection as your terminal.
Forward a port
- Start the service on your computer, for example a dev server on port 5173.
- In RoamTerm, open your machine and choose Ports, then add a forwarding: remote port 5173 on the computer, opened on the phone.
- Use the in-app preview browser to open it. The page loads as if
localhost:5173were on the phone.
What it is good for
- Checking a responsive layout on a real device while you code.
- Opening a local admin dashboard, a database UI or a docs preview.
- Calling a local API from a mobile build you are testing.
Safety notes
- Forwarded ports are reachable from your phone only, through your own paired connection. They are not published to the internet.
- Remove a forwarding when you are done; the list shows what is open.
- A service bound to
127.0.0.1on the computer works. A service that needs other hosts or special headers may need a small config change on the server side.
Port forwarding is part of RoamTerm Pro. For files instead of web pages, see SFTP file transfer.