How to disable Wi-Fi on Raspberry Pi? (7 ways, Lite/Desktop)


In a recent tutorial, I showed you how to use Wi-Fi on your Raspberry Pi (with 5 different solutions)
Here, I will show you the opposite :). That’s to say, how to disable your Wi-Fi adapter and use only the Ethernet cable.

How to disable Wi-Fi on Raspberry Pi?
Wi-Fi is not necessary when you always use your Raspberry Pi connected with an Ethernet cable.
The easiest way is to turn it off manually with sudo ifconfig wlan0 down.
But it’s not permanent, and there are many other solutions to do this
.

In this post, I will show you 7 ways to disable your Wi-Fi forever (until you reverse your changes).
Most of them will work on any operating system, but I only tested on Raspberry Pi OS.

By the way, if you are really interested in improving your skills on Raspberry Pi, I highly recommend checking out my e-book here. It’s a 30-day challenge from beginner to master, with step-by-step tutorials and many projects to practice along the way.

1: Crontab

Download the Pi Glossary!
If you are lost in all these new words and abbreviations, request my free Raspberry Pi glossary here (PDF format)!

As I already showed you half of the first solution, I will start with this one.
In the introduction, I gave you one command to temporarily disable your Wi-Fi interface.

Here is one way to disable it automatically at each reboot:

  • If you are on Raspberry Pi OS Desktop, start by opening a terminal (or jump to the next solution, easier for you).
  • Then open the crontab in edit mode:
    sudo crontab -e
    Crontab is something like a tool to configure scheduled tasks, you can learn more here about Linux crons.
    When you use sudo crontab instead of crontab, you are scheduling the tasks for the root user
  • If it’s the first time you do this, select your favorite text editor.
    Press enter to stay with nano:
  • In the crontab file, add the following line at the end:
    @reboot ifconfig wlan0 down
  • Save and exit (CTRL+O and CTRL+X with nano).
Raspberry Pi Bootcamp
Sale: 10% off today.
Take it to the next level.
I'm here to help you get started on Raspberry Pi.
Learn all the skills you need in the correct order.

Your Wi-Fi adapter will now stop directly at each boot, so you are sure to use the Ethernet cable all the time.
To bring the Wi-Fi up again (temporarily), use:
sudo ifconfig wlan0 up
Or remove the line in the crontab to enable it at each boot.

Are you a bit lost in the Linux command line? Check this article first, for the most important commands to remember, and a free downloadable cheat sheet so you can have the commands at your fingertips.

2: Raspberry Pi OS Desktop

Most of my solutions here are for Raspberry Pi OS Lite.
If you are on Raspberry Pi OS Desktop, there is an easy way to disable the Wi-Fi adapter:

  • On the right top bar (near the clock), find the Wi-Fi icon.
  • Click on it (left click).
  • A menu like this shows up:
  • Click on “Turn Off WiFi” to disable it.

You need to do this after each reboot, but it’s this easy.
I didn’t find a permanent way on Raspberry Pi OS Desktop.

If you need help getting started on Raspberry Pi, I have an entire course to guide you through your first steps. I’ll help you use the perfect hardware, plug everything in and install your first system. You’ll also do your first project with me, just to make sure you are ready for the next level. Get all the information on this page if you are interested.

3: Raspi blacklist

The third way to disable Wi-Fi on your Raspberry Pi is more extreme.
On Debian, as on many other distributions, modprobe is a program that loads kernel modules on boot.
You can choose to disable some modules, like the Wi-Fi drivers for your Raspberry Pi:

  • In a terminal, open the following file:
    sudo nano /etc/modprobe.d/raspi-blacklist.conf
  • Paste these two lines in it (the file is probably empty):
    blacklist brcmfmac
    blacklist brcmutil
  • Save and exit (CTRL+O, CTRL+X).

Then reboot your Raspberry Pi (with an Ethernet cable plugged), and you won’t see the Wi-Fi adapter on the next boot.
Remove the two lines from the file to reactivate it.

