Older Raspberry Pi camera modules have a small red LED that lights up while the camera is active. On a surveillance or wildlife camera this is often unwanted: the LED gives the camera away, shows up as a reflection when filming through a window, or is a nuisance at night. You can turn it off in the Pi’s configuration file.
Turning off the LED in config.txt
Since Raspberry Pi OS “Bookworm” the file is located at /boot/firmware/config.txt; on older releases it is /boot/config.txt:
sudo nano /boot/firmware/config.txt
Add the following line to the [all] section – usually at the very bottom of the file, and in any case not inside a section such as [pi4] or [cm4], otherwise it only applies to that model:
[all]
disable_camera_led=1
Save (Ctrl+O, Enter, Ctrl+X) and reboot the Pi:
sudo reboot
If the LED stays on
- Right file? On Bookworm only
/boot/firmware/config.txtis read. A change in/boot/config.txthas no effect there. - Right section? Use
grep -n -B5 disable_camera_led /boot/firmware/config.txtto check which heading in square brackets the line sits under. - Which module? Whether and how the LED can be controlled by software depends on the camera module and the camera stack in use. Newer modules such as the Camera Module 3 have no such LED at all. If it cannot be switched off on your module, a piece of black electrical tape is the pragmatic fix.
If you run the camera as a network camera, the matching guide is the article MediaMTX: streaming a Raspberry Pi camera via RTSP and WebRTC.
Originally published in 2023, revised in November 2026.