Docker Portainer - Not starting - Ubuntu 18.04

I’m trying to start a container for Portainer but it’s not starting and in the log it shows the message:

2020/06/16 16:31:12 Warning: the --template-file flag is deprecated and will likely be removed in a future version of Portainer.
2020/06/16 16:31:14 Unable to retrieve template definitions via filesystem
2020/06/16 16:31:14 open /templates.json: permission denied

I did the following steps:

docker pull portainer/portainer
docker volume create portainer_data
docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data --name portainer_container portainer/portainer

Does anybody know how to fix this error?

This exact issue has been reported before, seems the fix is to not use the docker snap and instead follow the install instructions on the docker website