NEWAI chat: ask your fleet anything, in plain language. Chat with your fleet Read more →
How-to · Remote access

How to access a Raspberry Pi remotely from anywhere, even behind NAT or a cellular modem

To reach a Raspberry Pi from anywhere, pick a method where the Pi connects out, because forwarding a port on the router fails behind CGNAT, cellular modems and routers you don't control: a reverse SSH tunnel, a VPN overlay, a cloud tunnel service or an agent with a relay. With PhysicalFleet you run one install command from Fleet › Add machine on the Pi, and within seconds its terminal, its web UIs and its camera open in your browser over an outbound, encrypted connection on port 443, with no public IP, VPN or open port. Only owners and admins can open them, and every session is audited.

What you need

  • A Raspberry Pi running Raspberry Pi OS, 64-bit or 32-bit, or another Linux such as Ubuntu or Debian. A Pi 3, 4 or 5 on a 64-bit OS gets the agent's arm64 build, a 32-bit system on a Pi 2 or newer gets the armv7 build, and an original Pi Zero or a Pi 1 gets the armv6 build. The installer picks the right one.
  • At least 512 MB of RAM and 512 MB of free disk. The agent is one program of about 10 MB. On a Pi 4 with everything turned on it uses about 2% of one core and 33 MB of memory.
  • An internet connection that allows outbound TCP 443. A home router, a customer's Wi-Fi, a mobile network behind CGNAT, or a USB or HAT cellular modem all work. Nothing has to be opened inbound.
  • sudo on the Pi, once, to run the install command. After that you never need to be on its network.
  • A PhysicalFleet account with the owner or admin role. It is free for up to 3 machines.
  • A good power supply. An underpowered Pi throttles its CPU and drops USB devices, which looks like a network or software problem from far away.

Ways to access a Raspberry Pi remotely

On your own network, ssh <user>@<pi-address> is all you need. From outside, the problem is the network between you and the Pi. Home routers use NAT, many internet and mobile providers add carrier-grade NAT (CGNAT) so there is no public address to connect to at all, and the router at a customer site isn't yours to change. Each method gets around that differently:

MethodBehind CGNAT or cellular?What you run and look afterWatch out for
SSH with port forwarding on the routerNo: it needs a public IP address on the routerA router rule, often dynamic DNS, SSH keysAn open SSH port is scanned and guessed at all day. You need access to the router, which you rarely have at a customer site
Reverse SSH tunnel (ssh -R)Yes: the Pi dials outA server with a public IP, a systemd unit or autossh to keep the tunnel up, one port per PiTunnels drop quietly and need watching. Every Pi's keys and ports are yours to manage
VPN overlayUsually, if the overlay can relay traffic when a direct path failsThe VPN on every Pi and every laptop, its keys and its access rulesIt opens each Pi's whole network to every member unless you write rules. Some customer networks block VPN traffic
Remote desktop or VNCOnly through one of the methods aboveA desktop session and a VNC server on the PiHeavy on a small Pi and on a cellular link. Most robots run without a desktop
Cloud tunnel serviceYes: a client on the Pi connects out to the providerAn account, a client on each Pi, one tunnel per service you exposeA public URL in front of the Pi's service, so that service's login is your only lock. Setup per tunnel adds up across many Pis
An agent with a relay, which is how PhysicalFleet worksYes: the Pi connects out on TCP 443One install command per PiYou need an account with the provider, and sessions go through its relay

Which to pick: for a Pi on your desk, SSH on the local network is enough. For a Pi you can't walk up to, in a robot, at a customer site or on a cellular modem, pick a method where the Pi connects out. If you also want its web UIs and camera, or you have more than a handful of Pis, an agent saves you running a server, a VPN and a tunnel per Pi. The rest of this guide does it with PhysicalFleet. For the background, see remote access to robots behind NAT and firewalls.

Step 1: Install the PhysicalFleet agent on the Pi

In the PhysicalFleet dashboard, open Fleet and press Add machine. The dialog shows a one-line command that carries your organization's installer link and enrollment key. Run it on the Pi, over SSH or with a keyboard, while you still have it in front of you:

# paste the command from Fleet › Add machine: it carries your installer link and key
curl -fsSL <installer-link> | sudo sh -s -- --token <enrollment-key>

# optional: name and place the Pi at install time
curl -fsSL <installer-link> | sudo sh -s -- --token <enrollment-key> \
  --name pi-shelf-03 --group lab/shelf --tags pi4,camera

