Setup and Configuration

How to Connect Wifi on Ubuntu? Ubuntu Wifi Guide

Introduction Connecting to a wireless network is one of the first things most users want to do after installing Ubuntu. Whether you are using Ubuntu Desktop on a laptop or Ubuntu Server on a headless machine, knowing How to Connect Wifi on Ubuntu? is an essent

HowToFixWiFi

Introduction

Connecting to a wireless network is one of the first things most users want to do after installing Ubuntu. Whether you are using Ubuntu Desktop on a laptop or Ubuntu Server on a headless machine, knowing How to Connect Wifi on Ubuntu? is an essential skill. Unlike wired Ethernet, WiFi introduces variables such as drivers, firmware, network managers, and security protocols that can sometimes make the process confusing.

This guide walks you through every method available for connecting Ubuntu to a wireless network. You will learn how to use the graphical desktop interface, the command line with nmcli, and Netplan for server installations. We also cover driver installation, troubleshooting common connection problems, and best practices for maintaining a stable wireless connection. By the end of this article, you will be able to get online on Ubuntu regardless of your hardware or experience level.

Table of Contents

Prerequisites Before You Begin

Before attempting How to Connect Wifi on Ubuntu?, make sure your system meets a few basic requirements. First, confirm that your computer actually has a wireless network adapter. Most laptops include built-in WiFi, but many desktop PCs do not unless a USB WiFi dongle or PCIe card has been installed.

Second, you need administrative privileges. Connecting to a network usually requires root access or membership in the sudo group, especially when installing drivers or modifying network configuration files. Third, if your WiFi adapter requires proprietary drivers, it helps to have a temporary wired Ethernet connection so you can download packages from Ubuntu repositories.

Finally, know which version of Ubuntu you are running. Ubuntu Desktop uses NetworkManager by default, while Ubuntu Server may use Netplan or systemd-networkd depending on the release. The steps differ slightly between these environments, and this guide addresses both.

Understanding Ubuntu WiFi Hardware and Drivers

Ubuntu supports a wide range of WiFi adapters, but not all of them work out of the box. Some vendors provide open-source drivers included in the Linux kernel, while others require proprietary firmware or third-party drivers. If your wireless adapter is not detected, the issue is often driver-related rather than a problem with Ubuntu itself.

To identify your WiFi hardware, open a terminal and run:

lspci | grep -i network

For USB adapters, use:

lsusb

Look for entries mentioning wireless, WiFi, WLAN, or specific vendors such as Intel, Realtek, Broadcom, or MediaTek. Once you know the hardware, you can check whether Ubuntu has the appropriate firmware installed. The linux-firmware package contains most common WiFi firmware files and is usually included by default.

If you need proprietary drivers, Ubuntu provides a tool called ubuntu-drivers that can detect and install them automatically. We will cover that process in detail later in this guide.

How to Connect Wifi on Ubuntu? Using the Desktop GUI

The easiest way to perform How to Connect Wifi on Ubuntu? on a desktop system is through the graphical interface. Ubuntu uses the GNOME desktop environment by default, and its Settings application provides a user-friendly way to manage wireless connections.

  1. Click the system menu in the top-right corner of the screen, where the volume and power icons are located.
  2. Select Settings from the dropdown menu.
  3. In the left sidebar, click on Wi-Fi.
  4. Toggle the WiFi switch to On if it is currently disabled.
  5. Wait a few seconds for Ubuntu to scan for available networks. A list of nearby SSIDs will appear.
  6. Click the name of the network you want to join.
  7. If the network is secured, enter the password when prompted and click Connect.
  8. For open networks, Ubuntu may connect immediately or ask you to confirm.
  9. Once connected, the WiFi icon in the top bar will show signal strength, and the Settings page will display your IP address and connection status.

If you want the system to remember this network and join automatically in the future, make sure the Connect automatically option is enabled before you click Connect. This setting is stored by NetworkManager and applies to all future sessions.

How to Connect Wifi on Ubuntu? Using the Terminal and nmcli

For users who prefer the command line, or for systems without a desktop environment, nmcli is the official tool for controlling NetworkManager. It is powerful, scriptable, and ideal for answering How to Connect Wifi on Ubuntu? from a terminal.

First, list available wireless networks:

nmcli device wifi list

This command displays SSIDs, signal strength, security type, and whether the network is in use. Once you have identified the network you want to join, connect using:

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 double quotes as shown. For hidden networks, add the hidden yes option:

