
How to Setup Wifi on Ubuntu? Linux Wireless Setup Tips
Introduction Getting wireless internet working on Ubuntu is one of the first things most users want to do after installing the operating system. Whether you are using a laptop with built-in WiFi or a desktop with a USB wireless adapter, knowing How to Setup Wi
Introduction
Getting wireless internet working on Ubuntu is one of the first things most users want to do after installing the operating system. Whether you are using a laptop with built-in WiFi or a desktop with a USB wireless adapter, knowing How to Setup Wifi on Ubuntu? is an essential skill for any Linux user. Ubuntu makes the process fairly straightforward, but there are still multiple ways to connect depending on your hardware, your comfort level with the command line, and whether you are using the desktop edition or a server variant.
This guide walks you through every major method for configuring wireless networking on Ubuntu. We cover the graphical desktop interface, terminal-based tools like nmcli and nmtui, hidden network connections, driver troubleshooting, security best practices, and performance optimization. By the end of this article, you will know exactly how to get your Ubuntu system online wirelessly and how to fix common problems that might arise along the way.
Table of Contents
- Introduction
- Prerequisites: What You Need Before Starting
- Understanding Ubuntu Wireless Networking Basics
- Method 1: Using the Ubuntu Desktop GUI
- Method 2: Setting Up WiFi via Terminal
- Connecting to Hidden Networks
- Troubleshooting Common Ubuntu WiFi Issues
- WiFi Adapter Compatibility and Drivers
- Advanced: Using nmcli for Network Management
- Securing Your Ubuntu WiFi Connection
- Optimizing WiFi Performance on Ubuntu
- Comparison Table: GUI vs Terminal vs nmcli
- Tips and Best Practices
- Frequently Asked Questions
- Conclusion
Prerequisites: What You Need Before Starting
Before you begin the process of learning How to Setup Wifi on Ubuntu?, make sure you have the following items ready. Skipping these basics can lead to frustration later.
- An Ubuntu installation: This guide works for Ubuntu Desktop and Ubuntu Server. The steps differ slightly depending on whether you have a graphical interface.
- A wireless network adapter: Most laptops have built-in WiFi. Desktop users may need a USB WiFi dongle or a PCIe wireless card.
- Administrator privileges: You will need a user account with
sudo access to install drivers or change network settings. - Your WiFi network name (SSID) and password: Have these handy before you start configuring the connection.
- A temporary wired connection (optional but recommended): If your wireless adapter is not detected, an Ethernet cable lets you download drivers and updates while you troubleshoot.
If you are installing Ubuntu for the first time, the installer usually asks whether you want to connect to a wireless network during setup. If you skipped that step, you can configure WiFi after booting into the desktop or server environment using the methods below.
Understanding Ubuntu Wireless Networking Basics
Ubuntu uses NetworkManager as its default networking service. NetworkManager handles wired, wireless, VPN, and mobile broadband connections. It stores connection profiles so your system can automatically reconnect to known networks.
On most Ubuntu systems, the wireless interface is named something like wlan0, wlp2s0, or wlo1. The exact name depends on your hardware and the version of Ubuntu you are running. You do not usually need to memorize this name when using the graphical tools, but it becomes important when configuring WiFi through the terminal.
Wireless security on Ubuntu typically uses WPA2 or WPA3 encryption. Older WEP networks are still supported but are strongly discouraged because they are insecure. Ubuntu also supports 802.1X enterprise authentication, which is common in office and university environments.
Method 1: Using the Ubuntu Desktop GUI
If you are using Ubuntu Desktop with the GNOME interface, the graphical method is the easiest way to answer How to Setup Wifi on Ubuntu? Follow these steps:
- Click the system menu in the top-right corner of the screen. It usually shows the volume and power icons.
- Select Wi-Fi or Not Connected from the dropdown menu.
- Toggle the WiFi switch to On if it is currently off.
- Wait a few seconds for Ubuntu to scan for available networks.
- Click on your network name (SSID) from the list.
- If the network is secured, enter the WiFi password when prompted.
- Optionally, check the box to Connect automatically so Ubuntu joins this network whenever it is in range.
- Click Connect.
Once connected, the WiFi icon in the top bar will show signal strength. You can click it again at any time to view connection details, disconnect, or switch to a different network.
For more advanced GUI options, open Settings, go to Network, and click the gear icon next to your wireless connection. Here you can configure IPv4/IPv6 settings, set a static IP address, or change the MAC address.
Method 2: Setting Up WiFi via Terminal
If you are using Ubuntu Server, a minimal installation, or simply prefer the command line, you can set up WiFi without a graphical interface. The most common tool is nmcli, which stands for NetworkManager Command Line Interface.
First, check that your wireless device is recognized:
nmcli device status
Look for a device with TYPE set to wifi. If you see it listed as unmanaged or disconnected, you are ready to proceed.
To scan for available networks:
nmcli device wifi list
To connect to a network:
nmcli device wifi connect "Your-SSID" password "Your-Password"
Replace Your-SSID and Your-Password with your actual network credentials. If the SSID contains spaces, wrap it in quotes.
To make the connection automatic:
nmcli connection modify "Your-SSID" connection.autoconnect yes
If you prefer a text-based visual interface instead of typing commands, install and run nmtui:
sudo apt update
sudo apt install network-manager
nmtui
Use the arrow keys to navigate to Activate a connection, select your WiFi network, enter the password, and choose Activate.
Connecting to Hidden Networks
Some wireless networks do not broadcast their SSID, meaning they do not appear in the standard list of available networks. To connect to a hidden network using the GUI:
- Open the WiFi menu from the top-right system menu.
- Select Connect to Hidden Network or Hidden Network.
- Enter the exact network name (SSID).
- Choose the security type, usually WPA2 or WPA3.
- Enter the password and click Connect.
Using the terminal with nmcli:
nmcli device wifi connect "Hidden-SSID" password "Your-Password" hidden yes
Hidden networks are not inherently more secure than broadcast networks, but they can reduce casual visibility. You still need a strong password and proper encryption.
Troubleshooting Common Ubuntu WiFi Issues
Even after following the steps above, you might encounter problems. Here are the most common issues and how to resolve them.
WiFi Adapter Not Detected
If Ubuntu does not see any wireless device, run:
lspci -knn | grep Net -A3
lsusb
If no wireless hardware appears, the adapter may be disabled in BIOS, physically switched off with a laptop function key, or incompatible with the Linux kernel. Try rebooting and checking for a hardware WiFi switch.
Driver Problems
Some WiFi adapters require proprietary drivers that are not included by default. Open Software & Updates, go to the Additional Drivers tab, and see if a proprietary driver is available for your wireless card. Install it and reboot.
Connected but No Internet
This often points to a DNS or IP configuration issue. Try restarting NetworkManager:
sudo systemctl restart NetworkManager
You can also test DNS by pinging a public IP:
ping -c 4 1.1.1.1
If the IP responds but domain names do not, change your DNS servers to Google (8.8.8.8) or Cloudflare (1.1.1.1) in your network settings.
Frequent Disconnections
WiFi power management can cause instability on some laptops. Disable it temporarily to test:
sudo iwconfig wlan0 power off
Replace wlan0 with your actual interface name. If this fixes the problem, you can make the change permanent through NetworkManager dispatcher scripts or by editing the configuration file.
WiFi Adapter Compatibility and Drivers
Not every WiFi adapter works out of the box on Ubuntu. Compatibility generally falls into three categories:
- Fully supported: Adapters from Intel, many Atheros models, and some Realtek chips usually work immediately with open-source drivers built into the kernel.
- Proprietary driver required: Broadcom adapters often need the
bcmwl-kernel-sourcepackage or similar proprietary drivers. These can be installed through the Additional Drivers tool. - Unsupported or difficult: Very new or obscure USB WiFi dongles may lack Linux drivers entirely. Before buying an adapter, check whether it is listed as compatible with Ubuntu or Linux generally.
To identify your adapter:
lspci | grep -i network
For USB adapters:
lsusb
Once you know the chipset, search Ubuntu forums or the official hardware certification database to confirm driver support.
Advanced: Using nmcli for Network Management
nmcli is powerful enough to handle nearly all wireless networking tasks. Here are some useful commands for daily use.
Show all connections:
nmcli connection show
Turn WiFi radio on or off:
nmcli radio wifi on
nmcli radio wifi off
Rescan for networks:
nmcli device wifi rescan
Delete a saved network profile:
nmcli connection delete "Old-SSID"
View detailed information about the active WiFi connection:
nmcli -p device show wlan0
These commands are especially useful on Ubuntu Server or when writing scripts to automate network setup.
Securing Your Ubuntu WiFi Connection
Connecting to WiFi is only half the battle. Keeping that connection secure is equally important.
- Use WPA2 or WPA3: Avoid WEP whenever possible. WPA3 is the newest standard and offers stronger protection against brute-force attacks.
- Enable a firewall: Ubuntu includes
ufw(Uncomplicated Firewall). Enable it withsudo ufw enableand allow necessary services. - Avoid open public WiFi for sensitive tasks: If you must use public wireless networks, use a VPN to encrypt your traffic.
- Keep Ubuntu updated: Security patches for the kernel and NetworkManager are released regularly. Run
sudo apt update && sudo apt upgradefrequently. - Disable WPS: WiFi Protected Setup is convenient but has known vulnerabilities. Turn it off on your router if possible.
Optimizing WiFi Performance on Ubuntu
If your connection feels slow, try these optimization tips:
- Change DNS servers: Your ISP’s DNS may be slow. Switch to Cloudflare (
1.1.1.1) or Google (8.8.8.8) in your network settings. - Select the 5 GHz band: If your router supports both 2.4 GHz and 5 GHz, connect to the 5 GHz network for less interference and higher speeds, though range is shorter.
- Disable IPv6 if not needed: Some networks handle IPv6 poorly, causing delays. You can disable it per connection in the Network settings.
- Update firmware: Check for motherboard or WiFi adapter firmware updates through
fwupdmgror your manufacturer’s website. - Reduce physical obstructions: Place your Ubuntu laptop or desktop closer to the router, away from microwaves and thick walls.
Comparison Table: GUI vs Terminal vs nmcli
Different users prefer different tools. The table below compares the main methods for setting up WiFi on Ubuntu.
| Method | Best For | Ease of Use | Requires GUI | Scriptable |
|---|---|---|---|---|
| Ubuntu Desktop GUI | New users, laptops | Very easy | Yes | No |
| nmtui | Server users who want a menu | Easy | No | No |
| nmcli commands | Advanced users, automation | Moderate | No | Yes |
Tips and Best Practices
Here are some practical recommendations to keep your Ubuntu WiFi setup reliable over the long term.
- Save your passwords securely: Ubuntu stores WiFi passwords in the system keyring. Make sure your user account has a strong login password so others cannot easily access stored credentials.
- Test after updates: After a major kernel or system update, reboot and verify that WiFi still connects automatically.
- Document static IP settings: If you assign a static IP address to your Ubuntu machine, write down the gateway, subnet mask, and DNS servers in case you need to reconfigure later.
- Use a wired connection for large updates: If you are downloading a big system upgrade, plug in via Ethernet to avoid WiFi interruptions.
- Check router compatibility: Some older routers struggle with modern Linux network stacks. If you experience drops, try updating your router firmware or changing its wireless channel.
Frequently Asked Questions
Do I need to install extra software to set up WiFi on Ubuntu?
In most cases, no. Ubuntu Desktop includes NetworkManager and the necessary wireless tools by default. If your adapter requires a proprietary driver, you can install it through the Additional Drivers utility.
Can I set up WiFi on Ubuntu Server without a desktop?
Yes. Use nmcli or nmtui from the command line. Both tools are designed to work without a graphical environment.
Why can I see networks but not connect?
This usually means an incorrect password, a security mismatch (for example, trying to use WPA2 on a WPA3-only network), or a router MAC address filter blocking your device. Double-check the password and try connecting another device to rule out router issues.
How do I forget a WiFi network on Ubuntu?
In the GUI, go to Settings > Network, click the gear icon next to the network, and look for a remove or forget option. In the terminal, use nmcli connection delete "SSID".
Does Ubuntu support WPA3?
Yes, recent versions of Ubuntu support WPA3 if your wireless adapter and router also support it. WPA2 remains widely supported and is still considered secure when paired with a strong password.
Conclusion
Learning How to Setup Wifi on Ubuntu? does not have to be complicated. Whether you prefer the simplicity of the desktop graphical interface or the flexibility of terminal tools like nmcli and nmtui, Ubuntu provides multiple paths to get online wirelessly. Start with the basics: ensure your adapter is detected, install any needed drivers, and connect using your preferred method. From there, you can secure your connection, optimize performance, and troubleshoot issues as they arise.
By following the steps and best practices in this guide, you should be able to configure WiFi on any Ubuntu system and keep it running reliably. If you run into a problem not covered here, the Ubuntu community forums and official documentation are excellent resources for additional help.