How to Install and Configure Wi-Fi on Linux: A Complete Guide from Connection to Troubleshooting

Connecting to Wi-Fi in Linux is often the first major challenge for newcomers switching from Windows or macOS. Unlike proprietary systems, where drivers are installed automatically, in open source distributions the process may require manual steps—from installing firmware to configuring network interfaces via the terminal. However, once properly configured, Wi-Fi in Linux works just as well, and often more reliably, than in commercial operating systems.

In this article, you will find step-by-step instructions for various scenarios: from basic connection via the GUI to manual configuration. wpa_supplicant for hidden networks. We'll also cover common mistakes (for example, Device not ready or the absence of a network adapter in ip a) and how to fix them. If you use Ubuntu 22.04+, Debian 12, Arch Linux or Fedora — here you will find a solution for your case.

Before you begin, make sure your Wi-Fi adapter is supported by Linux. Most modern chips (e.g., Intel AX200, Qualcomm Atheros or Realtek RTL8852AE) have open drivers, but for some models (especially from Broadcom) may require installation of proprietary software. Compatibility can be checked on the manufacturer's website or in the database. Linux Wireless.

📊 Which Linux distribution are you using?
Ubuntu/Debian
Arch Linux/Manjaro
Fedora/RHEL
OpenSUSE
Another

1. Checking the hardware compatibility of the Wi-Fi adapter

The first step is to ensure the system "sees" your Wi-Fi module. To do this, run the following command in the terminal:

lspci -knn | grep -iA3 net

or for USB adapters:

lsusb

In the output, look for lines mentioning Network controller or Wireless. For example:

03:00.0 Network controller [0280]: Intel Corporation Wi-Fi 6 AX200 [8086:2723] (rev 1a)

Subsystem: Intel Corporation Wi-Fi 6 AX200NGW [8086:0024]

Kernel driver in use: iwlwifi

Kernel modules: iwlwifi

Please pay attention to three key parameters:

  • 🔹 Chip name (For example, Intel AX200 or Realtek RTL8188EE) - will be needed to search for drivers.
  • 🔹 Kernel driver in use - if this is empty, the driver is not loaded.
  • 🔹 Kernel modules — a list of available kernel modules for this device.
⚠️ Attention: If the command output does not mention the Wi-Fi adapter, check if it is physically turned on (some laptops have a hardware switch or a key combination). Fn + F2/F12). Also make sure that the adapter is not disabled in BIOS/UEFI.

If the driver is not loaded, try loading it manually:

sudo modprobe iwlwifi

For adapters Realtek or Broadcom Additional packages may be required. For example, in Ubuntu/Debian:

sudo apt install firmware-realtek

2. Connecting to Wi-Fi via the graphical interface (NetworkManager)

Most modern distributions use NetworkManager — a utility for managing networks with a graphical interface. If you have a desktop environment installed (GNOME, KDE Plasma, XFCE), the connection process is as simple as possible:

  1. Click on the network icon in the taskbar (usually in the upper right corner).
  2. Select the desired network from the list.
  3. Enter the password and confirm the connection.

If the network icon is missing, check if NetworkManager is running:

systemctl status NetworkManager

If the service is not active, start it:

sudo systemctl start NetworkManager

sudo systemctl enable NetworkManager

For hidden networks (those that do not broadcast SSID) in NetworkManager:

  1. Click "Connect to hidden network".
  2. Enter SSID (network name) manually.
  3. Select the security type (WPA2-PSK or another).
  4. Enter your password and save your settings.