nmcli device wifi connect "HIDDEN_SSID" password "YOUR_PASSWORD" hidden yes

To verify the connection, run:

nmcli connection show

You should see your wireless connection listed as activated. To disconnect, use:

nmcli device disconnect wlan0

Note that the interface name might be wlan0, wlp2s0, or something similar depending on your hardware. You can find the exact name with ip link or nmcli device status.

How to Connect Wifi on Ubuntu? Using netplan (Server Edition)

Ubuntu Server does not always include a graphical interface, and many administrators prefer declarative network configuration. Netplan is the default network configuration tool on modern Ubuntu Server releases. It uses YAML files to define network settings and applies them through a backend renderer such as NetworkManager or systemd-networkd.

To configure WiFi with Netplan, locate the YAML configuration file in /etc/netplan/. Common filenames include 00-installer-config.yaml or 01-netcfg.yaml. Open it with root privileges:

sudo nano /etc/netplan/00-installer-config.yaml

A basic WiFi configuration using NetworkManager as the renderer looks like this:

network:
  version: 2
  wifis:
    wlan0:
      dhcp4: true
      access-points:
        "YOUR_SSID":
          password: "YOUR_PASSWORD"

Replace wlan0 with your actual wireless interface name, which you can find using ip link. Replace YOUR_SSID and YOUR_PASSWORD with your network details. YAML is sensitive to indentation, so ensure spaces are used consistently and tabs are avoided.

After saving the file, apply the configuration:

sudo netplan apply

If there are syntax errors, Netplan will refuse to apply the changes and will display an error message. You can test the configuration before applying it with:

sudo netplan try

This command applies the configuration temporarily and reverts it if you do not confirm within a short timeout, which prevents you from losing remote access to a server.

Troubleshooting Common WiFi Connection Issues

Even after following the steps for How to Connect Wifi on Ubuntu?, you may encounter problems. Below are the most frequent issues and how to resolve them.

WiFi Network Not Showing Up

If your network does not appear in the list, first confirm that WiFi is enabled. Check for a hardware switch or function key on your laptop that toggles wireless. In the terminal, run:

rfkill list

If you see Soft blocked: yes or Hard blocked: yes, unblock it with:

sudo rfkill unblock all

Also verify that your router is broadcasting its SSID. Hidden networks must be added manually using the steps described earlier.

Authentication Failed or Wrong Password

Double-check the password, remembering that WiFi passwords are case-sensitive. If you recently changed your router password, Ubuntu may be trying to use the old saved credentials. Forget the network in Settings or remove it with nmcli, then reconnect from scratch.

Connected but No Internet Access

This often indicates a DNS or DHCP problem. Try pinging a public IP address:

ping 8.8.8.8

If that works but browsing does not, your DNS settings may be incorrect. You can set Google DNS or Cloudflare DNS in your connection settings or Netplan configuration.

Slow or Unstable Connection

Interference from other devices, distance from the router, or congestion on the 2.4 GHz band can cause slow speeds. If your router supports 5 GHz, connect to that band instead. You can also disable WiFi power management in Ubuntu, which sometimes improves stability:

sudo iwconfig wlan0 power off

Replace wlan0 with your interface name.

Fixing Missing or Outdated WiFi Drivers

If Ubuntu does not detect your wireless adapter at all, you likely need to install a driver. Start by updating your package list:

sudo apt update

Then check for available proprietary drivers:

ubuntu-drivers devices

This command lists hardware and recommends drivers. To install all recommended drivers automatically, run:

sudo ubuntu-drivers autoinstall

After installation, reboot your system. If your WiFi adapter still does not work, you may need to download the driver manually from the vendor’s website and compile it using DKMS. Broadcom adapters, for example, often require the bcmwl-kernel-source package, while some Realtek adapters need third-party drivers from GitHub repositories.

Secure Boot can also block third-party kernel modules. If you have Secure Boot enabled in your BIOS and installed an unsigned driver, Ubuntu may refuse to load it. You can either disable Secure Boot or sign the driver with a Machine Owner Key (MOK).

Managing Saved WiFi Networks and Auto-Connect

Ubuntu stores wireless network credentials so you do not have to enter them every time. In the desktop environment, open Settings, go to WiFi, and click the gear icon next to a saved network to view or edit its properties. You can toggle Connect automatically or choose Forget to remove the network entirely.

From the command line, nmcli provides full control over saved connections. To list all known connections:

