Error when trying to install Portainer
I am following your step by step installation guide to install docker and portainer. https://www.linode.com/community/questions/24443/how-do-i-install-and-use-portainer-on-a-linode#answer-84243
your command posted do always end up in an error:
docker run --network=$NETWORK -d -p 8000:8000 -p 9443:9443 -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v $VOLUME:/data portainer/portainer-ce:latest
docker: invalid spec: :/data: empty section between colons.
what I am doing wrong?
2 Replies
✓ Best Answer
I tried to recreate this and when I ran the command exactly as written without putting in my actual Volume name or Network name, I got the same thing as you:
docker run --network=$NETWORK -d -p 8000:8000 -p 9443:9443 -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v $VOLUME:/data portainer/portainer-ce:latest
docker: invalid spec: :/data: empty section between colons.
When I used the names I made in the previous steps for both the network and the volume, it worked:
docker volume create datavolume
docker network create portainernetwork
docker run --network=portainernetwork -d -p 8000:8000 -p 9443:9443 -p 9000:9000 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v datavolume:/data portainer/portainer-ce:latest
If you used the command as is because you tried to set environmental variables for those values, I'd recommend trying to directly input them to see if that helps. If that still doesn't work, I would check to make sure that you did those previous steps and have created a volume and network name to use and then make sure you spell them correctly when inserting them into the docker run command and ensure that there are no extra spaces or other syntax errors.