
How to Set up Wifi in Ubuntu? Linux Wireless Connection
Introduction Ubuntu is one of the most popular Linux distributions for desktops, laptops, and servers. While a wired Ethernet connection offers stability, wireless connectivity is what makes laptops and mobile devices truly useful. If you are new to Linux, you
Introduction
Ubuntu is one of the most popular Linux distributions for desktops, laptops, and servers. While a wired Ethernet connection offers stability, wireless connectivity is what makes laptops and mobile devices truly useful. If you are new to Linux, you might be wondering how to set up Wifi in Ubuntu? The good news is that Ubuntu includes NetworkManager by default, which handles wireless connections through both a graphical interface and the command line.
This guide explains how to set up Wifi in Ubuntu? step by step. Whether you are using Ubuntu Desktop with GNOME, Ubuntu Server, or a minimal installation, you will find instructions for detecting your wireless adapter, connecting to networks, troubleshooting common issues, and optimizing performance. By the end of this article, you will be able to get online wirelessly and manage your connections with confidence.
Table of Contents
- Introduction
- Why WiFi Matters on Ubuntu
- Prerequisites Before You Start
- Check If Your WiFi Adapter Is Detected
- Enable WiFi Using the Desktop GUI
- Connect to a WiFi Network via GUI
- Set Up WiFi Using the Terminal
- Connect to Hidden WiFi Networks
- Troubleshooting Common WiFi Issues
- WiFi Drivers and Firmware
- Managing WiFi Connections with nmcli
- WiFi Security Best Practices
- Optimizing WiFi Performance on Ubuntu
- Comparison: GUI vs Terminal WiFi Setup
- Frequently Asked Questions
- Conclusion
Why WiFi Matters on Ubuntu
Wireless networking is essential for many Ubuntu users. Laptops rely on WiFi to move between rooms, offices, and cafes without carrying Ethernet cables. Even desktop users sometimes prefer WiFi when running a cable is impractical. On Ubuntu Server, WiFi might be less common, but it is still valuable for headless devices, Raspberry Pi projects, or embedded systems where Ethernet ports are unavailable.
Ubuntu makes WiFi setup accessible, but the experience depends on your hardware. Some wireless adapters work out of the box with open-source drivers, while others require proprietary firmware or additional configuration. Understanding the difference saves time and prevents frustration when you are trying to get online.
Prerequisites Before You Start
Before you begin, make sure you have the following:
- A computer running Ubuntu Desktop or Ubuntu Server.
- A user account with sudo privileges.
- A built-in or USB WiFi adapter.
- A nearby wireless network with the SSID and password available.
- Optionally, an Ethernet connection for downloading drivers if WiFi does not work immediately.
If you are running Ubuntu from a live USB installer, you can test WiFi before installing. However, settings made in a live environment do not persist after reboot unless you install Ubuntu to disk.
Check If Your WiFi Adapter Is Detected
The first step in how to set up Wifi in Ubuntu? is confirming that the operating system sees your wireless hardware. Open a terminal by pressing Ctrl+Alt+T or searching for Terminal in the applications menu.
Using lspci and lsusb
Run the following command to list PCI devices, which includes most built-in WiFi cards:
lspci -knn | grep Net -A3
If your adapter appears with a kernel driver in use, it is detected. For USB WiFi adapters, use:
lsusb
Look for entries mentioning wireless, 802.11, or the vendor name of your adapter.
Using rfkill
Ubuntu uses rfkill to manage wireless radio blocks. Check whether WiFi is soft-blocked or hard-blocked:
rfkill list
If you see Soft blocked: yes, the wireless radio is disabled by software. If you see Hard blocked: yes, a physical switch or function key may be disabling it.
Using nmcli
NetworkManager’s command-line tool can also show device status:
nmcli device status
Look for a device of type wifi. If it says unavailable, the adapter may be blocked or missing a driver.
Enable WiFi Using the Desktop GUI
Most Ubuntu Desktop users prefer the graphical interface. Here is how to turn on WiFi:
- Click the system menu in the top-right corner of the screen.
- Select the WiFi icon or toggle to enable wireless networking.
- Alternatively, open Settings, navigate to WiFi, and switch the toggle to On.
Once enabled, Ubuntu begins scanning for nearby networks. If no networks appear, verify that the WiFi switch on your laptop is turned on and that rfkill does not show a hard block.
Connect to a WiFi Network via GUI
After enabling WiFi, connecting to a network is straightforward:
- Open Settings and go to WiFi.
- Browse the list of available networks and click the name (SSID) of the network you want to join.
- Enter the password when prompted.
- Choose whether to connect automatically whenever the network is in range.
- Click Connect.
Once connected, the WiFi icon in the top bar shows signal strength. You can test the connection by opening a web browser or running ping google.com in the terminal.
Set Up WiFi Using the Terminal
For Ubuntu Server, minimal installations, or users who prefer the command line, NetworkManager provides nmcli. This tool is powerful and scriptable. If you are looking for how to set up Wifi in Ubuntu? without a desktop, this is the method to use.
Using nmcli
- List available WiFi networks:
nmcli device wifi list
- Connect to a network by replacing
YOUR_SSIDandYOUR_PASSWORDwith your network details:
nmcli device wifi connect "YOUR_SSID" password "YOUR_PASSWORD"
- Verify the connection:
nmcli connection show
If you need to disconnect, use:
nmcli device disconnect wlan0
Replace wlan0 with your actual wireless interface name if it differs.
Using nmtui
If you want a text-based graphical menu, install and run nmtui:
sudo apt update
sudo apt install network-manager
nmtui
Select Activate a connection, choose your WiFi network, enter the password, and activate. This is a beginner-friendly alternative to typing nmcli commands.
Connect to Hidden WiFi Networks
Hidden networks do not broadcast their SSID, so they do not appear in the standard scan list. To connect, you must know the exact network name.
In the GUI, open WiFi settings, click the menu or plus icon, choose Connect to Hidden Network, type the SSID, select the security type, enter the password, and connect.
In the terminal, use the hidden flag with nmcli:
nmcli device wifi connect "HIDDEN_SSID" password "YOUR_PASSWORD" hidden yes
Once connected, NetworkManager remembers the network for future use.
Troubleshooting Common WiFi Issues
Even after following the steps for how to set up Wifi in Ubuntu?, you may encounter problems. Here are the most frequent issues and how to fix them.
WiFi Adapter Not Detected
If lspci or lsusb does not show your adapter, the hardware may be disabled in BIOS, physically damaged, or unsupported. Try reseating a USB adapter or checking BIOS settings. If the adapter is supported but lacks a driver, proceed to the drivers section below.
Soft or Hard Blocked
Run rfkill list. To unblock all wireless devices:
sudo rfkill unblock all
If a hard block persists, look for a physical switch on your laptop or press the appropriate function key (often Fn+F2 or similar) to enable wireless.
Authentication Failures
Double-check the password. WiFi passwords are case-sensitive. If you recently changed the router password, forget the network in Ubuntu and reconnect:
nmcli connection delete "YOUR_SSID"
Then connect again with the new credentials.
Slow or Unstable Connection
Slow speeds can result from signal interference, distance from the router, or power management settings. Try moving closer to the access point, switching to the 5 GHz band if available, or disabling WiFi power saving (covered in the optimization section).
WiFi Drivers and Firmware
Some WiFi adapters require proprietary drivers that are not included by default due to licensing. Ubuntu provides tools to install them.
Installing Proprietary Drivers
- Connect to the internet via Ethernet or a phone hotspot if possible.
- Open Software & Updates and go to the Additional Drivers tab.
- Wait for Ubuntu to scan for available drivers.
- Select the proprietary driver for your WiFi adapter and click Apply Changes.
- Restart your computer.
In the terminal, you can check for missing drivers with:
ubuntu-drivers devices
To install recommended drivers automatically:
sudo ubuntu-drivers autoinstall
Checking Firmware
Many adapters need firmware files from the linux-firmware package. Ensure it is installed:
sudo apt update
sudo apt install linux-firmware
After installation, reboot and check dmesg for firmware errors related to your wireless device:
dmesg | grep -i firmware
Managing WiFi Connections with nmcli
NetworkManager stores each WiFi connection as a profile. You can view, modify, and delete these profiles from the terminal.
List all saved connections:
nmcli connection show
Enable automatic connection for a saved network:
nmcli connection modify "YOUR_SSID" connection.autoconnect yes
Delete a saved network:
nmcli connection delete "YOUR_SSID"
Bring a connection up or down:
nmcli connection up "YOUR_SSID"
nmcli connection down "YOUR_SSID"
These commands are especially useful on servers or when writing automation scripts.
WiFi Security Best Practices
Security should never be an afterthought when you configure wireless networking. Follow these best practices:
- Use WPA3 if your router and adapter support it. Otherwise, WPA2-PSK (AES) is the minimum acceptable standard.
- Avoid WEP and WPA-TKIP. They are easily cracked and offer little protection.
- Disable WPS on your router, as it can be exploited to recover the WiFi password.
- Use a strong, unique password for your wireless network.
- Enable a firewall on Ubuntu. The Uncomplicated Firewall (UFW) is easy to configure:
sudo ufw enable
When connecting to public WiFi, consider using a virtual private network (VPN) to encrypt your traffic and protect sensitive data.
Optimizing WiFi Performance on Ubuntu
Once you know how to set up Wifi in Ubuntu?, you may want to improve speed and reliability.
Disable Power Management
Some wireless cards reduce power to save energy, which can cause latency or disconnections. Create or edit a NetworkManager configuration file:
/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
Set the value to:
wifi.powersave = 2
The value 2 disables power saving. Restart NetworkManager:
sudo systemctl restart NetworkManager
Prefer the 5 GHz Band
If your router supports dual-band WiFi, connect to the 5 GHz network for faster speeds and less interference, though the range is shorter than 2.4 GHz.
Change DNS Servers
Slow DNS resolution can make the internet feel slow even when WiFi is fast. In Settings, go to your WiFi connection, click the gear icon, and set custom DNS servers such as 1.1.1.1 or 8.8.8.8.
Comparison: GUI vs Terminal WiFi Setup
The table below compares the two main approaches to setting up WiFi on Ubuntu.
| Feature | Desktop GUI | Terminal (nmcli) |
|---|---|---|
| Ease of use | Beginner-friendly, visual | Requires command familiarity |
| Speed of setup | Fast for one-time connections | Fast once commands are known |
| Best for | Laptops and desktop users | Servers, minimal installs, scripting |
| Hidden networks | Supported via manual entry | Supported with hidden yes |
| Connection management | Settings panel | nmcli connection commands |
| Driver installation | Additional Drivers GUI | Terminal with ubuntu-drivers |
| Automation | Limited | Excellent for scripts |
Frequently Asked Questions
Do I need to install extra software to use WiFi on Ubuntu?
No. Ubuntu includes NetworkManager and most open-source WiFi drivers by default. You may need additional proprietary drivers for certain adapters.
Why is my WiFi adapter not showing up?
It could be disabled by rfkill, turned off by a hardware switch, missing firmware, or unsupported by the kernel. Check rfkill list and lspci -knn | grep Net -A3 to diagnose.
Can I connect to WiFi without a password?
Only if the network is open (unsecured). Open networks are not recommended for sensitive traffic because data is not encrypted.
How do I forget a WiFi network?
In Settings, go to WiFi, click the gear icon next to the network, and choose Forget. In the terminal, run nmcli connection delete "SSID".
Is WPA3 supported on Ubuntu?
Yes, recent versions of Ubuntu and NetworkManager support WPA3, provided your router and wireless adapter also support it.
Can I use WiFi on Ubuntu Server?
Yes, but it is not always configured during installation. You can set it up afterward using nmcli or nmtui if NetworkManager is installed.
How do I improve WiFi signal strength on Ubuntu?
Move closer to the router, reduce physical obstructions, switch to the 5 GHz band, disable power management, and ensure your router firmware is up to date.
What should I do if WiFi works but there is no internet?
Check DNS settings, router DHCP, and firewall rules. Try pinging an IP address directly (for example, ping 8.8.8.8). If that works but domain names do not, the issue is DNS.
Conclusion
Setting up wireless networking on Ubuntu does not have to be complicated. Whether you prefer the visual simplicity of the desktop settings or the flexibility of the terminal, Ubuntu gives you the tools to get connected quickly. This guide has walked you through how to set up Wifi in Ubuntu? from detecting your adapter to troubleshooting drivers, connecting to hidden networks, and optimizing performance.
Take a moment to secure your connection with WPA2 or WPA3, keep your firmware updated, and test your speed after setup. If you run into issues, the rfkill, nmcli, and dmesg commands are your best friends for diagnosing problems. Now you are ready to enjoy wireless freedom on your Ubuntu system.