Home LXC: Installing Docker on a Debian CT
Post
Cancel

LXC: Installing Docker on a Debian CT

A quick guide to getting docker running on a Debian CT

CT Configuration

First make sure your container is running in privledged mode and nested is enabled in Options > Features

features

Installing Docker

Then you’ll need to login and install docker.

1
sudo apt install docker.io -y && sudo systemctl enable docker

Then start and confirm the service

1
sudo systemctl start docker && sudo systemctl status docker

To ensure Docker is running correctly you can try to run a simple hello-world container

1
sudo docker run hello-world

Install Docker Compose

Debian unfortunately only ships with docker compose v1. The plugin for v2 needs to be installed manually from github releases. Keep in mind the version number can be whatever is the latest (v2.14.2 as of this post).

1
mkdir -p ~/.docker/cli-plugins
1
curl -sSL https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
1
chmod +x ~/.docker/cli-plugins/docker-compose

Now check to make sure v2 is installed

1
2
docker compose version
# Docker Compose version 2.14.2

Run Docker from a non-root user without sudo

1
sudo usermod -aG docker $USER

You’ll need to logout and log back in for the change to take effect

This post is licensed under CC BY 4.0 by the author.