# no curl on a minimal image? wget works the same way
wget -qO- <installer-link> | sudo sh -s -- --token <enrollment-key>

Before it switches to the new agent, the installer checks the download's SHA-256 and signature and runs the program once on the Pi's CPU, so a corrupted download never installs. It ends with ✓ Agent installed and running. In the dashboard, the dialog goes from Waiting for machine… to Machine online, usually within about 10 seconds. Press Open machine.

On Raspberry Pi OS the agent runs as a systemd service, starts at boot, and comes with a small rescue program, the Guardian, that restarts it if it stops. To check from the Pi itself:

sudo pfagent status   # enrolled? connected? waiting for approval?
sudo pf status        # connection, lifecycle, data levels and switches

Running the same command again repairs or upgrades the agent and keeps the Pi's identity, history and settings. Flashing many Pis? The installer can also put the agent into a Raspberry Pi OS image you build with pi-gen (--image / in a chroot step), and each flashed card joins as its own machine on first boot.

Step 2: Check the Pi on its machine page

The machine page shows what the agent found, with no setup: the board and its revision (for example Raspberry Pi 4 Model B Rev 1.5), the OS, kernel, CPU and memory. Its Hardware tab covers what matters on a Pi you can't touch:

  • Metrics: every reading the Pi sends, in groups. Power has under-voltage and throttling as the Pi's firmware reports them. Sensors has every temperature, voltage and fan sensor the kernel exposes. A weak supply is diagnosed in plain words: the power supply is too weak: the CPU is throttled.
  • Storage: the health of each disk, with SD card wear, and filesystems that went read-only or report errors, raised as an issue.
  • Peripherals: what is plugged in: USB devices by name, serial ports, I2C devices and the GPIO lines in use, with what holds each line.
  • Cameras: each camera the agent found, with its format and the program using it.
  • Network: the Pi's network interfaces and their addresses.

The agent also reports the Wi-Fi signal, the cellular link and the ports the Pi listens on, with the program behind each one. While the page is open, the Pi sends readings every second and new log lines within about 2 seconds, so you can watch a problem as it happens. With many Pis, Observability › Hardware puts the same facts side by side in tables such as USB and buses, GPIO pins and Sensors.

Built-in alerts already watch every Pi: under-voltage, a temperature above 80 °C for 2 minutes, a disk more than 90% full for 5 minutes. To be told when a Pi drops off the network, see how to get an alert when a device goes offline.

Step 3: Open a terminal in your browser

Open Debugging › Remote, choose the Terminal tool, find the Pi with Find a machine and press Open terminal. Or press Terminal at the top of the Pi's page. You get a shell on the Pi in the browser, through the Pi's own outbound connection.

  • Owners and admins only, on online machines.
  • Up to 4 terminals per machine at once. A terminal closes after 30 minutes idle, and End session closes it now.
  • Switching to Ports or Cameras keeps the terminal running.

Commands worth running on a Pi you can't see:

vcgencmd get_throttled          # 0x0 means no under-voltage or throttling since boot
vcgencmd measure_temp           # SoC temperature
journalctl -u my-robot -f       # your robot's service log (use your unit name)
pf busy --reason 'debugging' --for 1h   # updates and reboots wait while you work
pf busy --clear                 # release it when you are done

Use the terminal to look and diagnose. A fix typed into one Pi is invisible to the next person and can't be rolled back. Once you know the fix, ship it to every Pi as a release: see how to update software on many devices.

Step 4: Open web UIs on the Pi, or next to it, with Ports

Many Pis serve a web page: a robot's own dashboard, a web UI built on rosbridge, a sensor's status page. In Debugging › Remote, pick Ports and the Pi. The list shows what the Pi listens on, grouped as Web services and Other ports, with the program behind each port. Pick one and it opens inside the page, or press New tab. Ports carries web pages: HTTP and WebSockets both go through, so live pages keep updating.

You can also type a port, or host:port for a device next to the Pi on its network:

8080               # a web UI on the Pi itself, even one that listens on 127.0.0.1 only
192.168.1.50:80    # the web page of a motor controller, IP camera or router next to the Pi

A service that listens only on 127.0.0.1 is still reachable, so you don't have to expose it on the Pi's network to use it from home. That is the main difference from forwarding a port on the router. One limit: Ports serves each page at a private link of its own, so an app that loads its files or next pages from the site root may show up broken or answer Not Found. Pages that use relative links work best.

