The Raspberry Pi is a popular single board computer used for a variety of DIY electronics and programming projects. Out of the box, the Raspberry Pi OS does not come with a graphical network manager interface installed. Network Manager provides a simple, user-friendly way to create, manage, and store network connections on a device.
Benefits of Using Network Manager
Installing Network Manager on Raspberry Pi OS offers several benefits:
- Provides a graphical user interface for managing wired, Wi-Fi, and VPN connections
- Automatically connects to known Wi-Fi networks without having to enter passwords every time
- Allows users to easily switch between multiple stored network profiles
- Enables sharing of network connections with other devices
- Supports advanced features like MAC address randomization for privacy
Installing Network Manager
Installing Network Manager on Raspberry Pi OS only takes a few quick terminal commands. Here is the step-by-step process:
Update Package Lists
sudo apt update
This updates the package list to ensure the latest package versions are installed.
Install Network Manager
sudo apt install network-manager
This installs the Network Manager package along with any required dependencies.
Enable Network Manager
sudo systemctl enable NetworkManager.service
This automatically starts Network Manager whenever the system boots up.
Restart Raspberry Pi
Reboot to complete the installation and load the Network Manager service.
Once your Raspberry Pi finishes rebooting, Network Manager will be installed and enabled. The Wi-Fi icon should now show up in the top panel.
Connecting to Wi-Fi Networks
With Network Manager installed, connecting to Wi-Fi networks is straightforward.
- Click the Wi-Fi icon in the top panel.
- Select your desired network from the list.
- Enter the password when prompted.
Network Manager will automatically store the credentials for that Wi-Fi network going forward. The next time it is in range, your Raspberry Pi will automatically connect.
Managing Connection Profiles
Network Manager makes switching between different wired, Wi-Fi, and VPN connections easy.
To manage profiles:
- Click the Network Manager icon in the panel
- Select “Edit Connections”
- You can view, edit, delete, and add new connection profiles
This allows you to set up and store credentials for multiple networks ahead of time and quickly switch between them as needed.
Using the CLI
Advanced users can also manage Network Manager connections from the command line using the nmcli tool.
Some common nmcli commands include:
List network connections
Connect to a Wi-Fi network
nmcli device wifi connect SSID password PASSWORD
Disconnect from a network
nmcli device disconnect iface eth0
See man nmcli for complete usage details. The command line interface offers more advanced configuration options.
Optimizing Network Throughput
To get the best network performance out of a Raspberry Pi, there are a few network settings that can be tweaked.
1. Set Country Code
Setting the correct country code enables your Wi-Fi to use the optimal wireless channels.
Navigate to Localisation Options > Change Wi-fi Country
2. Configure Interface File
The /etc/network/interfaces file overrides Network Manager by default. Commenting out any settings forces connections through Network Manager.
sudo nano /etc/network/interfaces
Remove any auto eth0 or allow-hotplug eth0 lines
ctrl+x to save and exit
3. Test Network Speed
Use a network speed test tool to verify optimization improvements.
sudo apt install speedtest-cli
With these tweaks and Network Manager enabled, your Raspberry Pi can easily achieve 70-80 Mbps network speeds over Wi-Fi.
Here are some common issues and fixes when installing or using Network Manager:
Cannot Enable Network Manager Service – A firewall conflict can prevent the service from starting. Flush iptables to resolve:
sudo iptables –flush
sudo systemctl enable NetworkManager.service
No Wi-Fi Adapter Detected – Ensure your Wi-Fi dongle/built-in wireless is compatible with Raspberry Pi OS. The lsusb command will list connected USB devices.
Connected But No Internet Access – Check if the network requires a proxy server or captive portal authentication webpage to grant access.
Frequent Network Disconnects – Nearby appliances like microwaves can interfere with 2.4Ghz Wi-Fi signals. Switch to 5Ghz band or double check signal levels.
Network Manager Missing from Panel – It can accidentally be removed from the panel. Re-add by right clicking panel > Add/Remove Panel Items > Add Network Manager.
With some minor troubleshooting, Network Manager offers a smooth networking experience on Raspberry Pi OS.
- Network Manager provides a graphical interface for managing network connections
- Installation only takes a few apt terminal commands
- Enables easy switching between stored Wi-Fi, wired, and VPN configurations
- Optimize throughput by setting the correct country code and disabling interface overrides
- Resolve common issues like missing services, adapters, proxy authentication, interference, and UI failures
Installing Network Manager on Raspberry Pi OS greatly simplifies connecting to wired and wireless networks. Once installed, users can easily store credentials for multiple networks and quickly switch between them as needed without having to constantly re-enter passwords. Useful features like automatically reconnecting to known networks further improve the networking experience. With minor tweaks to optimize throughput combined with some basic troubleshooting knowledge, Network Manager delivers a robust, user-friendly networking solution.
Frequently Asked Questions
Q: Does Network Manager work on Raspberry Pi OS Lite?
A: No, Network Manager requires a desktop environment with a panel like PIXEL to display the user interface and icons. It does not work on the minimal Raspberry Pi OS Lite image.
Q: What is the difference between Network Manager and dhcpcd?
A: dhcpcd handles only DHCP address assignment whereas Network Manager provides a complete connection manager for creating, storing, switching between multiple wired, Wi-Fi and VPN connections.
Q: Can I import and export Network Manager profiles?
A: Yes, Network Manager stores profiles in /etc/NetworkManager which you can zip up and import to other Raspberry Pi devices to replicate the same network connections.
Q: Will enabling Network Manager slow down my Raspberry Pi?
A: There is negligible performance overhead. A few percent of CPU and RAM is used to enable its convenience features and graphical interface. Optimization tweaks can often increase throughput.
Q: Does the desktop environment matter for using Network Manager?
A: No, Network Manager works with all desktop environments like LXDE and Xfce as long as there is a top panel to display the network icon and manager. Without the GUI features, profiles can still be managed via CLI.
Q: Can I connect to hidden Wi-Fi networks?
A: Yes, when adding a new connection you can specify it is a hidden SSID network and input the details manually to connect to it. This allows connecting to networks that do not broadcast their name.
Q: Why are 5Ghz networks not showing up?
A: Check that your wireless adapter supports dual band 2.4Ghz/5Ghz. Also confirm the country code is set properly to allow scanning for 5Ghz networks, as some countries restrict the bands.
Q: How do I troubleshoot when networks constantly disconnect?
A: Frequent disconnects generally come down to three culprits: interference from nearby appliances, incompatible security settings, or poor signal strength/coverage in your location. Adjusting position, channels, bands and double checking encryption protocols can help.
Q: Can I create a hotspot with Network Manager?
A: Yes! You can configure a Wi-Fi or ethernet hotspot to share your Raspberry Pi’s network connection. This allows other devices like phones and laptops to route their traffic through your Raspberry Pi access point.
Q: Why am I getting “WiFi Hardware Error” messages?
A: This typically occurs when using an incompatible WiFi adapter. Ensure your WiFi dongle, PCI card, or onboard wireless chipset is supported in Raspberry Pi OS. See the wireless compatibility documentation to double check.
Q: How do I prevent Network Manager from managing a connection?
A: You can select “Unmanaged” when modifying or adding a new connection profile in Network Manager. This exempts just that connection from being handled by the manager while leaving others intact.
Q: Can I backup Network Manager profiles?
A: Yes, the files are stored in /etc/NetworkManager you can create compressed backups of. You can also export individual connection profiles from within Network Manager as a .nmconnection file to transfer to other devices.
Q: Why does the WiFi icon show disconnected when I’m connected?
A: Sometimes the icon cache needs to be refreshed. Restarting the Network Manager service with sudo systemctl restart NetworkManager.service will refresh the status icon and notifications.