Fix “Could not open COM5, the port is busy or doesn’t exist”
Another program has the serial port open, or (on Linux) your user lacks permission. Close the other app or add yourself to the dialout group.
Community draft — report a mistake
What you see
esptool v5.1.0
Serial port COM5:
A fatal error occurred: Could not open COM5, the port is busy or doesn't exist.
(could not open port 'COM5': PermissionError(13, 'Access is denied.', None, 5))
Hint: Check if the port is not used by another task
Failed uploading: uploading error: exit status 2esptool v5.1.0 Serial port COM5: A fatal error occurred: Could not open COM5, the port is busy or doesn't exist. (could not open port 'COM5': PermissionError(13, 'Access is denied.', None, 5)) Hint: Check if the port is not used by another task Failed uploading: uploading error: exit status 2
This error happens before the board is even contacted: your computer refused to open the serial port. Either some other program is already using it, or your user account is not allowed to.
It is never a problem with the sketch or the board, so the fix is always on the computer side.
Quick fix — try in order
- 1
Close Serial Monitor and other serial apps
A second Arduino IDE window, Thonny, PuTTY, Cura or a web page using Web Serial can all hold the port.
- 2
Unplug and replug the board
A crashed program may keep the port locked. Reconnecting gives Windows a fresh port.
- 3
Linux: join the dialout group
Run sudo usermod -aG dialout $USER, then log out and back in. On Arch-based systems the group is uucp.
- 4
Check the port still exists
If the board reset into a different mode (native USB boards), the COM number may have changed. Re-select it in Tools → Port.
Why it happens
Why does only one program get the port?
Serial ports are exclusive: once an app opens COM5, every other open attempt is refused with “Access is denied”.
Our browser serial monitor
If you have the FlashReady serial monitor or flasher open in Chrome, click Disconnect first.
Permission denied on /dev/ttyUSB0
On Linux the device belongs to the dialout group. Without membership you can see the port but not open it.
Board-specific notes
ESP32-S3 / C3 native USB: Resetting the chip makes the USB port vanish and reappear. A port that “doesn’t exist” for a second is normal; esptool retries if you hold BOOT.
Did this fix it?
Thanks — that helps us keep this page right.