Each Pi has a Forwarding policy on its page under Overview › Settings, and the Pi itself enforces it: Port forwarding on or off, and which targets are allowed. By default that is the Pi itself and private addresses. Cloud metadata and link-local addresses are left out unless an entry names them, and anything on the internet needs Beyond the local network or an entry under Allowed targets. A link ends after 15 minutes idle and a session lasts at most 8 hours. Close it with the X when you're done.

Only the person who opened a port is given its link: teammates see the port as in use. Keep the link to yourself and don't paste it into a chat. Closing the dashboard tab also closes your ports, so keep it open while you use a New tab. More in how to open a robot's web UI remotely.

Step 5: Watch the Pi's camera

In Debugging › Remote, pick Cameras and the Pi. The first camera starts live, and the buttons above it switch to another:

  • Live view in your browser, with no public IP.
  • Snapshot: a still up to 1280 pixels wide, kept with the Pi's files.
  • Record: a clip of what you watch, up to 10 minutes, saved for the team.
  • Save the last 1 min / 5 min: asks the Pi's flight recorder for what just happened, with the logs and metrics around it. Camera frames are in it only for cameras your software publishes on a compressed ROS image topic.

The agent reads USB webcams that deliver MJPEG or YUYV, which most do, and any camera published on a ROS image topic. If your robot's software already holds the camera and publishes it on ROS, frames come from that topic, so your software keeps its camera. A camera held by a program that doesn't publish on ROS isn't opened: the page names that program instead. A camera module on the Pi's ribbon connector delivers raw frames for libcamera, which the agent doesn't read, so publish its images on a ROS image topic to watch it here.

Live view is a stream of still frames, about 10 a second at most and up to 960 pixels wide, sized for a robot's uplink: good for watching a gripper or a shelf, not smooth video. It stops after 15 minutes; press Watch again to carry on. There is no continuous recording, so press Record, or save the last minutes right after something happens. More in how to view a robot's camera remotely. If the Pi drives an SO-101 arm, the SO-101 remote teleoperation guide shows how to move it from the browser.

Step 6: Reboot, restart the agent or update it

The ⋯ menu at the top of the Pi's page has Ping, Restart agent, Reboot machine and Update agent…. Reboot asks first: Reboot pi-shelf-03? Running apps stop until it's back. Every command is signed by the platform and accepted only by the Pi it names.

  • Ping answers when the Pi is reachable right now.
  • Restart agent restarts PhysicalFleet's agent only, not your software.
  • Reboot machine waits while your app holds a pf busy lock, so a robot in the middle of a task isn't cut off. A reboot that doesn't happen is reported.
  • Update agent… updates this Pi. For many Pis, OTA Updates › Releases offers Agent X is ready for N machines and updates them in waves. Agent updates are free, and a new version that doesn't come up healthy is rolled back on its own.

After a reboot the Pi shows offline at once and comes back online by itself. If its network drops instead, it shows offline after about 2 minutes. If the Pi is up but the agent can't reach the platform for 10 minutes, the Guardian checks in over HTTPS and the page says what it found, for example The Guardian checked in 3 min ago: the agent can't reach the platform (the agent process is running). So you know whether to look at the network or the Pi.

Step 7: Decide who can use what

Out of the box, owners and admins can use every remote tool on every online machine. You can narrow that at four levels, and when a tool can't run, the page says which level stopped it:

LevelWhereWhat it controls
PeopleEach person's role: Owner, Admin or MemberOnly owners and admins open terminals, Ports, live cameras and commands. Members see the fleet's data
The whole organizationSettings › Organization › Fleet › Remote accessRemote terminal, Remote web access and Live camera view, for every machine at once
One PiIts page › Overview › SettingsThe Remote terminal switch and the Forwarding policy
One Pi, for goodInstall flags, on the Pi--no-terminal, --no-forward, --no-camera

The install flags are stored and enforced on the Pi, so nobody can turn them back on from the dashboard, not even an owner:

curl -fsSL <installer-link> | sudo sh -s -- --token <enrollment-key> --no-camera

# --no-terminal  no browser terminal, no remote shell commands, no port forwarding
#                (reboot, restart agent, agent updates and signed releases still work)
# --no-forward   no Ports
# --no-camera    no snapshots, live view or camera images of any kind