⚠️ Attention: In some distributions (for example, Arch Linux (with minimal installation) NetworkManager may be missing. Install it with the command sudo pacman -S networkmanager and enable the service as shown above.

Make sure that the Wi-Fi adapter is detected by the system (ip a)

Check NetworkManager status (systemctl status NetworkManager)

Install proprietary drivers (if required)

Reboot the system after installing the drivers-->

3. Setting up Wi-Fi via the terminal (wpa_supplicant)

If the graphical interface is not available or you prefer to work in the console, use wpa_supplicant — a standard tool for managing Wi-Fi in Linux. Here are the step-by-step instructions:

First, check the name of your wireless interface:

ip a

Usually it is wlan0, wlp3s0 or something similar. Remember it.

Next, edit the configuration file /etc/wpa_supplicant/wpa_supplicant.conf:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Add a block for your network to it (replace your_ssid And your_password):

network={

ssid="your_ssid"

psk="your_password"

key_mgmt=WPA-PSK

}

To connect, follow these steps:

sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

sudo dhclient wlan0

The first command starts wpa_supplicant in the background, the second one receives an IP address via DHCP.

To make the connection automatically at boot, add to /etc/rc.local (or create a systemd service):

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

dhclient wlan0

Parameter in wpa_supplicant.conf Description Example of meaning
ssid Network name (case sensitive!) "MyWiFiNetwork"
psk Password (for WPA-PSK) "securepassword123"
key_mgmt Authentication type WPA-PSK, WPA-EAP, NONE (for open networks)
priority Network priority (if there are several) 5

4. Troubleshooting Common Wi-Fi Errors on Linux

Even after proper setup, problems may still arise. Here are the most common errors and how to solve them:

Error: "Device not ready" or adapter does not turn on

Reasons:

  • 🔌 The adapter is disabled by hardware (switch on the laptop case).
  • 🔄 The driver is not loaded or conflicts with another module.
  • ⚡ Missing firmware (microprograms for the chip).

Solutions:

  1. Check the physical connection of the adapter.
  2. Reload the driver module:
    sudo modprobe -r iwlwifi && sudo modprobe iwlwifi
  3. Install missing firmware. For example, for Intel:
    sudo apt install firmware-iwlwifi

Error: "Authentication failed" or "Wrong password"

Often occurs due to:

  • 🔑 Incorrectly entered password (check the case!).
  • 🔄 Incompatible encryption type (for example, the network uses WPA3, and your adapter only supports WPA2).
  • ⏳ Expired DHCP lease (try sudo dhclient -r wlan0).

Solution:

  1. Make sure the password is correct (try connecting from another device).
  2. Check your router settings: sometimes changing the Wi-Fi channel helps auto to a fixed one (for example, 6 or 11).
  3. Update wpa_supplicant:
    sudo apt update && sudo apt upgrade wpasupplicant

Error: Slow speed or frequent connection drops

Possible causes and solutions:

Problem Diagnostics Solution
Weak signal iwconfig wlan0 | grep Signal Move closer to the router or use repeater.
Channel congestion sudo iwlist wlan0 scanning | grep Frequency Change the channel on the router (for example, from 6 on 11).
Outdated driver dmesg | grep iwlwifi Update the kernel or install the latest driver from the manufacturer's website.
How to check real Wi-Fi speed in Linux?

Use the utility iperf3 To test the speed between two devices on a local network:

  1. On one device (server), run: iperf3 -s
  2. On the other (client): iperf3 -c [server_IP]

To test your internet speed, use speedtest-cli:

sudo apt install speedtest-cli

speedtest-cli --simple

5. Setting up Wi-Fi for specific cases

Sometimes unconventional solutions are required. Let's look at three common scenarios.

Connecting to a hidden network (not broadcasting SSID)

If your network is hidden, wpa_supplicant.conf add parameter scan_ssid=1:

network={

ssid="hidden_network_name"

scan_ssid=1

psk="password"

key_mgmt=WPA-PSK

}

In NetworkManager, when connecting manually, also check the "Connect even if the network is not broadcast" box.

Using Wi-Fi as an access point (Internet sharing)

To share the Internet from Linux to other devices, install hostapd And dnsmasq:

sudo apt install hostapd dnsmasq

Edit /etc/hostapd/hostapd.conf:

interface=wlan0

driver=nl80211

ssid=MyHotspot

hw_mode=g

channel=6

wpa=2

wpa_passphrase=12345678

wpa_key_mgmt=WPA-PSK

Then run:

sudo systemctl start hostapd

sudo systemctl start dnsmasq

⚠️ Attention: Wi-Fi sharing may interfere with your regular connection. If you lose internet access after setting it up, check your rules. iptables or use a separate USB adapter for the access point.

Connecting to the network with a captive portal (hotels, airports)

Some public networks require authorization via a web page. After connecting to such a network:

  1. Open your browser and try to go to any website (for example, http://neverssl.com).
  2. You should be redirected to the login page.
  3. If redirection does not occur, manually open http://1.1.1.1 or http://captive.apple.com.

If the page does not open, check:

  • 🌐 Is the IP address obtained correctly? (ip a show wlan0).
  • 🔗 Is there a default route (ip route).
  • 🔒 Is the firewall blocking it?sudo ufw disable for the test).

6. Optimizing Wi-Fi in Linux for Stable Operation

To minimize connection issues, follow these guidelines:

1. Update the kernel and drivers. Many Wi-Fi bugs are fixed in new kernel versions. Check the current version:

uname -r

Please update it (for example, in Ubuntu):

sudo apt update && sudo apt upgrade linux-image-generic

2. Use 5 GHz instead of 2.4 GHz. The 5 GHz band is less crowded and offers faster speeds. To check supported frequencies:

iw list | grep -A 10 "Supported frequencies"

3. Set up energy saving. By default, many adapters reduce power to save battery life, which can lead to disconnects. Disable this:

sudo iw dev wlan0 set power_save off

To make the change permanent, add the command to /etc/rc.local.

4. Prioritize networks. If you have multiple saved networks, edit them. wpa_supplicant.conf, adding the parameter priority (the higher the number, the higher the priority):

network={

ssid="HomeWiFi"

psk="password"

priority=10

}

7. Alternative Wi-Fi Management Tools

Besides NetworkManager And wpa_supplicant, there are other utilities for setting up Wi-Fi in Linux:

Tool Description Installation When to use
nmcli Console interface for NetworkManager Installed by default in most distributions For automation or scripts
wavemon Signal and channel level monitor sudo apt install wavemon For diagnostics of interference
iw A low-level utility for working with wireless devices Installed by default To fine-tune the adapter
connman Lightweight Connection Manager (NetworkManager Alternative) sudo apt install connman For minimalist systems (e.g. servers)

Example of use nmcli to connect to the network:

nmcli dev wifi list # Show available networks

nmcli dev wifi connect "SSID" password "password"

To monitor the signal using wavemon:

sudo wavemon

In the interface, you will see graphs of signal strength, channel load, and other useful metrics.

8. Wi-Fi Security on Linux: What You Need to Know

Linux provides powerful tools for securing wireless connections, but it requires a conscious approach. Here are the key points:

1. Use modern encryption protocols. Avoid outdated standards:

  • WPA3-PSK — the safest option.
  • ⚠️ WPA2-PSK - acceptable, but vulnerable to attacks like KRACK.
  • WEP or WPA - are unsafe and can be hacked in minutes.

2. Set up a firewall. By default, many distributions allow all incoming traffic. Restrict it with ufw:

sudo ufw allow out on wlan0

sudo ufw deny in on wlan0

3. Disable unnecessary services. Check which ports are open:

sudo ss -tulnp

If you see suspicious processes (for example, open telnet or ftp), close them.

4. Use a VPN for public networks. Your traffic may be intercepted in hotels, cafes, and airports. Install OpenVPN or WireGuard:

sudo apt install openvpn

sudo openvpn --config client.ovpn

⚠️ Attention: If you are connecting to a corporate network with 802.1X (Enterprise), never store the password in clear text in configuration files. Use wpa_supplicant with hashed credentials or specialized tools like freeradius-client.
wpa_passphrase "your_ssid" "your_password"

This tool will create an encrypted psk, which can be safely stored in configuration files.-->

FAQ: Frequently Asked Questions about Wi-Fi in Linux

My Wi-Fi adapter isn't detected by the system. What should I do?

First check if the adapter is visible in the output lspci or lsusbIf yes, but the driver is not loaded:

  1. Install proprietary drivers (eg. sudo ubuntu-drivers autoinstall in Ubuntu).
  2. Check if the adapter is blocked rfkill:
    rfkill list
    

    sudo rfkill unblock wifi

  3. Update your kernel to the latest version.

If the adapter is not visible even in lspci, it may be disabled in BIOS or faulty.

How to connect to Wi-Fi without a password (open network)?

IN wpa_supplicant.conf use:

network={

ssid="free_wifi"

key_mgmt=NONE

}

In NetworkManager, select the network and click Connect without entering a password.

⚠️ Attention: Open networks are unsafe. Avoid transmitting sensitive data (passwords, banking details) without a VPN.
Why does Wi-Fi work in Windows but not in Linux?

Most often, this is due to missing drivers or firmware. Solutions:

  1. Check your adapter model in Windows (Device Manager → Network Adapters) and find the driver for Linux.
  2. Install firmware packages (eg. firmware-iwlwifi For Intel).
  3. Try a live distribution (eg. Ubuntu Live USB) - if Wi-Fi works there, the problem is in your system settings.

For some adapters (eg. Broadcom BCM43xx) require proprietary drivers. In Ubuntu, they can be installed through "Additional Drivers" (software-properties-gtk).

How to reset all Wi-Fi settings in Linux?

To delete all saved networks and start from scratch:

  1. Remove configuration files:
    sudo rm /etc/NetworkManager/system-connections/*
    

    sudo rm /etc/wpa_supplicant/wpa_supplicant.conf

  2. Restart services:
    sudo systemctl restart NetworkManager
    

    sudo systemctl restart wpa_supplicant

  3. For a complete reset, also clear the DHCP cache:
    sudo rm /var/lib/dhcp/*

After this, all networks will have to be configured again.

Can you use Wi-Fi 6 (802.11ax) on Linux?

Yes, but with some reservations:

  • 🆗 Adapters based on Intel AX200/AX210 And Qualcomm FastConnect are well supported by kernel 5.4+.
  • ⚠️ Some Wi-Fi 6 features (e.g. OFDMA or Target Wake Time) may work unstably.
  • 🔄 For full support, please update your kernel to version 5.10 or later.

You can check the current speed and standard using the command:

iw dev wlan0 link

Look for lines like TX bitrate: 866.7 Mbps 80MHz HE-MCS 9 - this indicates Wi-Fi 6 (HE - High Efficiency).