Reaching a Raspberry Pi behind NAT, CGNAT or 4G
A Raspberry Pi in a customer's building, on a 4G router or behind carrier-grade NAT has no address you can connect to. There are several ways around that; they differ in what you have to run, and in who can open the page.
Port forwarding
Only works where you control the router and the network has a public address. Behind 4G and CGNAT it does not, and an open port on a Pi is a target.
A VPN: Tailscale, ZeroTier, WireGuard
The Pi joins a private network and you reach it by its VPN address. It works well for machines you own and people you trust, and everyone who opens the page needs the VPN client too. Tailscale's free plan covers a hobbyist; teams pay per user.
A tunnel: Cloudflare Tunnel, ngrok
The Pi keeps an outbound connection, and the service gives a local port a public HTTPS address. Good for one web app; nothing about the machine itself (logs, health, updates) comes with it.
An agent for the whole device
The Pinscope agent does what a tunnel does for the Pi's web interface, behind your login or a share link, and also:
- streams a log you choose, for example
journalctl -f; - reports memory, load, SoC temperature, disk and uptime, and alerts you when the Pi goes offline;
- takes an update from the dashboard, a file of any kind, and hands it to a command you choose:
dpkg -i,docker load, a script; - sits in the same dashboard as the ESP32 or Zephyr devices next to it.
curl -fsSL https://pinscope.dev/install.sh | sudo sh -s psk_...
It runs as a systemd service and makes one outbound connection on port 443. The Linux docs describe every option.
Which one
| Works behind CGNAT | To open the page | Logs, health, updates | |
|---|---|---|---|
| Port forwarding | No | A browser | No |
| VPN | Yes | The VPN client | No |
| Tunnel | Yes | A browser | No |
| Pinscope agent | Yes | A browser, signed in or with a share link | Yes |
Try it
Three devices are free, and no card is needed. Create an account, or read the guide for your platform: ESP32, Zephyr, Raspberry Pi Pico, Linux, ESP8266.