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:

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 CGNATTo open the pageLogs, health, updates
Port forwardingNoA browserNo
VPNYesThe VPN clientNo
TunnelYesA browserNo
Pinscope agentYesA browser, signed in or with a share linkYes

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.

More