setup wi-fi on raspberry pi

How to Configure Wi-Fi on Raspberry Pi? (4 Easy Ways)

If you click our links and make a purchase, we may earn an affiliate commission. Learn more

All recent Raspberry Pi models include a wireless connection, but the configuration is not always easy, especially if you don’t have a graphical interface or need to set up an advanced Wi-Fi configuration. Don’t worry, I’ll explain everything with simple steps in this tutorial.

On Raspberry Pi, Wi-Fi can be configured during the OS installation using Raspberry Pi Imager, by entering the network name and password in the advanced settings. It can also be set up later from the desktop using the network icon in the taskbar or raspi-config in the terminal.

I’ll show you how to do everything in this post. There are several solutions available depending on your system version and access to it. I’ve ordered them from most recommended / simple to most advanced, so feel free to jump directly to the method you’re looking for.

If you’re feeling lost in all the Raspberry Pi jargon, I’ve got something to help you out. I’ve created a free glossary that explains all the essential terms and abbreviations in a way that’s easy to understand. It’s a great resource to have by your side. Get your free copy here.

Set Wi-Fi in Raspberry Pi Imager

Configuring before first boot (recommended)

The easiest way currently to set up your Wi-Fi connection before the first boot is to use Raspberry Pi Imager.

This tool includes a ‘Customisation’ section where you can set up a few things when installing a new system, including the wireless network you want to use:

  • Download and install Raspberry Pi Imager.
    If you don’t have it yet, you can get it for free from the official website.
    It’s available for Windows, Linux, and even for Raspberry Pi OS.
  • Make the essential selections:
    • Device – choose your Raspberry Pi board, or select “No filtering” at the bottom.
    • OS – choose the operating system you want to use (let’s say Raspberry Pi OS).
    • Storage – choose the storage device (SD card or USB).
    • When you’re done with each step, click the NEXT button to continue.
  • Customisation – In this section, you’ll customize your new system.
    • Hostname – give your system a name.
    • Localisation – choose your time zone and keyboard.
    • User – create your first user account
  • Configure Wi-Fi settings in the ‘Wi-Fi’ step.
    Here, you’ll enter your network name and its password.
    Hit NEXT, skipping the next parts if you’d like, until you get down to the ‘Writing’ step.
  • On the ‘Writing’ step, you’ll see a summary of the choices you’ve made.
    Click the WRITE button, and flashing will begin.

Your Raspberry Pi will be connected automatically to your network on the first boot.

Note: Some versions of Raspberry Pi Imager v1.9 did not set the country code correctly, causing Wi-Fi connection failures. This bug has since been patched. If you’re having issues, download and install the newest version of Imager here.

If you’re using this tool for the first time, please take a look at my complete guide about Raspberry Pi Imager here. I explain everything in more detail and give you many advanced tips.

Download the Pi Glossary!
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!
Download now
Prefer reading without ads and popups?
Members get an ad-free version of every guide, plus exclusive project support.
Join the Community | Sign In

Configure Wi-Fi on Raspberry Pi OS Desktop

Connecting via GUI

What if your operating system is already installed and you need to change your Wi-Fi settings?
Here are two ways to do it on Raspberry Pi OS from the desktop interface.

Keep in mind that if you’re using a USB Wi-Fi adapter on your Raspberry Pi, not all solutions will work. Click on that link for more details.

Via the Welcome Wizard

If it’s your first boot and you haven’t configured anything via Raspberry Pi Imager or other methods, you should get a “Welcome to Raspberry Pi” wizard asking you to configure a few things on your system.

It’s the easiest way to configure the Wi-Fi on a newly installed Raspberry Pi OS, so don’t miss this menu. You’ll be asked to configure the country, set the keyboard layout, and create a new user.
Then you’ll get a window like this to select a wireless network:

Select your Wi-Fi network SSID in the list, click “Next,” and type the password on the following screen:

A few seconds later, the Raspberry Pi will be connected to your Wi-Fi.

Via the Taskbar

If you missed the welcome wizard or skipped the Wi-Fi configuration here, you can change it at any time from the taskbar panel.

At the top-right of your screen, you have the main panel with the menu, shortcuts, and the clock.

Download the Pi Glossary!
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!
Download now
  • Near the clock, there is a network symbol (showing two red crosses if you’re disconnected, or two blue arrows if you’re connected via Ethernet).
  • Click on it, and a list of available wireless networks will appear.
    wifi connection manager on raspberry pi os desktop
  • Select your network from the list and enter your password.

That’s it, you should be connected instantly. It’s not very complicated either 🙂

Enable Wi-Fi on Raspberry Pi OS Lite

Connecting via command line

If you’re on Raspberry Pi OS Lite and only have a command-line interface, you may need more help to find out how to configure your network.

Let’s explore two methods to do this (the first one is recommended).

Using the raspi-config Tool

The Raspberry Pi Foundation was thinking of you. Even if you’re on a black-and-white terminal, there’s a tool to help you configure everything on the system including your wireless network.

This tool is named raspi-config, and it’s available by default on Raspberry Pi OS Lite:

  • Launch the Raspberry Pi Software Configuration Tool with:
    sudo raspi-config
  • Go to System Options > Wireless LAN.
  • Type your SSID and your password.
  • You may get a warning that it won’t connect unless you set the country code first.
    If so, go to Localisation Options > WLAN Country and select your country.
  • Save & exit the tool.
    After a few seconds, your Pi will be connected to the wireless network you chose.