When you re-run the installer later to repair or upgrade, pass the same flags again to keep them. Turning an organization switch off also ends the sessions already open, on every machine, within about 10 seconds.

Pis on cellular and customer networks

PhysicalFleet works the same behind CGNAT, on a cellular modem and on a customer's Wi-Fi, because the Pi only connects out, on TCP 443, encrypted. A few settings help on those links:

  • Bandwidth level. The default, Auto, means Normal, or Low by itself when the Pi's internet goes through a cellular modem. Set it per Pi in the Bandwidth box of its Overview › Settings, or for the fleet in Settings › Organization › Fleet › Machine defaults.
  • Data budget. For a SIM plan, set a monthly budget in MB. The agent measures what it sends, steps down a level while it is spending ahead of the budget, and sends only the essentials if it runs out.
  • What you ask for always works. Whatever the level or budget, a terminal, live camera, snapshot or command you open goes through.
  • Customer firewalls. Ask for outbound TCP 443 to PhysicalFleet's hosts (the list is in the docs in the dashboard). Behind a proxy, set HTTPS_PROXY and run the installer with sudo -E so it saves the proxy for the agent.
  • Customer sites. Use an enrollment key that needs an admin's approval (Fleet › Enrollment keys), so a copied command can't add machines, and install with --no-camera where cameras must never stream.

PhysicalFleet's Secure tunnel is a separate, optional, paid feature: it sends a machine's other internet traffic through an encrypted tunnel on networks you don't trust. You don't need it for remote access.

Security, audit and cost

  • Outbound only. The Pi opens encrypted connections out on TCP 443. There is no public IP, inbound port or VPN, so nothing new is exposed on the Pi's network.
  • Its own identity. The agent creates a private key on the Pi that never leaves it, and proves who it is with short-lived certificates it renews on its own. A copied SD card is detected and joins as a new machine.
  • Signed commands. A terminal, a reboot or a release reaches the Pi as a command signed for that one Pi, with an expiry. A command copied to another machine is rejected.
  • One-time credentials for each session. Your browser and the Pi each meet PhysicalFleet's relay with one-time credentials, and the Pi also proves itself with its certificate.
  • Port links are personal. Don't share a Ports link, and close it with the X when you're done.
  • A lost or sold Pi. ⋯ › Remove from fleet… stops its certificate working within seconds.

Every remote session is audited. Settings › Organization › Audit Log shows who opened a terminal, a live camera or a port, on which machine and when, and a port's entry when it closes also shows how long it was open and how much data moved. Only owners and admins see the log, and entries can't be edited or deleted. What is typed in a terminal isn't kept, so note what you changed.

Cost: what the terminal, Ports and live camera move counts as data transfer: $0.15 per 100 MB on a paid month, and free on the Free plan. A live camera moves the most, so close it when you're done. PhysicalFleet is free for up to 3 machines. See pricing.

When something goes wrong

What you seeLikely causeWhat to do
cannot reach https://… over HTTPS while installingNo network, a proxy, or a wrong clock: a Pi has no battery-backed clockCheck the connection and the time (timedatectl). Behind a proxy, set HTTPS_PROXY and run with sudo -E. Outbound TCP 443 must be open
the agent is enrolled but not connected yetA firewall blocks outbound TCP 443 to one of PhysicalFleet's hostsAsk for the hosts in the docs in the dashboard to be allowed. The agent keeps retrying
This machine is waiting for approvalThe enrollment key needs an admin's approvalAn admin approves it in Fleet (the Waiting for approval badge). The Pi joins right after
This machine is offline. It opens here as soon as it connects.The Pi lost its network or its powerIf the Pi is up and can reach the internet over HTTPS, the Guardian reports on the page after 10 minutes. Otherwise check the power and the Wi-Fi or modem on site
The terminal is off for this machine (machine settings, or installed with --no-terminal).The Pi's Remote terminal switch is off, or it was installed with --no-terminalTurn the switch on in Overview › Settings. A flag is lifted only on the Pi, by running the installer again without it
The remote terminal is turned off for your organizationAn owner or admin turned it off in Settings › Organization › FleetAsk them to turn it back on
A port opens blank: Blank? Some apps refuse to be shown inside another pageThe app forbids being shown inside another pagePress New tab
A port's page loads without its styles, or a click answers Not FoundThe app loads its files or pages from the site root, which a Ports link doesn't carryUse the terminal for that app, or reach it on the local network
Port forwarding is off for this machineThe Pi's forwarding policy is off, or the target isn't allowedTurn on Port forwarding, or add the target under Allowed targets
No cameras found on this machine.No USB webcam or ROS image topic was foundPlug in a USB webcam, or publish the camera on a ROS image topic
Live view ended.A live view stops after 15 minutesPress Watch again
the power supply is too weak: the CPU is throttledUnder-voltage from the supply, often with cameras or motors on USBUse the official power supply, or a powered USB hub for the devices
This machine is quarantined: remote access is off until it's released.An admin quarantined the Pi, or a security watchdog did it automaticallyCheck what happened, then press Lift the quarantine on the Pi's Security tab
Checklist
  • A good power supply, and the Pi's clock right before you install
  • Outbound TCP 443 allowed from the Pi's network
  • Agent installed from Fleet › Add machine, and the Pi shows Machine online
  • Your web UIs listed under Ports, and the forwarding policy narrowed to what you use
  • Remote tools switched off where they aren't needed, with install flags at customer sites
  • A bandwidth level or data budget set for Pis on cellular
  • Live views closed when you're done: their frames count as data transfer
