How to Set Up Wi-Fi on Ubuntu: From Beginner to Pro

operating system Ubuntu has long ceased to be the exclusive domain of programmers and system administrators, becoming a fully-fledged platform for everyday use. However, unlike Windows or macOS, where connecting to a wireless network often occurs automatically and seamlessly, in the Linux world this process can require attention to detail. This is especially true when working with specific applications. network equipment or when using minimalistic versions of the distribution.

Modern graphical shells such as GNOME or KDE Plasma, offer intuitive interfaces that hide the complexity of network configurations behind beautiful icons. However, knowing how to manage connections "under the hood" is a critical skill for any Linux PC owner. This will allow you to quickly diagnose problems when the graphical interface suddenly stops responding, or configure specific security settings unavailable in the standard menu.

In this article, we'll cover all aspects of connection: from basic password entry in the graphical interface to fine-tuning via the command line. We'll also cover installing proprietary drivers, which are often the reason why a wireless module isn't listed as available. Understanding these processes will make your work easier. Ubuntu stable and predictable, regardless of the whims of the hardware.

Basic connection via graphical interface

For most users, especially those new to Linux, the easiest and fastest way to log in is through the standard graphical interface. In the standard desktop environment GNOME, which comes out of the box with the standard version of the distribution, network management is implemented as logically as possible. You don't need to remember complex commands or edit configuration files manually unless absolutely necessary.

To initiate a connection, look in the upper-right corner of the screen, where the system tray is located. There you'll find an icon resembling a fan or antenna. Clicking it will open a drop-down menu displaying a list of available wireless networks within range of your card. If the list is empty, make sure the Wi-Fi module isn't disabled using a physical switch on the laptop or a software button in the system.

After selecting the desired network from the list, the system will ask for a password. After entering it NetworkManager — a background service responsible for connection management — will attempt to obtain an IP address from the router and configure DNS. In 95% of cases, this process results in a successful connection to the global network. However, if you are using a corporate network or specific encryption protocols, additional settings may be required in the "Network Settings" menu.

It's worth noting that the graphical interface sometimes hides important details. For example, it may automatically select the wrong security protocol or incorrectly detect the addressing type. Therefore, even when using a mouse, it's helpful to check the advanced settings to verify whether IPv4 or IPv6 is being used by default.

Setting up Wi-Fi via the command line (nmcli)

For system administrators and terminal enthusiasts, tools nmcli (NetworkManager command line interface) is an indispensable tool. It allows you to manage network connections without the need for a graphical shell, making it ideal for server versions of Ubuntu or for remote management via SSH. Working with nmcli gives complete control over every connection parameter.

The first step is always to scan the environment. The command nmcli device wifi list will display a table of all available access points, showing their SSID, signal strength, channel, and security type. If you don't see your network in the list, it may be hidden or too far away. In this case, you can force a scan to refresh the list.

To connect directly to a network, use the connect command, which requires you to specify the network name (SSID) and password. The syntax is fairly simple, but requires careful attention to the case and special characters in the password. If the network name or password contains spaces, they must be enclosed in quotation marks, otherwise the terminal will interpret the command incorrectly.

⚠️ Note: When entering your password in the terminal, characters are not displayed on the screen (not even asterisks). This is standard Linux security behavior; simply enter your password blindly and press Enter.
📊 Which network setup method do you prefer?
Graphical User Interface (GUI): Terminal (CLI): Automatic Configuration: I don't need Wi-Fi

After successfully entering the command, the system will create a connection profile and attempt to activate it. The connection status can be checked with the command nmcli connection show --activeIf everything went well, you'll see your connection name in the list of active connections. If an error occurs, the system will return an error code, which can be deciphered in the documentation or logs.

Using the command line also makes it easy to switch between profiles. For example, you can create a separate profile for home use with a static IP address and another for work with automatic address acquisition. Switching between them takes a split second and doesn't require a service restart.

Installing and updating Wi-Fi drivers

One of the most common problems Ubuntu users face is the lack of drivers for the wireless adapter. While the Linux kernel (kernel) contains a huge number of built-in open source drivers, some network equipment manufacturers, especially Broadcom and some models Realtek, require the installation of proprietary (closed) drivers for correct operation.

You can check the status of installed drivers using the "Additional Drivers" utility, accessible through the app search. This utility will automatically scan your hardware and suggest available driver options. If you see your Wi-Fi adapter listed as "not in use" or "using an alternative driver," this is the direct cause of connection issues.

To manually install or check drivers in the terminal, the command is often used lspci or lsusb (for USB dongles) to find out the exact model of the device. Knowing the model, you can find the corresponding package in the repositories. Often, the required package is called firmware-b43-installer for Broadcom or firmware-realtek for the corresponding chips.

