
How to Connect Wifi in Ubuntu? Ubuntu Connection Guide
Introduction Ubuntu is one of the most widely used Linux distributions, and wireless connectivity is a basic requirement for most users. Whether you are installing Ubuntu for the first time, setting up a fresh laptop, or troubleshooting a desktop that lost its
Introduction
Ubuntu is one of the most widely used Linux distributions, and wireless connectivity is a basic requirement for most users. Whether you are installing Ubuntu for the first time, setting up a fresh laptop, or troubleshooting a desktop that lost its wireless signal, knowing how to connect wifi in ubuntu? is an essential skill. This guide covers every practical method available, from the graphical desktop interface to command-line tools, so you can get online regardless of your environment.
This Ubuntu connection guide is written for both beginners and experienced users. If you are using Ubuntu Desktop with GNOME, the graphical method is usually the fastest. If you are working on Ubuntu Server, a headless system, or a minimal installation, the terminal-based approaches will be your primary option. We also cover hidden networks, enterprise WiFi, driver troubleshooting, and best practices to keep your connection stable and secure.
By the end of this article, you will understand exactly how to connect wifi in ubuntu? using the method that best fits your hardware and skill level.
Table of Contents
- Prerequisites Before You Connect WiFi in Ubuntu
- Check If Your WiFi Hardware Is Detected
- How to Connect WiFi in Ubuntu Using the Desktop GUI
- How to Connect WiFi in Ubuntu Using the Terminal
- Using nmcli to Connect WiFi in Ubuntu
- Using nmtui to Connect WiFi in Ubuntu
- Connecting to Hidden WiFi Networks in Ubuntu
- Connecting to WPA2 Enterprise WiFi in Ubuntu
- Troubleshooting Common WiFi Connection Issues in Ubuntu
- Fixing WiFi Driver Issues in Ubuntu
- Tips and Best Practices for Ubuntu WiFi Connections
- Comparison: GUI vs Terminal vs nmtui
- Frequently Asked Questions
- Conclusion
Prerequisites Before You Connect WiFi in Ubuntu
Before you attempt any connection method, make sure the following items are in place. Skipping these basics is the most common reason people struggle when figuring out how to connect wifi in ubuntu?
- Ubuntu installation: You should have Ubuntu Desktop or Ubuntu Server installed and running. This guide applies to recent versions such as Ubuntu 22.04 LTS and Ubuntu 24.04 LTS.
- Wireless adapter: Your computer must have an internal WiFi card or a compatible USB WiFi adapter.
- Network details: Know the SSID (network name) and password for the WiFi network you want to join.
- User privileges: Some terminal commands require administrator rights, so you should be able to use
sudo. - Physical switches: Laptops often have a function key or hardware switch that enables or disables wireless radios. Make sure it is turned on.
If you are on a fresh Ubuntu Server installation, you may not have a graphical interface at all. In that case, focus on the terminal sections later in this guide.
Check If Your WiFi Hardware Is Detected
Ubuntu usually detects WiFi hardware automatically, but it is wise to verify before trying to connect. Open a terminal and run the following commands to inspect your wireless devices.
First, list network devices recognized by the kernel:
lspci -knn | grep Net -A3
If you are using a USB WiFi adapter, use this instead:
lsusb
Next, check whether the wireless radio is blocked. Ubuntu uses rfkill to manage wireless devices:
rfkill list
Look for a line that says Wireless LAN. If you see Soft blocked: yes or Hard blocked: yes, the radio is disabled. You can unblock it with:
sudo rfkill unblock wifi
You can also use NetworkManager to see device status:
nmcli device status
If your WiFi adapter appears as wlan0 or wlp2s0 and shows as unmanaged or disconnected, the hardware is present but not yet connected. If nothing appears at all, you may have a driver issue, which we cover later in this guide.
How to Connect WiFi in Ubuntu Using the Desktop GUI
For most Ubuntu Desktop users, the graphical interface is the easiest way to get online. The steps below assume you are using the default GNOME desktop environment.
- Open the system menu in the top-right corner of the screen.
- Click on the WiFi icon to open the wireless menu.
- Toggle the WiFi switch to On if it is currently off.
- Wait a few seconds for Ubuntu to scan for nearby networks.
- Select your network name (SSID) from the list.
- If the network is secured, enter the WiFi password when prompted.
- Click Connect.
- Once connected, the WiFi icon will display signal strength, and you can open a web browser to verify internet access.
If you do not see your network, make sure the router is broadcasting its SSID. Hidden networks require a manual step, which we explain in a later section. The GUI method automatically saves the connection, so Ubuntu will reconnect to the same network whenever it is in range.
How to Connect WiFi in Ubuntu Using the Terminal
When you do not have a desktop environment, or when the GUI is not responding, the terminal is a reliable alternative. Ubuntu uses NetworkManager by default, and its command-line tool nmcli makes it straightforward to connect to wireless networks.
- Open a terminal. On Ubuntu Server, you are already at the command line.
- List available WiFi networks:
nmcli device wifi list
- Identify the SSID of the network you want to join from the output.
- Connect to the network using the following command, replacing
YOUR_SSIDandYOUR_PASSWORDwith your actual details:
nmcli device wifi connect "YOUR_SSID" password "YOUR_PASSWORD"
- Verify the connection:
nmcli connection show
You should see your new connection listed as activated. If the command fails, double-check the password and make sure the WiFi radio is not blocked using rfkill list.
This method answers the question of how to connect wifi in ubuntu? without needing a mouse or desktop environment. It is especially useful for Ubuntu Server, Raspberry Pi running Ubuntu, or minimal cloud instances.
Using nmcli to Connect WiFi in Ubuntu
nmcli is more than just a quick connect tool. It is a full-featured NetworkManager client that lets you create, modify, and manage connections from the terminal.
To connect and have Ubuntu remember the network for future automatic connections, use:
nmcli device wifi connect "YOUR_SSID" password "YOUR_PASSWORD"
NetworkManager saves the connection profile under /etc/NetworkManager/system-connections/. You can view all saved connections with:
nmcli connection show
To disconnect from a specific network:
nmcli connection down "YOUR_SSID"
To reconnect later:
nmcli connection up "YOUR_SSID"
If you need to specify a particular wireless interface (for example, if you have multiple adapters), include the interface name:
nmcli device wifi connect "YOUR_SSID" password "YOUR_PASSWORD" ifname wlan0
Using nmcli is the most flexible way to handle how to connect wifi in ubuntu? from the command line, and it works identically across Ubuntu Desktop and Ubuntu Server.
Using nmtui to Connect WiFi in Ubuntu
If you prefer a text-based menu instead of typing commands, nmtui provides a graphical interface inside the terminal. It is ideal for users who want a visual experience without a full desktop environment.
First, ensure it is installed:
sudo apt update
sudo apt install network-manager
Launch the tool:
sudo nmtui
Once the blue menu appears, follow these steps:
- Use the arrow keys to select Activate a connection and press Enter.
- Choose your WiFi network from the list.
- Enter the password when prompted and select OK.
- Select Back to return to the main menu, then choose Quit.
nmtui also lets you edit existing connections, set IP addresses, and configure DNS. It is a great middle ground between the full desktop GUI and raw nmcli commands when learning how to connect wifi in ubuntu? on a server or minimal install.
Connecting to Hidden WiFi Networks in Ubuntu
Some routers do not broadcast their network name (SSID) for privacy reasons. These hidden networks do not appear in the standard scan results, so you must connect manually.
Using the Desktop GUI
- Open the WiFi menu from the top-right system menu.
- Select Connect to Hidden Network or Hidden Network, depending on your Ubuntu version.
- Enter the exact SSID of the hidden network.
- Select the security type (usually WPA2 Personal).
- Enter the password and click Connect.
Using nmcli
To connect to a hidden network via terminal, specify the SSID explicitly. NetworkManager will attempt to connect even though it does not appear in scan results:
nmcli device wifi connect "HIDDEN_SSID" password "YOUR_PASSWORD" hidden yes
If you omit hidden yes, the command may fail because NetworkManager expects to see the network in its scan list.
Connecting to WPA2 Enterprise WiFi in Ubuntu
WPA2 Enterprise networks are common in offices, universities, and corporate environments. Unlike home networks that use a single password, enterprise WiFi often requires a username, password, and sometimes a certificate.
Using the Desktop GUI
- Open the WiFi settings and select the enterprise network.
- Choose WPA2 Enterprise as the security type.
- Enter the following details:
- Identity: Your username or email address.
- Password: Your account password.
- Anonymous identity: Leave blank unless your network administrator specifies otherwise.
- CA certificate: Select the certificate provided by your IT department, or choose Do not validate if testing (less secure).
- Click Connect.
Using nmcli
Enterprise connections require more configuration than personal networks. A simplified example looks like this:
nmcli connection add type wifi con-name "Enterprise-WiFi" ssid "ENTERPRISE_SSID"
nmcli connection modify "Enterprise-WiFi" wifi-sec.key-mgmt wpa-eap
nmcli connection modify "Enterprise-WiFi" 802-1x.identity "your-username"
nmcli connection modify "Enterprise-WiFi" 802-1x.password "your-password"
nmcli connection up "Enterprise-WiFi"
If your network requires certificates, you must also set 802-1x.ca-cert to the path of your CA certificate file. Enterprise setup is more complex, but it is a necessary part of knowing how to connect wifi in ubuntu? in professional environments.
Troubleshooting Common WiFi Connection Issues in Ubuntu
Even after following the steps above, you may encounter problems. Here are the most common issues and how to fix them.
WiFi Networks Are Not Showing Up
- Make sure WiFi is enabled in the system menu.
- Run
rfkill listand unblock the device if needed. - Restart NetworkManager:
sudo systemctl restart NetworkManager - Reboot the computer if the wireless adapter is not being detected at all.
Connected but No Internet Access
- Check if other devices can access the internet on the same network.
- Try changing DNS to a public resolver such as Google DNS (
8.8.8.8) in your connection settings. - Disable any VPN or proxy temporarily to rule out interference.
Frequent Disconnections
- Move closer to the router to rule out signal issues.
- Disable WiFi power management, which can cause the adapter to sleep:
sudo nmcli device set wlan0 managed power-saving off
Replace wlan0 with your actual interface name if different.
Authentication Errors
- Double-check the password. WiFi passwords are case-sensitive.
- If you recently changed the router password, forget the network in Ubuntu and reconnect from scratch.
Checking system logs can also reveal driver or firmware errors:
journalctl -u NetworkManager
Fixing WiFi Driver Issues in Ubuntu
If your WiFi hardware is not detected at all, the problem is often a missing or incompatible driver. Ubuntu includes many open-source drivers, but some adapters require proprietary firmware.
Using Additional Drivers
- Open Software & Updates from the application menu.
- Go to the Additional Drivers tab.
- Wait for Ubuntu to scan for available drivers.
- Select a proprietary driver for your wireless card if one is listed.
- Click Apply Changes and restart your computer.
Using the Terminal
You can also install drivers from the command line:
sudo ubuntu-drivers devices
This lists hardware and recommended drivers. To automatically install all recommended drivers:
sudo ubuntu-drivers autoinstall
Common problematic vendors include Broadcom and Realtek. Broadcom adapters often need the bcmwl-kernel-source package, while some Realtek adapters require third-party DKMS modules. If you are unsure of your adapter model, run lspci -knn | grep Net -A3 and search online for the specific chipset plus “Ubuntu driver.”
Remember that Secure Boot in your BIOS can prevent unsigned third-party drivers from loading. If driver installation fails, check whether Secure Boot is enabled and consider disabling it or signing the driver.
Tips and Best Practices for Ubuntu WiFi Connections
Once you know how to connect wifi in ubuntu?, keeping that connection reliable is the next step. Follow these tips for a better experience.
- Keep Ubuntu updated: Run
sudo apt update && sudo apt upgraderegularly to receive kernel and firmware improvements. - Forget networks you no longer use: In Settings, go to WiFi and remove old networks to avoid automatic connections to insecure or outdated routers.
- Set metered connections: If you are using a mobile hotspot with limited data, mark the connection as metered in WiFi settings to reduce background downloads.
- Use a VPN on public WiFi: Ubuntu supports OpenVPN and WireGuard. Always encrypt your traffic on coffee shop or airport networks.
- Prioritize networks: If multiple saved networks are in range, NetworkManager connects based on priority. You can adjust this in
nmtuior by editing connection files. - Backup connection profiles: Saved WiFi configurations are stored in
/etc/NetworkManager/system-connections/. Back these up if you plan to reinstall Ubuntu. - Check router compatibility: Older routers using WEP or WPA only may have compatibility issues with newer Ubuntu versions. WPA2 or WPA3 is recommended.
Comparison: GUI vs Terminal vs nmtui
Different situations call for different tools. The table below compares the main methods for how to connect wifi in ubuntu?
| Method | Difficulty | Best For | Requires Desktop | Saves Connection |
|---|---|---|---|---|
| Desktop GUI | Easy | Laptops and desktop computers | Yes | Yes |
| nmcli (terminal) | Moderate | Servers, headless systems, scripting | No | Yes |
| nmtui (text menu) | Easy to Moderate | Users who want menus without a GUI | No | Yes |
| Hidden network manual | Moderate | Routers with SSID broadcast disabled | Optional | Yes |
| WPA2 Enterprise | Advanced | Workplaces and universities | Optional | Yes |
Frequently Asked Questions
Why can’t I see any WiFi networks in Ubuntu?
This usually means the wireless radio is blocked, the adapter is not detected, or the driver is missing. Check rfkill list and lspci -knn | grep Net -A3 to diagnose the issue.
How to connect wifi in ubuntu? without a graphical interface?
Use nmcli device wifi list to find networks, then nmcli device wifi connect "SSID" password "PASSWORD" to join. Alternatively, use sudo nmtui for a menu-driven terminal experience.
How do I forget a WiFi network in Ubuntu?
On the desktop, open WiFi settings, find the saved network, and click the gear icon to remove or forget it. In the terminal, use nmcli connection delete "SSID".
Does Ubuntu support 5GHz WiFi?
Yes, as long as your wireless adapter and router support 5GHz. Ubuntu will show 5GHz networks in the scan results just like 2.4GHz networks.
Why does my WiFi disconnect after Ubuntu wakes from sleep?
Power management settings may turn off the wireless adapter to save energy. Try disabling power saving with nmcli or updating your kernel and firmware.
Can I connect to a hidden WiFi network in Ubuntu?
Yes. In the GUI, choose “Connect to Hidden Network” and enter the SSID manually. In the terminal, use nmcli device wifi connect "SSID" password "PASSWORD" hidden yes.
How do I find my saved WiFi password in Ubuntu?
Saved passwords are stored in system connection files under /etc/NetworkManager/system-connections/. You need root access to read them, and they may be encrypted depending on your configuration.
Is the terminal method faster than the GUI?
Once you know the commands, the terminal is often faster. However, the GUI is more user-friendly for first-time users who are learning how to connect wifi in ubuntu?
What should I do if my WiFi adapter is not detected at all?
Install additional drivers through Software & Updates or run sudo ubuntu-drivers autoinstall. If that fails, identify your chipset with lspci and search for a compatible Linux driver.
Can I use WPA3 on Ubuntu?
Yes, recent versions of Ubuntu support WPA3 if your wireless adapter and router also support it. Select WPA3 Personal in the WiFi security settings when available.
Conclusion
Connecting to wireless networks is one of the first things most users need to do after installing Ubuntu. Whether you prefer the simplicity of the desktop interface, the power of nmcli, or the menu-driven convenience of nmtui, you now have multiple options for how to connect wifi in ubuntu?
Start by verifying that your hardware is detected and not blocked. Then choose the connection method that matches your setup. For everyday desktop use, the GUI is hard to beat. For servers and remote systems, the terminal tools are indispensable. If you run into trouble, the troubleshooting and driver sections should help you resolve most common problems.
By keeping your system updated, managing saved networks wisely, and following security best practices, you can maintain a stable and safe wireless connection on any Ubuntu machine. You are now fully equipped to handle wireless networking on Ubuntu, no matter the scenario.