I assume you didn’t install the docker engine yourself, did you?
Otherwise, you should have stumbled across the post installation steps mentioned in the installation instructions: Linux post-installation steps for Docker Engine | Docker Docs.
Docker runs the daemon as root, unless you specifically use rootless docker.