nmcli connection show

To enable auto-connect for a specific network:

nmcli connection modify "YOUR_SSID" connection.autoconnect yes

To disable auto-connect:

nmcli connection modify "YOUR_SSID" connection.autoconnect no

To delete a saved network:

nmcli connection delete "YOUR_SSID"

These settings are stored in /etc/NetworkManager/system-connections/ as individual files. You generally should not edit these files directly unless you are an advanced user, because incorrect syntax can prevent NetworkManager from reading them.

Comparison: GUI vs nmcli vs netplan

Different situations call for different tools. The table below compares the three main methods for How to Connect Wifi on Ubuntu? so you can choose the right one for your environment.

Method Best For Pros Cons Difficulty
Desktop GUI Ubuntu Desktop users Visual, intuitive, no commands required Not available on server, slower for automation Easy
nmcli (Terminal) Desktop and server with NetworkManager Fast, scriptable, works over SSH Requires memorizing commands Moderate
Netplan Ubuntu Server, headless systems Declarative, version-controlled, survives reboots YAML syntax errors can break networking Moderate to Advanced

Tips and Best Practices for Stable Ubuntu WiFi

Getting connected is only the first step. To maintain a reliable wireless connection on Ubuntu, follow these best practices.

  • Keep your system updated: Run sudo apt update && sudo apt upgrade regularly to receive kernel and firmware improvements.
  • Prefer 5 GHz when available: The 5 GHz band offers faster speeds and less interference than 2.4 GHz, though it has shorter range.
  • Disable power management if you experience drops: Some WiFi adapters save power by turning off the radio, which can cause latency or disconnections.
  • Use a wired connection for driver installation: If your WiFi adapter needs proprietary drivers, connect via Ethernet first to download packages.
  • Document your Netplan files: Comment your YAML configurations so you or other administrators can understand them later.
  • Check router placement: Physical obstructions and distance from the access point affect signal quality more than software settings.
  • Test with a live USB: If you are unsure whether your hardware is compatible, boot Ubuntu from a live USB and test WiFi before installing.

Frequently Asked Questions

Do I need to install extra software to connect to WiFi on Ubuntu?

In most cases, no. Ubuntu Desktop includes NetworkManager and the necessary WiFi tools by default. If your adapter requires proprietary firmware, you may need to install additional packages, but the core connection tools are already present.

Can I connect to a hidden WiFi network on Ubuntu?

Yes. In the GUI, choose Connect to Hidden Network and enter the SSID manually. With nmcli, use the hidden yes option. With Netplan, define the access-point under the access-points section as usual.

Why is my WiFi adapter not detected after installing Ubuntu?

This is usually a driver or firmware issue. Run lspci or lsusb to identify the adapter, then use ubuntu-drivers devices to find and install the recommended driver.

How do I forget a WiFi network on Ubuntu?

Open Settings, go to WiFi, click the gear icon next to the saved network, and select Forget. Alternatively, use nmcli connection delete "SSID" in the terminal.

Does Ubuntu support WPA3 WiFi security?

Yes, recent versions of Ubuntu support WPA3 through NetworkManager and wpa_supplicant, provided your router and wireless adapter also support it.

Can I use Netplan on Ubuntu Desktop?

You can, but Ubuntu Desktop typically uses NetworkManager. Netplan is more common on Ubuntu Server. If you configure WiFi through Netplan on a desktop system, make sure NetworkManager is set as the renderer.

What should I do if I am connected to WiFi but have no internet?

First, ping 8.8.8.8 to check basic connectivity. If that works, the issue is likely DNS. Change your DNS servers to 8.8.8.8 or 1.1.1.1 in your connection settings.

How do I check WiFi signal strength in the terminal?

Run nmcli device wifi list to see signal percentages, or use iwconfig to view link quality and signal level in dBm.

Conclusion

Learning How to Connect Wifi on Ubuntu? does not have to be complicated. Whether you prefer the simplicity of the desktop interface, the flexibility of the nmcli command line, or the declarative power of Netplan on a server, Ubuntu provides reliable tools for getting online. Start with the method that matches your environment, install any missing drivers if necessary, and apply the troubleshooting tips if something goes wrong.

Wireless networking on Linux has improved dramatically over the years, and most modern adapters work with minimal configuration. By keeping your system updated, managing your saved connections wisely, and following the best practices outlined in this guide, you can enjoy a stable WiFi experience on Ubuntu for years to come.