DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Set Up Network Parental Controls on a Raspberry Pi
  • The Network Attach Problem Nobody Warns You About
  • Part II: The Network That Doesn't Exist: Zero Trust, Service Meshes, and the Slow Death of Perimeter Security
  • Breaking the Vendor Lock in Network Automation: A Pure Python Architecture

Trending

  • Navigating the Complexities of AI-Driven Integration in Multi-Cloud Environments: A Veteran’s Insights
  • Smart Deployment Strategies for Modern Applications
  • Comparing Top Gen AI Frameworks for Java in 2026
  • AWS Kiro: The Agentic IDE That Makes Specs the Unit of Work
  1. DZone
  2. Data Engineering
  3. IoT
  4. Accessing Raspberry Pi SSH and VNC From Outside of the Local Network

Accessing Raspberry Pi SSH and VNC From Outside of the Local Network

This article goes over the best methods to access Raspberry Pi or any embedded Linux-based device terminal and desktop remotely.

By 
Amit Ezer user avatar
Amit Ezer
·
Mar. 09, 21 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
21.9K Views

Join the DZone community and get the full member experience.

Join For Free

Raspberry Pi Single Board Computers are becoming more popular among both hobbyists and industrial IoT device vendors. Since its first announcement on February 29th, 2012, Raspberry Pi has made its way into hobby gaming consoles, industrial automation plants, smart avionics, and more.

Talking about IoT (both hobby and industrial/commercial level), the reason for integrating such a powerful microprocessor-based computer into a project or a product is the sheer processing power and expandability it brings to the table. What better way is there to let your Pi ‘talk to the world’ than to let it have a good, fast internet connection? Therefore, in this post, we will be discussing the options you have at hand on how to SSH into your Raspberry Pi from outside of your local network such as WiFi or LAN.

What’s SSH on Raspberry Pi?

*nix (Linux-based and Unix-based operating systems) have a fundamental feature to grant you access to your Linux server without having to physically visit the server or computer through the network. SSH stands for Secure Shell and is a secure communication protocol for executing commands remotely on a *nix based computer (i.e. system update commands, shutdown/reboot commands, etc.).

Why Would I Need to Access my Raspberry Pi Terminal and Desktop From the Internet?

There may be some situations in which you would like to connect to your Raspberry Pi (or any other Linux machine, for that matter) in order to do maintenance routing, such as updating or configuration, through SSH. From a local network perspective, this is as easy as typing ssh <username>@<ip address of Raspberry Pi> in a client such as Putty (i.e. ssh [email protected]).

However, when it comes to accessing your Raspberry Pi device outside of your network, this becomes a hassle since the device might not have a public IP address. Therefore, there are multiple methods that solve the case and help us access the Raspberry Pi terminal and desktop outside of the local network.

3 Methods to Access a Raspberry Pi Remotely

1. Router Port Forwarding

If your router allows port forwarding, you may expose the port 22 (default port for SSH connections) to the internet and using your network’s IP address, create an SSH connection with the Raspberry Pi. Note that if your IP is dynamic (which most of the networks today are), you’ll not be able to connect when the IP of your network changes.

2. Using a Remote Desktop Tool to Remotely Log Into Your Raspberry Pi and Open a Terminal

There are tools such as Teamviewer and Anydesk that can be installed onto Raspberry Pis that provide remote desktop access to your Raspberry Pi desktop. You may connect to your Raspberry Pi through such a method and open a terminal window on your Pi and execute shell commands there. (Note that this method only applies to Raspberry Pis that have a desktop environment running, and is not possible with ‘lite’ versions of Raspberry OS.)

3. Going With a Ready-to-Use Plug-and-Play Solution

Upswift.io provides a ready-to-use free platform to remotely access the terminal or the screen of Raspberry Pi, or any Linux-based device – Beaglebone, Nvidia Jetson Nano, etc. After registration to the platform, and connecting the Raspberry Pi, you will have the option to access it remotely, without any need to open router ports, or being in the same network.

raspberry pi Network

Opinions expressed by DZone contributors are their own.

Related

  • Set Up Network Parental Controls on a Raspberry Pi
  • The Network Attach Problem Nobody Warns You About
  • Part II: The Network That Doesn't Exist: Zero Trust, Service Meshes, and the Slow Death of Perimeter Security
  • Breaking the Vendor Lock in Network Automation: A Pure Python Architecture

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook