How to Setup WiFi in Ubuntu: Quick & Reliable Guide
In this article
Yes, you can connect your Ubuntu machine to Wi‑Fi with a few clicks. The process is straightforward: open the network settings, select your wireless network, enter the password, and you’re online.
What You'll Need
- Ubuntu 20.04 LTS or newer installed on a laptop or desktop with a Wi‑Fi adapter.
- Access to the Wi‑Fi network’s SSID and password.
- Administrator privileges (sudo) if you need to edit system files.
Step-by-Step
- Click the system menu in the top right corner of the desktop and select Settings. If you see a different label, look for an icon that looks like a gear or a wrench.
- In the Settings window, click Wi‑Fi in the left sidebar. The interface may show a list of available networks. If your network is not listed, click Turn On Wi‑Fi first.
- Find your network’s SSID in the list. If you’re on Ubuntu 22.04 or later, the SSID appears with a small lock icon if it’s secured.
- Click the SSID. A dialog will appear asking for the password. Enter the Wi‑Fi password exactly as it appears, keeping case sensitivity in mind.
- After typing the password, click Connect. The system will attempt to authenticate. A small spinner will show while the connection is being established.
- Once the connection succeeds, the network name will be highlighted in the list and a check mark will appear next to it. A notification will also pop up confirming you are online.
- To verify the connection, open a terminal (Ctrl+Alt+T) and run
ping -c 4 google.com. If you see replies, the network is working. - If you prefer using the command line, you can also connect with
nmcli:- List available networks:
nmcli dev wifi list - Connect:
nmcli dev wifi connect "YOUR_SSID" password "YOUR_PASSWORD"
- List available networks:
- For advanced users who want to edit the connection file directly, the configuration resides in
/etc/NetworkManager/system-connections/. Each file is named after the SSID. Edit withsudo nano /etc/NetworkManager/system-connections/YourNetworkand ensure thewifi-securitysection contains the correct key.
Common Mistakes
- Typing the password incorrectly. Wi‑Fi passwords are case‑sensitive and often include special characters.
- Leaving the Wi‑Fi toggle off. Some laptops have a physical switch that disables the adapter.
- Using the wrong network band. If your router broadcasts both 2.4 GHz and 5 GHz, ensure you connect to the one that matches your device’s capabilities.
- Not installing the correct drivers. Most built‑in adapters work out of the box, but external USB cards may need proprietary drivers.
- Assuming the network is secure when the SSID is hidden. Hidden networks still require the correct password.
Tips
- Pin the Wi‑Fi network in Settings for quick access later.
- Use
nmcli device statusto see the state of all network interfaces. - Enable Auto‑Connect in the network’s settings so Ubuntu reconnects automatically after a reboot.
- For routers with MAC filtering, add your device’s MAC address to the router’s allowed list.
- Keep your system updated:
sudo apt update && sudo apt upgradeto ensure the latest NetworkManager patches.
Troubleshooting
If the connection fails, follow these steps in order:
- Restart the NetworkManager service:
sudo systemctl restart NetworkManager. - Reboot the computer to clear any stale state.
- Check that the Wi‑Fi adapter is recognized:
lshw -C networkornmcli device status. - Verify that the router is broadcasting the SSID and that the password is correct.
- Look for error messages in the system log:
journalctl -u NetworkManager -b. - If you installed a third‑party driver, try removing it and reinstalling the default driver from Ubuntu’s repositories.
- As a last resort, delete the connection file in
/etc/NetworkManager/system-connections/and recreate the network from Settings.
Frequently Asked Questions
1. Why does my Wi‑Fi not appear in the list?
It could be turned off, the adapter may be disabled, or the router may be broadcasting on a band unsupported by your hardware.
2. Can I connect to a hidden network?
Yes, click Connect to Hidden Network in the Wi‑Fi list and enter the SSID and password manually.
3. How do I change the Wi‑Fi password after connecting?
Open Settings > Wi‑Fi, click the network, choose Forget, then reconnect with the new password.
4. My connection drops after a reboot. What should I do?
Enable Auto‑Connect in the network’s options or add the connection to the system‑connections folder with nmcli connection modify "SSID" connection.autoconnect yes.
5. Is it safe to use Wi‑Fi on public networks?
Public networks are less secure. Use a VPN if you need to protect sensitive data.
6. How can I see the IP address assigned to my device?
Run ip addr show wlo1 (replace wlo1 with your interface name) to view the IPv4 and IPv6 addresses.