Connect your Raspberry Pi 5 to Wi-Fi by enabling the interface via nmtui or editing /etc/wpa_supplicant/wpa_supplicant.conf, then ensure SSH is active in the Raspberry Pi OS configuration. Verify the device has obtained an IP address using ip addr and confirm your local network router assigns consistent addresses to prevent connection drops during subsequent sessions.
Enabling Wi-Fi Connectivity
The first step to establishing a wireless SSH connection is ensuring the Raspberry Pi 5 actually connects to your local network. Unlike older models, the Pi 5 relies heavily on NetworkManager for modern network management tasks. You can interact with this system through a terminal-based user interface which is often less error-prone than manual file editing for beginners.
To use the text-based UI, open a terminal on the Pi (either via HDMI monitor or direct console) and run the following command:
nmtui
Select "Activate a connection" from the menu. Your available Wi-Fi networks should appear in a list. Choose your desired network, enter the password when prompted, and save the settings. The system will attempt to connect immediately. If you prefer command-line configuration, you must edit the wpa_supplicant.conf file located in /etc/wpa_supplicant/. Ensure your country code is set correctly at the top of the file, as this affects available channels and power limits.
After making changes, restart the networking service to apply them:
sudo systemctl restart NetworkManager
If the connection fails, check the status using nmtui again or review logs with journalctl -u NetworkManager. For detailed guidance on resolving specific connectivity errors, see our article on Troubleshooting SSH Connection on Raspberry Pi.
Verifying Network Assignment
Once Wi-Fi is connected, you must identify the IP address assigned to the Pi 5. Wireless connections are dynamic, meaning the IP can change if the DHCP lease expires or if the router restarts. Use the ip command to find the current address:
ip addr show wlan0
Look for the inet value under the wlan0 interface. It typically looks like 192.168.1.x or 10.0.0.x. If you do not see an IP address listed here, the Wi-Fi connection has not been established successfully. In such cases, verify that the SSID matches exactly, including case sensitivity, and that the signal strength is sufficient.
It is highly recommended to configure a static IP reservation on your router for the Pi 5's MAC address. This ensures that every time the Pi boots, it receives the same IP address, simplifying future SSH attempts. Without this, you might spend time looking up the new IP address after every reboot.
Activating the SSH Service
Raspberry Pi OS disables SSH by default for security reasons on fresh installs. To enable it, you can use the raspi-config utility. Open a terminal and type:
sudo raspi-config
Navigate to "Interface Options" and select "SSH". Choose "Yes" to enable the server. Alternatively, if you have headless access or prefer command-line methods, you can create an empty file named ssh in the root directory of the boot partition. On Raspberry Pi OS Bookworm and later versions, this method may require additional steps due to changes in how the SSH service is managed, so raspi-config remains the most reliable approach for general users.
After enabling SSH, verify that the service is running:
systemctl status ssh
You should see an "active (running)" status. If it is inactive, start it manually with sudo systemctl start ssh. For more complex authentication issues, particularly involving public keys, refer to our guide on Raspberry Pi 5: Can't SSH as a PIServer via Public Key from Windows 10.
Connecting from Your Local Machine
With the Pi connected to Wi-Fi and SSH enabled, you can now initiate the connection from your computer. Open your terminal (or PowerShell on Windows) and use the standard SSH syntax:
ssh [email protected]
Replace 192.168.1.XX with the actual IP address you identified earlier. The default username for Raspberry Pi OS is usually pi, although newer versions may prompt you to create a new user during initial setup. If you changed the hostname, you can also try connecting via the hostname instead of the IP, provided your local DNS or mDNS resolver is functioning correctly.
If the connection hangs or times out, ensure that your local firewall is not blocking outbound SSH traffic. Additionally, verify that the Pi and your computer are on the same subnet. Some routers isolate Wi-Fi clients from wired devices or vice versa, which can block local SSH access even if both devices are online.
Troubleshooting Common Issues
If you cannot connect despite correct credentials and IP addresses, several factors could be at play. First, check if the Pi is actually broadcasting its presence. You can ping the IP address from your computer to test basic reachability:
ping 192.168.1.XX
If the ping fails, the issue is network-level, not SSH-specific. Check your router's client list to see if the Pi is listed. If it is listed but unreachable, consider resetting the network adapter on the Pi. Second, verify that no other software on your local network is interfering with port 22. Third, ensure that the Wi-Fi signal is strong enough; weak signals can cause packet loss that disrupts the SSH handshake.
For issues related to specific operating systems like Ubuntu Server on the Pi, consult our troubleshooting guide for Troubleshooting SSH Connection Issues on a Fresh Install of Ubuntu Server 23.10 on a Raspberry Pi.
Frequently Asked Questions
Why can't I SSH into my Pi over Wi-Fi but can over Ethernet?
This usually indicates a firewall rule or router setting isolating the Wi-Fi network segment. Check your router's "AP Isolation" or "Client Isolation" settings and disable them if enabled. Additionally, ensure the Pi's Wi-Fi driver is fully updated.
How do I find my Raspberry Pi's IP address if I forgot it?
You can log into your router's admin page and look at the DHCP client list for a device named "raspberrypi" or matching the Pi's MAC address. Alternatively, use a network scanner app on your phone to discover active devices on your local subnet.
Is it safe to use Wi-Fi for SSH compared to Ethernet?
Wi-Fi is generally safe for SSH as long as your Wi-Fi network uses WPA2 or WPA3 encryption. However, Wi-Fi is susceptible to interference and signal dropouts, which can interrupt remote sessions. Ethernet provides a more stable connection for critical operations.
What should I do if the SSH connection is extremely slow?
Slow connections often result from high latency or packet loss on the Wi-Fi link. Try moving the Pi closer to the router or switching to the 5GHz band if supported. Also, ensure you are not congesting the bandwidth with heavy downloads while attempting to SSH.
Can I use a hostname instead of an IP address?
Yes, if your local network supports mDNS (Bonjour), you can connect using ssh [email protected]. This requires that your computer and the Pi are on the same network and that the .local domain resolution is working correctly on your host machine.