How PhysicalFleet helps

PhysicalFleet puts a Raspberry Pi's terminal, its web UIs and its camera in your browser with one install command, over an outbound, encrypted connection that works behind NAT, CGNAT, customer firewalls and cellular modems. You also see what matters on a Pi you can't touch: under-voltage, SD card health, temperatures, GPIO and USB devices. Only owners and admins can open sessions, every session is audited, and flags on the Pi block a tool for good. The same agent then updates your software on every Pi, with rollback.

See fleet management and remote access

Written for PhysicalFleet as of December 3, 2026.

FAQ

Raspberry Pi remotely: common questions

Something else? Talk to our team.

How do I access my Raspberry Pi from outside my home network?

On the same network, SSH is enough. From outside, use a method where the Pi connects out: a reverse SSH tunnel to a server you run, a VPN overlay, a cloud tunnel service or an agent such as PhysicalFleet. Forwarding port 22 on your router also works if the router has a public IP address, but it exposes SSH to the whole internet.

Can I reach a Raspberry Pi behind CGNAT or on a 4G or 5G modem?

Yes, but not with port forwarding on the router, because there is no public address to connect to. Use a method where the Pi connects out. The PhysicalFleet agent connects out on TCP 443, so it works behind CGNAT and on cellular, and with the default Auto level it drops to a lower data level by itself on a cellular modem.

Is it safe to open port 22 on my router for SSH?

It is risky. An open SSH port is scanned and attacked within minutes. If you do it, allow SSH keys only, turn off password logins and keep the Pi updated. A method where the Pi connects out leaves nothing open on the router.

Do I need a VPN to access my Raspberry Pi remotely?

No. A VPN overlay is one way, but a reverse SSH tunnel, a cloud tunnel service or an agent with a relay also work. PhysicalFleet needs no VPN, public IP or inbound port.

Which Raspberry Pi models does PhysicalFleet support?

Any Pi running Linux with at least 512 MB of RAM and 512 MB of free disk: a Pi 3, 4 or 5 on a 64-bit OS (arm64), a 32-bit OS on a Pi 2 or newer (armv7), and the original Pi Zero and Pi 1 (armv6). The installer picks the right build. Raspberry Pi OS, Ubuntu and Debian all work.

How do I open a web page running on my Raspberry Pi from anywhere?

With PhysicalFleet, open Debugging, Remote, Ports, pick the Pi and the port, and the page opens in your browser through the Pi's outbound connection, even if the service only listens on 127.0.0.1. To reach a device next to the Pi, type its address and port. Pages with relative links work best.

Does the remote terminal record what I type?

No. PhysicalFleet's audit log shows who opened a terminal, on which Pi and when, but not what was typed. Note what you changed, and turn lasting fixes into releases.

How much does remote access to a Raspberry Pi cost with PhysicalFleet?

PhysicalFleet is free for up to 3 machines. What the terminal, Ports and live camera move counts as data transfer: $0.15 per 100 MB on a paid month, and free on the Free plan.

From the lab bench. To the entire fleet.

Connect your first machine in minutes, develop it in the lab and run your whole fleet in production from one place.

Free for up to 3 machines · Then pay as you go