Docker's pretty cool. Containers are a simple way to, well containerise applications. They're essentially a virtual machine with less overhead.
+This guide assumes you have a debian install, either physical or a VM (I recommend a VM).
+ +Installing Docker
+The following is the script I use for my docker installations. Copy/Paste or throw into a file and execute it.
+ +sudo apt-get install ca-certificates curl gnupg
+
+sudo install -m 0755 -d /etc/apt/keyrings
+ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
+
+sudo chmod a+r /etc/apt/keyrings/docker.gpg
+
+echo \
+ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
+ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
+ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+
+sudo apt-get update
+
+sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
+
+ This will download add the required keyring, download the correct docker version for your PCs arhitecture, and the sources, and download the required packages.
+With this docker is now installed and ready to go!
+ +Installing your first container, Portainer
+Portainer is a web-GUI for managing docker containers, so I figure it's a good place to start.
+ +Docker Run
+Not recommended. Use compose.
+docker run -d \
+-p 9443:9443 \
+--name portainer \
+--restart unless-stopped \
+-v data:/data \
+-v /var/run/docker.sock:/var/run/docker.sock \
+portainer/portainer-ce:latest
+
+ Docker Compose
+My preferred way of setting up, and running containers. It makes it more managable, and easier to follow. + There are a few more 'steps' here, but that's more-so for managing the containers than a requirement.
+ +First off we'll create a 'docker' directory, with a 'portainer' directory within it in our home directory.
+mkdir -p ~/docker/portainer && cd ~/docker/portainer && touch docker-compose.yml
+
+ Next from within the portainer directory, open up/create docker-compose.yml.
+ Use your preferred text editor here, I like vim, so I'll be using it in the snippet.
Paste the following into the file, and save it.
+services:
+ portainer:
+ image: portainer/portainer-ce:latest
+ container_name: portainer
+ restart: unless-stopped
+ security_opt:
+ - no-new-privileges:true
+ volumes:
+ - /etc/localtime:/etc/localtime:ro
+ - /var/run/docker.sock:/var/run/docker.sock:ro
+ - ./data:/data
+ ports:
+ - 9443:9443
+
+ Next we'll run docker compose, which will do as the run command did, pulling the container (if not already done so), and running it.
+ +sudo docker compose up -d
+
+ Accessing Portainer
+Once this has been run successfully you should be able to access portainer using the IP of the docker host, or localhost (if running docker on the same PC).
+ + + +