That’s the easy way to configure Wi-Fi on Raspberry Pi OS Lite.

Note: On older versions of Raspberry Pi OS, the menu may be slightly different. If you can’t find it, the wireless configuration is probably under Network Options > Wi-Fi.

Manual Configuration With nmtui

If for any reason, raspi-config is not an option for you, there are other tools you can try.

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

Also: Don’t waste money — read this guide before picking your Raspberry Pi.

Since Raspberry Pi OS Bookworm, wpa_supplicant is no longer being used. The good news is that there’s a newer and easier tool to manually configure Wi-Fi.

  • Launch the Network Manager configuration tool with this command:
    sudo nmtui
  • A window like this one shows up:
  • Simply use the wizard to “Activate a connection” and access your Wi-Fi network:

Once a connection is added (like the Wi-Fi network in my example), you can choose “Edit a connection” to change the security, enter the password, or set a static IP address.

nmtui ipv4 configuration options

Quick note: If you find it hard to remember all these commands, I’ve put them all on a one-page cheat sheet. You can download it for free here so you have it handy whenever you're working on a project.

Headless + Manual Configuration

Doing it the hard way

I call this “headless” because it’s the method to use when you don’t have a screen on your Raspberry Pi.

Raspberry Pi OS Bookworm/Trixie and Newer

Note: Using wpa_supplicant doesn’t work on Raspberry Pi OS Bookworm/Trixie, which have since switched to using Network Manager. As of this update, there is no manual method that works prior to first boot to create an automatic Wi-Fi connection.

The easiest alternative is to use the Imager method above.
(For those who don’t want to give up, you might be able to use nmcli with a boot script, but I was not able to test a method that worked at this time.)

Bonus Tip: Besides setting your Wi-Fi connection automatically, another thing you may want to do if you really use your Raspberry Pi without a screen is to enable the SSH service automatically. On Raspberry Pi OS, SSH is disabled by default.

To enable it automatically, you have to create a file and add it to the SD card.
Just create an empty file named “ssh” and copy it to the boot partition.
That’s enough to tell Raspberry Pi OS to start the SSH service automatically on boot.

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

It’s something I use all the time, and I explained it in more detail in this tutorial on how to install a Raspberry Pi without a screen and keyboard.

Raspberry Pi OS Bullseye and Older Versions

The idea is to add a new file on the SD card (or USB drive) that will include the Wi-Fi configuration. This file is named “wpa_supplicant.conf” and will include your Wi-Fi credentials.

Here are the steps to create this file:

  • Open your favorite text editor on your PC.
    The basic editor from your operating system will be fine (Notepad for example).
  • Copy and paste these lines into it:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
  ssid="YOURSSID"
  scan_ssid=1
  psk="YOURPASSWORD"
  key_mgmt=WPA-PSK
}
  • Replace the variables with your SSID, password, and country code.
    This is the configuration for a standard WPA-PSK wireless network, check the documentation for more advanced options.
  • Save the file to a location you can find easily.
  • Insert your SD card into your PC.
    If you don’t have an SD card reader on your PC, you can get a cheap USB-to-SD card adapter on Amazon.
  • Copy the wpa_supplicant.conf file to the boot partition.

Now when you boot your new Raspberry Pi OS system the first time, it should automatically connect to your Wi-Fi network.

You can find many examples here to adapt the configuration to your network (if you use WEP, EAP, or any other security options).

And if you also need to set up a static IP address on your Raspberry Pi, you can click on the link to my other tutorial where I explain all the steps (scroll to the end of the article for the method with command lines).


🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

Stuck on this project? Ask me or other Pi users in the RaspberryTips Community. We help each other out and you'll get answers quick. Join and fix it together.

Going Further

That’s it, you now know different ways to set up the Wi-Fi on your Raspberry Pi, whatever the system version you use or your network complexity.

As a general rule, I would recommend using the customization options in Raspberry Pi imager whenever possible, but you have discovered many other solutions to suit each situation. You learned a lot today!

Now that you’re connected to the Internet, you can start having fun with many different projects on your Raspberry Pi. Here are a few articles I wrote that you can check out for more ideas :

Whenever you’re ready, here are other ways I can help you:

Test Your Raspberry Pi Level (Free): Not sure why everything takes so long on your Raspberry Pi? Take this free 3-minute assessment and see what’s causing the problems.

The RaspberryTips Community: Need help or want to discuss your Raspberry Pi projects with others who actually get it? Join the RaspberryTips Community and get access to private forums, exclusive lessons, and direct help.

Master your Raspberry Pi in 30 days: If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.

Master Python on Raspberry Pi: Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts.

You can also find all my recommendations for tools and hardware on this page.

Similar Posts

3 Comments

  1. I run Motioneye on my PI, I have recently changed my home router, now the PI cannot log in because the router and password info is incorrect. I am unable to get to the command screen as Motioneye starts up on boot? how do I now change the router info please?

    1. Hi Ken,

      I suppose you want to say “motionEyeOS”
      I don’t know this OS, but in the wiki, they say that the configuration is in the wpa_supplicant.conf file, maybe /data/etc/wpa_supplicant.conf

      If you find it, you can edit the file with the default editor and update your settings

Comments are closed.