Fix “[Errno 13] Permission denied: '/dev/ttyUSB0'” on Linux
Your Linux user isn't allowed to open the serial port. Join the dialout (or uucp) group, log out and back in — and give Snap/Flatpak IDEs serial access.
Community draft — report a mistake
What you see
esptool.py v4.8.1
Serial port /dev/ttyUSB0
A fatal error occurred: Could not open /dev/ttyUSB0, the port is busy or doesn't exist.
([Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0')
Hint: Try to add user into dialout or uucp group.
Failed uploading: uploading error: exit status 2esptool.py v4.8.1 Serial port /dev/ttyUSB0 A fatal error occurred: Could not open /dev/ttyUSB0, the port is busy or doesn't exist. ([Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0') Hint: Try to add user into dialout or uucp group. Failed uploading: uploading error: exit status 2
On Linux, serial ports are files under /dev owned by a group your user is not in by default. esptool, avrdude and Thonny all fail the same way: they find the port but cannot open it.
Join the group, log out and back in, and the error is gone for good. With the Snap or Flatpak version of the IDE there is one more step, because those sandboxes block USB devices until you allow them.
Quick fix — try in order
- 1
Add yourself to the serial group
Ubuntu, Debian, Mint, Pop!_OS, Fedora:
sudo usermod -aG dialout $USER. Arch, Manjaro:sudo usermod -aG uucp $USER. Check which group owns the port withls -l /dev/ttyUSB0. - 2
Log out and back in (or reboot)
Group changes only apply to new login sessions. Run
groupsafterwards — dialout must be in the list. - 3
Snap Arduino IDE: connect the serial plug
The Snap package is sandboxed. Run
sudo snap connect arduino:raw-usb(andarduino:serial-portif listed bysnap connections arduino), or use the AppImage from arduino.cc instead. - 4
Flatpak IDE: same idea
Flatpak builds need device access:
flatpak override --user --device=all cc.arduino.IDE2, then restart the IDE. - 5
Don't fix it with sudo or chmod 666
Running the IDE as root creates root-owned files in your sketchbook, and chmod resets at every replug. The group method is permanent and safe.
Why it happens
Why does Linux block it?
Serial devices are owned by root and the dialout group (uucp on Arch). Normal users outside that group can't open them.
avrdude shows a different line
For an Uno it reads avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied. Same cause, same fix — genuine Unos appear as ttyACM0, CH340 clones as ttyUSB0.
No /dev/ttyUSB0 at all?
That's a different problem — on Ubuntu 22.04 and later the brltty package often grabs CH340 boards. See CH340 disconnected by brltty.
Board-specific notes
Raspberry Pi Pico: MicroPython and Arduino-Pico appear as /dev/ttyACM0. The same dialout fix applies.
Did this fix it?
Thanks — that helps us keep this page right.