Manufacturer Driver type A common problem Solution
Broadcom Proprietary The adapter is not detected Installing bcmwl-kernel-source
Realtek Open/Proprietary Unstable connection Updating the kernel or firmware
Intel Open (iwlwifi) Disappears after sleep Setting up energy saving
MediaTek Open Low speed Checking antennas

If Wi-Fi isn't working and there are no drivers, a vicious circle arises. In such cases, it's recommended to use a USB modem from an Android smartphone (USB tethering mode) or an Ethernet cable to initially download the necessary packages.

What to do if the driver is not in the repositories?

If the standard Ubuntu repositories don't contain the required driver, you may need to download the source code from the manufacturer's website and compile it manually. This is a complex process that requires installing the build-essential and linux-headers packages. Be careful, as an incorrectly compiled kernel module can cause system instability.

Setting up a static IP address

In some scenarios, such as setting up a home server, setting up a printer, or forwarding ports, it's important for your computer to always have the same IP address on the local network. Dynamic address allocation (DHCP) is convenient, but it doesn't guarantee that the address won't change after a router reboot or the lease expires.

You can configure a static address either through the graphical interface or through the terminal. In the GUI, go to the network settings, select the desired connection, go to the IPv4 tab, and switch the method from "Automatic (DHCP)" to "Manual." Here, you'll need to enter the IP address, subnet mask, gateway (usually your router's address), and DNS servers.

When using nmcli The process is as follows: first, change the addressing method, then add the address and gateway. It's important to choose an address that's in the same subnet as your router but outside the DHCP pool to avoid address conflicts with other devices.

For example, if your router distributes addresses from 192.168.1.100 to 192.168.1.200, it's best to set a static address for Ubuntu in the range 192.168.1.2 - 192.168.1.99. This will ensure stability and avoid network conflicts.

Diagnosing and resolving connection problems

Even the most stable system can occasionally experience glitches. If Ubuntu suddenly stops detecting networks or can't connect to a known access point, don't panic. There's a clear procedure that can resolve 90% of issues without reinstalling the system.

The first thing to do is check the status of the network manager. The command systemctl status NetworkManager will show whether the service is running. If it's stopped or is running with errors, you can restart it. It's also helpful to check the system logs, which may contain entries about the reasons for the connection interruption.

  • 🔍 Check RF blocking: Sometimes the Wi-Fi module is blocked at the software level. The command rfkill list will show the blocking status. If you see "Soft blocked: yes", use the command rfkill unblock wifi.
  • 🔄 Reset network settings: In the graphical interface, you can forget a network and reconnect it by entering the password. This often helps if the router's security settings have changed.
  • 📡 Channel interference: If you live in an apartment building, the airwaves may be congested. Use utilities to analyze the airwaves and switch your router to a less crowded channel (e.g., 1, 6, or 11 for 2.4 GHz).

Pay special attention to power saving settings. Linux, by default, tries to conserve power by disabling the Wi-Fi module when idle. This can lead to connection drops or an inability to quickly reconnect after waking from sleep mode.

⚠️ Note: Settings interfaces and menu layout may vary depending on the Ubuntu version and desktop environment used (GNOME, KDE, XFCE). Always consult the official documentation for your specific distribution.

Optimizing Wi-Fi power saving

For laptop owners, battery life is a priority, and aggressive Wi-Fi power-saving settings can significantly extend battery life. However, as mentioned earlier, this often comes at the expense of connection stability. The system may put the card into sleep mode too frequently, resulting in dropped data packets and fluctuating ping.

To disable power saving for Wi-Fi, you need to edit the NetworkManager configuration file. This is done by creating or modifying a file in the directory /etc/NetworkManager/conf.d/. In this file you need to specify the parameter wifi.powersave with a value that disables the economy mode.

Meaning 2 means that energy saving is enabled, and the meaning is 3 — Disabled. By changing this setting, you'll notice a slight increase in power consumption, but the connection will become more responsive and stable, especially in areas with weak signal strength. For desktop PCs plugged into a power outlet, disabling this feature is recommended.

☑️ Wi-Fi Diagnostic Checklist

Completed: 0 / 1
How do I know which driver is currently being used?

Use the command lspci -k in the terminal. Find the line with your network controller in the output. Below it, you'll see the line "Kernel driver in use," which indicates the name of the active driver (e.g., iwlwifi, ath9k, b43). If the driver name says "Kernel modules:...," then the driver is loaded but may not be activated for this device.

Why doesn't Ubuntu see 5GHz Wi-Fi?

This may be due to regional settings. In some countries, the use of certain 5 GHz channels is restricted. Check the country code in your router settings and in the system (command sudo iw reg get). Also, older adapters may simply not support the 802.11ac or ax standard.

Is it possible to share Wi-Fi with Ubuntu?

Yes, modern versions of Ubuntu allow you to use your laptop as a hotspot. In the network settings, select "Use as Hotspot." The system will create a virtual network that other devices can connect to using your PC's internet connection.