Ok, I am sick of going to the Docker and Portainer website to get this setup so here it is for quick setup. Especially if you are using ProxMox and my cloud image example. Wow, it is very easy to get a Docker up this way and Portainer is awesome! Especially if you want to run docker compose and place in a stack. I will show that here for reference too.

Install Docker

So simple, just run this script from Docker.

Basic Install Docker via Script

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Fix current user using After Docker steps from Docker post-install.

Post Install Recommendation

sudo groupadd docker # this already exists in Debian after Install Docker.
sudo usermod -aG docker $USER
newgrp docker

Here is the expected output

groupadd: group 'docker' already exists

Install Portainer

Simple install of Portainer CE and it will run on the default ports https: on 9443 and http: on 8000

docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Here is the expected output

Unable to find image 'portainer/portainer-ce:latest' locally
latest: Pulling from portainer/portainer-ce
379538b6d68e: Pull complete
4ea3e2c3a39b: Pull complete
5171176db7f2: Pull complete
52e9438966a5: Pull complete
43d4775415ac: Pull complete
c1cad9f5200f: Pull complete
22eab514564f: Pull complete
962b9fa821a2: Pull complete
c153fefda5ce: Pull complete
bed990c4615b: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:908d04d20e86f07a50b0f1a029a111b89aa3089b7fc7fdf68ec1c71b025f36cd
Status: Downloaded newer image for portainer/portainer-ce:latest

Now, it should be possible to connect to https://<dockervm>:9443

2 thoughts on “Simple Docker With Portainer”
  1. Scripts are great but any reason you arent automating it with Ansible?
    *Ansible for weekly updating my template VMs.
    *Terraform for creating VMs from templates.
    *Ansible for provisoning VMs.

    1. Oh, very true getting there just have not built it yet. I think it will be a combination of Ansible and Terraform. Like both projects and that is part of the problem they both have ProxMox support.

      So, now it is a game of figuring out what to do where. Typical case of too many options. Like you said Ansible can do all of this so easily. I just hate setting up the resource files. That is my only excuse at this point.

      Terraform for creating VMs from templates.

      OMG I missed that response. You nailed it! That is what I plan to do.

      Yes exactly and ansible to again to build the templates. All of this running in GitLab. See that is my only excuse just too much! I have been so busy just building infrastructure I go lost in that process.
      Now I am on ProxMox 8 and SDN is so cool just figuring it all out has taken a few weeks.
      Anyway, correct it is better to automate this process! I promise I will document it. TechoTim has some great Ansible blogs.

      Any suggestions?

Leave a Reply

Your email address will not be published. Required fields are marked *