Skip to content
Ubuntu Linux

Enable or Disable Camera in Ubuntu Linux

Richard
Written by
Richard
Updated 4 min read
How to Install Google Chrome on Ubuntu Linux
How to Install Google Chrome on Ubuntu Linux
Before you start
  • 3 steps
  • Includes a restart or sign-out

Disabling the camera in Ubuntu Linux blocks all apps from using your webcam, which protects your privacy. You can turn the device back on at any time for video calls. The method below unloads the camera driver, so it works for every app and every user on the computer, not just one program.

Ubuntu sets up most webcams, such as the Logitech C920, the moment you plug them in. To check that your camera works, open the built-in Cheese app. Cheese is a webcam program that takes pictures and records videos. If you see your own image in the Cheese window, Ubuntu already recognises the camera. Close Cheese when you finish, because an app that is still using the camera will block the steps later in this guide.

⚡ Quick Answer

To disable the camera in Ubuntu Linux, open a terminal with Ctrl+Alt+T and run sudo modprobe -r uvcvideo. This unloads the uvcvideo driver that controls most webcams, so no app can use the camera until you load it again. Close Cheese and any video call apps first, or the command fails. Run sudo modprobe uvcvideo to turn the camera back on.

Advertisement

How to enable or disable the camera in Ubuntu Linux

📝Good to KnowYou need administrator access to disable and enable cameras.

The change applies to all users on the device, so use an account that can run commands with sudo. Every command in this guide runs in a terminal. To open one, press Ctrl+Alt+T, or search for Terminal in the Activities overview. The process has three parts: check the driver, disable the camera, and enable it again.

Find the Camera driver module

The uvcvideo driver manages most webcams in Ubuntu Linux, so it controls your Ubuntu camera settings. Check that this driver is active before you try to turn off your webcam. Most webcams use this standard driver, so if it is loaded, your system recognises the hardware and the steps in this guide will work.

Advertisement

Most modern webcams use UVC (USB Video Class) drivers, which follow a universal standard for video hardware. The generic uvcvideo kernel driver module in Ubuntu supports these devices. This also covers most built-in laptop webcams, which are usually wired to the computer as internal USB devices.

To check, run the command below in the terminal. It lists the uvcvideo kernel driver module if it is loaded:

🐧Bash / Shell
sudo lsmod | grep 'uvcvideo'

Blank output means Ubuntu does not recognise the camera or does not have a driver installed for it. Try unplugging and reconnecting a USB webcam, then run the command again. If the camera is recognised and its driver is loaded, you see lines similar to these:

💻Code
uvcvideo              106496  0
videobuf2_vmalloc      20480  1 uvcvideo
videobuf2_v4l2         32768  1 uvcvideo
videobuf2_common       77824  4 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,videobuf2_memops
videodev              258048  3 videobuf2_v4l2,uvcvideo,videobuf2_common
mc                     65536  4 videodev,videobuf2_v4l2,uvcvideo,videobuf2_common

Different results often mean your camera uses another driver. Note the name of that driver, because you will need it in the next section. Kernel documentation and LinuxTV wiki have more information on camera drivers.

Remove camera drivers from Ubuntu

You disable the camera in Ubuntu by removing its driver from the terminal. Unloading the driver from the Linux kernel turns the webcam off completely. No app can use the camera until you load the driver again. This is useful for privacy, and also for clearing a frozen video feed.

🐧Bash / Shell
sudo modprobe -r uvcvideo

If your system showed a driver other than uvcvideo in the previous section, replace uvcvideo with that driver name in the commands.

If an app is still using the camera, the command fails with an error message resembling this:

The error says the module is in use. Follow these steps to clear it:

  1. Close every application that might be using the camera. Check video call apps, Cheese and browser tabs that have camera access.
  2. Run the command to disable the camera device again.
  3. Confirm the command finishes without an error message. No output means the driver was removed.

Once the driver is removed, no software can reach the camera until it is re-enabled. The change takes effect immediately, with no restart needed.

📝Good to KnowThese commands remove the driver only for the current session. A reboot loads it again and restores the camera. To keep the driver blocked across reboots, add it to a configuration file. Run the commands below to add the driver to /etc/modprobe.d/blacklist.conf. Writing to that file needs sudo.

Drivers listed in this file stay blocked, so the system does not load them at boot and apps cannot access the camera. Because this is a system-wide setting, it affects every user on the computer.

⬛Command Prompt
echo 'blacklist uvcvideo' | sudo tee -a /etc/modprobe.d/blacklist.conf
Terminal command to disable the camera driver in Ubuntu Linux
ubuntu disable camera

Enable camera in Ubuntu Linux

To bring a disabled camera back, load its driver again. Reloading the camera driver into the system memory turns your webcam back on in Ubuntu Linux. Once the command runs, apps such as video call software can use the camera right away, and you do not need to restart the computer.

If you also blocked the driver in /etc/modprobe.d/blacklist.conf, remove that blocklist entry first. Otherwise the driver is blocked again at the next boot, and the camera stops working after a restart. After you load the driver, open Cheese to confirm the camera works.

🐧Bash / Shell
sudo modprobe uvcvideo

Configuration is complete.

Conclusion:

  • Enabling or disabling the camera in Ubuntu Linux requires administrator access
  • The uvcvideo kernel driver module is commonly used for recent camera and webcam drivers in Ubuntu
  • Removing a camera driver using the modprobe command may require exiting the app using the camera
  • Re-enabling the camera driver involves removing the blocklist entry and using the modprobe command
  • Once disabled, apps will not have access to the camera

Have a question about this guide?

Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.

Did this guide fix your problem?

Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *