How to run Arduino IDE without changing permission (Ubuntu 19.04)

Recently, I installed Ubuntu 19.04 because I have some issue with Windows 10. I ran Arduino IDE without any issue, especially uploading my sketch to Arduino. When I start using Arduino IDE on Ubuntu, I have a problem uploading my sketch. It keeps me getting an error message.

avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied.

I found this solution to open Terminal and enter some commands below.

sudo usermod -a -G tty haniffurqonh
sudo usermod -a -G dialout haniffurqonh
sudo chmod a+rw /dev/ttyACM0
sudo chmod a+rw /dev/ttyACM1

The solution works well, but I have to enter the command each time I turn on my laptop.

The usermod changes should be permanent. Maybe dialout is not the correct group? You don't need the chmod stuff if you are in the correct group.

In a terminal, with the board plugged in, enter and run:
ls -l /dev/ttyACM*
Note: -l is lowercase L, not a 1.

This will show the group that has access to the port.

Example: crw-rw-r-- 1 root dialout ... /dev/ttyACM0, root is owner, dialout is the group with access.

Running the command, groups or id, in a terminal will show the groups you belong to.

sudo adduser YourUserName GroupToJoin Will fix things if you need to join a group, logout and login after you run adduser.