4: Config.txt

Another method you can try is to edit the Raspberry Pi OS configuration file.
The good news is that you can even do this on a fresh Raspberry Pi OS SD card in order to disable the Wi-Fi directly.

Here is how to do this:

  • You can open a terminal, connect via SSH, or edit the file directly on the SD card from your computer.
  • Open the config.txt file with nano:
    sudo nano /boot/config.txt
  • Find the following line:
    # Additional overlays and parameters are documented /boot/overlays/README
  • And add these two lines under it:
    dtoverlay=disable-wifi
    dtoverlay=disable-bt

    The second line is for the Bluetooth module.
  • Save and exit (CTRL+O, CTRL+X).
  • Reboot your Raspberry Pi to check if everything works as expected.

Note: on older Raspberry Pi OS versions, you need to add pi3 at the beginning, like this:
dtoverlay=pi3-disable-wifi
dtoverlay=pi3-disable-bt

Master your Raspberry Pi in 30 days
Sale: 10% off today.
Download the eBook.
Uncover the secrets of the Raspberry Pi in a 30 days challenge.
Learn useful Linux skills and practice multiples projects.

Editing files on a fresh Raspberry Pi OS SD card is a great way to save time for the first boot. You can do many things like this as explained in this other article.

5: Modprobe

This one is almost the same as the blacklist solution, but it’s a temporary one.
You can use modprobe as a command instead of editing the configuration file.

Here is the command (use this in a terminal if you are on Raspberry Pi OS Desktop):
sudo modprobe -rv brcmfmac
This command will also remove brcmutil and cfg80211 automatically.

To bring back the Wi-Fi adapter, use this one:
sudo modprobe brcmfmac

If the first solution didn’t work for you, you can also use this command in a crontab to do it automatically on boot.

6: RFKill

RFKill is a command line tool to query, enable or disable radio transmitters on a system.
That’s exactly what we want to do, so we can use RFKill to disable our Wi-Fi adapter.
RFKill is available directly on any Raspberry Pi OS version.

Here is how to do this:

  • Open a terminal and enter the following commands:
    sudo rfkill block wifi
    sudo rfkill block bluetooth
  • This should disable your Wi-Fi and Bluetooth cards directly.

The block command is persistent after a reboot.
To enable Wi-Fi or Bluetooth, use the unblock command like this:
sudo rfkill unblock wifi
sudo rfkill unblock bluetooth

7: Systemctl

Finally, the last solution I want to show you is to use systemctl to stop the wireless services.
Systemd is the service manager on many Linux distributions, and you can use systemctl to see and control each service state.

Master Python on Raspberry Pi
Sale: 10% off today.
Get the eBook.
Do more with your Raspberry Pi, learn the useful concepts and take the shortcuts.
You miss half of the fun of using a Raspberry Pi if you don’t know anything about Python.

Here are the three commands to do to disable all services:
sudo systemctl disable wpa_supplicant
sudo systemctl disable bluetooth
sudo systemctl disable hciuart

Then reboot your Pi to apply the changes.
Use the “enable” command to use the Wi-Fi again.

Note: This is not working on my Pi 4 with the latest Raspberry Pi OS, but I have seen these commands many times, and I’m sure to have used them in the past, so it’s probably working on other OS or Raspberry Pi models. I give it to you as a last chance if everything else is not working for you.

Tips to improve your network speed

One of the reasons you might be reading this tutorial is if you have network issues, like disconnections or low speed.
Here are a few other things you can try to solve this:

  • Use a Raspberry Pi 4: The previous Raspberry Pi models didn’t include a gigabit Ethernet port (even the Raspberry Pi 3B+ is limited to 300 MB max). By using a recent model, you can really improve your network speed for projects where it’s essential.
  • Use a better switch: If you have an old router that provides an Internet connection, it may not be the best solution for a fast network between your computer and your Raspberry Pi. Adding a faster switch, with 1 GB Ethernet ports on it, will improve your transfer rates.
  • Replace the Ethernet cables: Maybe not the more efficient solution, but definitely the cheapest one. I’ve been using the same Ethernet cables for years, but new ones are better and better, and if you have a 20-year-old cable that you replace with a new one, it may be enough to improve the network speed (and solve most of the disconnections by the way).

