Connecting Your Raspberry Pi to Wi-Fi or Ethernet and Remotely Accessing it from Anywhere in the World

A step-by-step guide on how to configure your Raspberry Pi for remote access, whether you’re using a wired connection (Ethernet) or wireless (Wi-Fi), enabling you to control and monitor your Pi from a …


Updated September 18, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


A step-by-step guide on how to configure your Raspberry Pi for remote access, whether you’re using a wired connection (Ethernet) or wireless (Wi-Fi), enabling you to control and monitor your Pi from anywhere with an internet connection.

Raspberry Pis are great for all kinds of home projects and automation tasks, but they can be hard to access if you’re not physically near them. In this article, we’ll cover how to configure your Raspberry Pi for remote access over the internet, using either a wired (Ethernet) or wireless (Wi-Fi) connection. This will allow you to control and monitor your Pi from anywhere with an internet connection.

Wireless (Wi-Fi) Setup

  1. Connect your Raspberry Pi to a Wi-Fi network:
    • First, connect your Raspberry Pi to the same Wi-Fi network as your computer or smart device using the onboard wireless adapter or an external USB adapter.
  2. Find your Raspberry Pi’s IP address:
    • Open a terminal window and enter ifconfig. Look for the “wlan0” interface (or “wlan1” if you have multiple Wi-Fi adapters) and note down the inet address listed under it. This is your Raspberry Pi’s local IP address on the network.
  3. Install an SSH server:
    • To remotely access your Raspberry Pi, you’ll need to install an SSH (Secure Shell) server. Enter sudo apt-get update && sudo apt-get upgrade in the terminal to make sure everything is up to date, then run sudo apt-get install openssh-server.
  4. Configure port forwarding on your router:
    • Your router needs to be configured to forward incoming connections from the internet to your Raspberry Pi’s local IP address. Log in to your router’s admin interface and look for a section labeled “Port Forwarding” or “Virtual Servers”. Add a new rule that forwards TCP port 22 (the default SSH port) to your Raspberry Pi’s local IP address and save the changes.
  5. Find your public IP address:
    • Go to a website like https://www.whatismyip.com/ to find out your router’s public IP address. This is the address that will be used to connect to your Raspberry Pi from outside your local network.
  6. Connect to your Raspberry Pi remotely:
    • On your computer or smart device, open an SSH client and enter ssh pi@<public_ip> (replace <public_ip> with the address you just found). You’ll be prompted to enter the password for the “pi” user. By default, this is “raspberry”.

Wired (Ethernet) Setup

  1. Connect your Raspberry Pi to an Ethernet cable:
    • Plug one end of the Ethernet cable into your router or modem and the other end into your Raspberry Pi’s Ethernet port.
  2. Assign a static IP address to your Raspberry Pi:
    • To make it easier to connect, assign a static IP address to your Raspberry Pi by editing /etc/dhcpcd.conf. Open the file with sudo nano /etc/dhcpcd.conf and add a line like this at the end: interface eth0\nstatic ip_address=192.168.1.10/24\nstatic routers=192.168.1.1\nstatic domain_name_servers=192.168.1.1 (replace 192.168.1.10 with an unused IP address on your network). Save and close the file.
  3. Install an SSH server:
    • Follow step 3 from the Wi-Fi setup above to install the SSH server on your Raspberry Pi.
  4. Connect to your Raspberry Pi remotely:
    • Open an SSH client and enter ssh pi@<static_ip> (replace <static_ip> with the static IP address you assigned in step 2). You’ll be prompted to enter the password for the “pi” user. By default, this is “raspberry”.

Now you can remotely access your Raspberry Pi from any device connected to the internet! This makes it easier to update software, monitor system logs, and control your home automation projects without being physically present. Just make sure to keep your Raspberry Pi secure by using strong passwords and enabling two-factor authentication if possible.

Remember, if you’re connecting over Wi-Fi, your router must be configured for port forwarding. If you’re having trouble connecting, double check the IP addresses and ensure that your firewall settings on the Raspberry Pi are allowing incoming connections.