Access your Raspberry Pi over the internet
You can connect to your Raspberry Pi over the internet from another computer or a mobile device. There are a number of ways to do this, which we cover below.
One method is to set up port forwarding on your router. To do this, you must change the configuration of your router to forward all inbound traffic from the internet on a specific port to the local IP address of your Raspberry Pi. Most routers have this feature available. However, every router is different so you will need to consult your router's user manual for instructions. The settings can be tricky if your Pi is behind a firewall or if there is more than one router. One disadvantage of port forwarding is that it exposes a network port on your private LAN to the public internet. This is a known security vulnerability and must be managed carefully.
Alternative online services are available.
One secure alternative to port forwarding is remot3.it, by Weaved, Inc. remot3.it ("remote it") is software you install on your Raspberry Pi to access a single Pi, or manage a large number of Pis, from anywhere over the internet. Use remot3.it to access any TCP port on your Pi over the web including SSH, VNC, HTTP(S), RDP, and custom TCP services.
From the command line on your Pi, update your Raspbian package lists:
sudo apt-get update
Install the remot3.it package:
sudo apt-get install weavedconnectd
Next, run the remot3.it installer with this command:
The remot3.it installer will first ask you to create a user account by entering an email address and a password. Follow the on-screen menus to give your Pi a device name and choose what TCP ports/services to enable.
Now access your Pi over the internet by signing in to www.remot3.it.
For more detailed instructions and examples, see Getting Started with remot3.it for Pi.
Dataplicity allows you to connect and control your Pi's shell remotely from a web browser and its mobile apps. You can use Dataplicity's Wormhole feature to host a website or API directly from your Pi, and automatically enable HTTPS/SSL with no configuration or certificates.
It uses WebSockets over HTTPS to provide a connection, and requires a single-line install.
Dataplicity provides free support by e-mail and in-app messenger.
For more information, consult the documentation.