Be Your Own Cloud code · PART 2 — FOUNDATION
Chapter 6 Docker and Compose from Zero
Going further than the chapter: Docker and Compose, Properly Installed
Installing Docker
# p. 29
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
# Log out and back in for the group change to apply, then verify:
docker run hello-world The Folder Convention This Whole Book Uses
# p. 30
/opt/stacks/
vaultwarden/
docker-compose.yml
.env
data/
nextcloud/
docker-compose.yml
.env
pihole/
docker-compose.yml
.env # p. 30
sudo mkdir -p /opt/stacks
sudo chown $USER:$USER /opt/stacks The Commands You'll Actually Use
# p. 30
# start in the background
docker compose up -d
# follow the logs — your first stop when something's wrong
docker compose logs -f
# fetch newer versions of your pinned images
docker compose pull
# stop and remove containers (data in volumes survives this)
docker compose down
# what's actually running right now
docker compose ps Reproduced exactly from Be Your Own Cloud, Chapter 6. The book explains what each line does and what to do when it doesn't work. About the book
Something here not working as the book describes? Tell the author.