The Raspberry Pi computer has long ceased to be just a toy for enthusiasts and has become a fully-fledged platform for creating servers, media centers, and smart home systems. However, like any modern gadget, it requires a stable internet connection to install updates and function properly. The most convenient connection method is wireless, which eliminates unnecessary cables and allows the device to be placed anywhere in the home.
The connection process may vary depending on the operating system used and the presence of peripherals, such as a monitor or keyboard. In some cases, configuration is required before the first power-on, while in other cases, using the desktop graphical interface is sufficient. Understanding these nuances will help you avoid typical mistakes and save time.
In this guide, we'll cover all the current methods for connecting to a wireless network, from using the command line to automatic configuration at system boot. Whether you're using Raspberry Pi OS Lite or a full desktop version, you'll find a working solution for your task here.
⚠️ Note: Menu interfaces and utility names may differ slightly depending on the operating system version and distribution release date.
Equipment preparation and compatibility testing
Before you begin software configuration, you need to ensure that the device is physically ready. Most modern models, such as Raspberry Pi 3, 4, and Zero 2W, already have a built-in wireless module. However, owners of older versions, for example, Model B+ or the first revision, you will need to purchase an external USB adapter with Linux support.
It's critical to check your power supply, as power consumption increases sharply when the Wi-Fi module is activated. A weak power supply can lead to unstable operation, intermittent shutdowns, or file system corruption. Use a certified adapter that provides stable power. 5 volts and a current of at least 2.5 amperes for models with USB ports.
It's also a good idea to know your home network settings in advance. You'll need the network name (SSID) and password. Pay attention to the case of the network name, as the system distinguishes between uppercase and lowercase letters. If your router supports dual-band mode, make sure you know which frequency it supports. 2.4 GHz or 5 GHz — are you planning to connect?
- 📡 Make sure your board model has built-in Wi-Fi or a compatible USB dongle.
- 🔌 Use a high-quality power supply with sufficient current capacity.
- 📝 Write down the exact network name and password without errors.
- 📶 Check the signal level where the device is installed.
⚠️ Warning: Some cheap USB adapters may not be supported by the Linux kernel by default and require manual driver compilation, which is difficult for beginners.
Setting up Wi-Fi via the graphical interface (Desktop)
If you're using a version of the operating system with a graphical desktop environment, the process is extremely simplified and resembles setting up a regular laptop. In the upper-right corner of the screen, in the taskbar, you'll see a network icon. Clicking it will open a list of available wireless networks within range.
Select the desired network from the list and enter the password in the window that appears. The system will automatically save the configuration and attempt to establish a connection. If successful, the icon will change to indicate the signal strength, and the IP address assigned by the router will appear in the menu. the simplest method for users who don't want to work with code.
For more detailed settings, such as specifying a static IP address or DNS servers, go to the app menu. Open the "Settings" section and select "Network Settings." Here you can edit connection settings, manage profiles, and configure network priorities.
If automatic connection doesn't occur, try deleting the saved network profile and creating it again. Sometimes restarting the network manager via the terminal command helps. sudo systemctl restart NetworkManagerThis clears temporary errors and refreshes the list of available access points.
Connecting via a terminal using nmtui
For versions of the system without a graphical interface or when connecting via SSH, an excellent tool is the utility nmtuiIt provides a keyboard-controlled, pseudo-graphical interface, making configuration convenient even on a remote server. You can launch it by entering the command in the terminal and pressing Enter.
Once launched, you'll see a menu where you need to select "Edit a connection." Next, click "Add," select the "Wi-Fi" connection type, and click OK. In the "Device" field, enter the name of your wireless interface, usually wlan0In the SSID field, enter the name of your network, and in the security section, enter the password.
After filling in all the fields, scroll to the bottom of the list and select OK, then Quit. To activate the connection, return to the main menu and select "Activate a connection." Find the created profile in the list and click it to connect. If everything is correct, an asterisk will appear next to the network name, indicating an active connection.
sudo nmtui
Manual configuration via wpa_supplicant.conf
The most reliable and universal method, which works even during system boot, is directly editing the configuration file. This method is especially useful if you need to configure the Raspberry Pi headless before powering it on for the first time, simply by editing the file on your computer.
The configuration file is located at the path /etc/wpa_supplicant/wpa_supplicant.confTo edit it, use a text editor. nano with superuser rights. You need to add a block network at the end of the file, specifying your network parameters. The syntax requires strict adherence to the structure.
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Add the following lines, replacing the information with your own. Note that the password can be entered in cleartext or hashed. For most home networks, specifying the country, SSID, and password is sufficient. After saving the file and rebooting, the device will automatically attempt to connect.
country=RUctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="YOUR_NETWORK_NAME"
psk="YOUR_PASSWORD"
key_mgmt=WPA-PSK
}
How to generate a password hash?
For increased security, you can avoid storing the password in plaintext. Use the wpa_passphrase "SSID" "PASSWORD" command, copy the resulting hash, and paste it into the config file in place of the "psk" line.
It's important to remember about indentation: in Linux configuration files, indentation matters. Make sure that curly braces and parameters are inside the block network are aligned correctly. A syntax error will prevent the service from starting and the internet from connecting.
Automatic setup on first launch
Modern versions of the Raspberry Pi Imager installer allow you to configure Wi-Fi settings before writing the image to the memory card. This eliminates the need to connect a monitor or keyboard for initial configuration. When selecting an operating system in the Imager menu, click the gear icon.
In the "Advanced Options" window that opens, find the "Wireless LAN" section. Enter your network's SSID and password. You can also select your country here, which is a mandatory requirement for the Wi-Fi module to work on new OS versions. After applying the settings and flashing the image, the Raspberry Pi will automatically connect to the network the first time you turn it on.
This method creates a special file in the boot partition, which the system processes during startup. If the connection fails, check that the country is set correctly. Without this parameter, the wireless module may be blocked by software due to regional regulations.
☑️ Check before first launch
Diagnosing and troubleshooting
Even with proper configuration, situations may arise where the connection is unstable or completely lost. The first step in diagnostics is always checking the interface status. The command iwconfig will show whether the adapter sees wireless networks, and ifconfig wlan0 will tell you whether the IP address has been obtained.
If you don't receive an IP address, try restarting the network service. Newer versions of the OS use dhcpcd or NetworkManagerRestarting the service often resolves the issue of a frozen process obtaining an address from the router. It's also worth checking the system logs for authentication errors.
| Team | Description | What are we checking? |
|---|---|---|
iwconfig |
Information about wireless interfaces | Connection status, signal strength |
ifconfig wlan0 |
Network interface settings | Availability of an IP address |
sudo systemctl status dhcpcd |
DHCP service status | Is the address distribution service working? |
ping 8.8.8.8 |
Checking node availability | Is there internet access? |
A weak signal is a common problem, especially if the Raspberry Pi is installed in a metal case or located far from the router. In such cases, using a USB extender to extend the antenna (if using an external adapter) or installing an additional USB Wi-Fi module with an external antenna can help.
FAQ: Frequently Asked Questions
Why can't my Raspberry Pi see my 5GHz network?
Not all models support the 5 GHz band. Only the Raspberry Pi 3B+, 4, Zero 2 W, and newer support this frequency. If you have an older model or a cheap USB adapter, it only supports the 2.4 GHz band.
How to connect Raspberry Pi to a hidden network?
In the configuration file wpa_supplicant.conf you need to add a line scan_ssid=1 inside the network block. This will force the device to actively scan the air for hidden SSIDs.
Can you use a Raspberry Pi as a Wi-Fi hotspot?
Yes, this is possible. You'll need to install and configure the package. hostapd And dnsmasqThe device will be able to distribute Internet access received via Ethernet or another Wi-Fi adapter.
What should I do if Wi-Fi disappears after an update?
Sometimes kernel updates conflict with drivers. Try rolling back the update or reinstalling firmware packages: sudo apt install --reinstall firmware-brcm80211. Also check if the module is blocked in /etc/modprobe.d/.
⚠️ Note: If your connection drops frequently, try changing the Wi-Fi channel on your router to a less busy one (for example, 1, 6, or 11) to avoid interference with neighboring networks.