Video

Support me: Join the community on Patreon to show your support, get behind-the-scenes content and other awesome perks!

Conclusion

Get My Cheat Sheet!
Grab your free PDF file with all the commands you need to know on Raspberry Pi!

That’s it! I think we have seen most of the solutions available.
I hope you found one that works for you, and that this post was helpful.

If you have any other ideas to do the same thing, feel free to leave a comment below.
And to conclude, here are a few related tutorials that might be useful next:

Raspberry Pi Resources

Not sure where to start?
Understand everything about the Raspberry Pi, stop searching for help all the time, and finally enjoy completing your projects.
Watch the Raspberry Pi Bootcamp course now.

Master your Raspberry Pi in 30 days
Don’t want the basic stuff only? 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.
Download the e-book.

VIP Community
If you just want to hang out with me and show your support, you can also join the Patreon community. I share behind-the-scenes content there and give you early access to my content. You’ll also get a shoutout when you join.
More details here.

Need help building something with Python?
Create, understand and improve any Python script for your Raspberry Pi.
Learn the essentials, step-by-step, without losing time understanding useless concepts.
Get the e-book now.

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


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

0 0 votes
Article Rating

Patrick Fromaget

I'm the lead author and owner of RaspberryTips.com. My goal is to help you with your Raspberry Pi problems using detailed guides and tutorials. In real life, I'm a Linux system administrator with a web developer experience.

Subscribe
Notify of
guest
10 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
nayods
1 year ago

excellent work, it works! which ever methods you want to use from the ones provided in this blog.

A. Sanchez
A. Sanchez
1 year ago

I went with “4 : Config.txt”. It worked like a charm.

I’m running a headless piHole installation and was looking to conserve RAM by disabling wireless radios and sound. I recovered 32MB of RAM after disabling WIFI, BT, and the bcm2835 sound chip. Here’s a snippet of by /boot/config.txt:

******************************************************************************************
# Additional overlays and parameters are documented /boot/overlays/README
dtoverlay=disable-wifi
dtoverlay=disable-bt

# Enable audio (loads snd_bcm2835)
dtparam=audio=off

******************************************************************************************

Version: Pi 4 model B, 4GB
PiHole 5.0

Scott
Scott
1 year ago

Hi, thanks for the guide! I tried the crontab in my Rpi4 and it didn’t work (subsequently tried the “sudo ifconfig wlan0 down” manually and it did work). After that I tried modifying the config.txt and that did work. I had a question though, when one disables the WiFi in the GUI what command is run? I ask because someday in the future I may stop using my Pi for a few years, then one day plug it back in with the GUI (I’m not using the GUI now) and scratch my head at why the WiFi isn’t working. So if I had to choose a method, I would choose whichever is the one that the GUI also uses, so that it could be undone by the GUI.

Burak
Burak
1 year ago

Thanks! Excellent compilation.

Sergey
Sergey
1 year ago

is 6 th method work without reloading? so you can turn off turn on during work?

Jody
Jody
1 year ago

Thank you for this. I went with the config.txt approach so that if I need to enable it again without an ethernet connection, I can pull the card and edit the file.

systemctl disable was not working over a reboot on my Pi 4 Raspbian Buster either.

Leilf Falkenstrom
Leilf Falkenstrom
1 year ago

Thanks for the guide.

Use my Pi as a light server and everything that is not necessary should be removed. In DietPi there is a way of removing/purging software for wifi and I miss that in you guide.

Recent Posts

Master your Raspberry Pi - 10% off