To create the docker group and add your user:
Log into Ubuntu as a user with sudo privileges.
This procedure assumes you log in as the ubuntu user.
Create the docker group and add your user.
$ sudo usermod -aG docker ubuntu
Log out and log back in.
This ensures your user is running with the correct permissions.
Verify your work by running docker without sudo.
$ docker run hello-world