Axel Verne → Junk Drawer kit → Chapter 8

Chapter 8 — Break Up With Big Tech II: Password Manager → Vaultwarden

6 blocks to copy, in the order they appear in the chapter. Nothing here is required to be typed by hand.

This page has the commands. The book has the rest. Chapter 8 in the book adds the drawer check (will your hardware do it?), checkpoints, "Make it good", "When it breaks" and an honest upgrade check.

Read two full chapters free (PDF): Chapter 1 and the Pi-hole chapter, straight from the book.

Get the next build by email. What I ran, on what hardware, and commands that paste. Free, unsubscribe any time.

The build

8.1 · bash
mkdir -p /srv/lab/compose/vaultwarden && cd /srv/lab/compose/vaultwarden
8.2 · yaml
services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    environment:
      DOMAIN: "https://vault.local"              # change to your hostname
      SIGNUPS_ALLOWED: "true"                    # turn off after you create your account (Checkpoint 3)
      INVITATIONS_ALLOWED: "false"
      ADMIN_TOKEN: "${ADMIN_TOKEN}"              # see below
    volumes:
      - /srv/lab/data/vaultwarden:/data
    ports:
      - "8000:80"                                # plain HTTP from Caddy
    networks:
      - vw-net

  caddy:
    image: caddy:2-alpine
    container_name: caddy-vw
    restart: unless-stopped
    ports:
      - "443:443"
      - "443:443/udp"                            # HTTP/3
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy-data:/data
      - caddy-config:/config
    networks:
      - vw-net
    environment:
      DOMAIN: "vault.local"                      # must match above

networks:
  vw-net:
    driver: bridge

volumes:
  caddy-data:
  caddy-config:
8.3 · bash
docker run --rm -it vaultwarden/server:latest /vaultwarden hash --preset bitwarden
8.4 · bash
ADMIN_TOKEN='$argon2id$v=19$m=...(the whole hash)'
8.5 · text
vault.local {
  tls internal                                   # local CA, self-signed certs
  reverse_proxy vaultwarden:80
}
8.6 · bash
docker compose up -d
docker compose logs -f caddy    # wait for "listening on..." then Ctrl-C

← Chapter 7Chapter 9 →

Get the next build in your inbox

An email when a new build write-up goes up: what I ran, on what hardware, and the commands that paste. Free, unsubscribe any time. The kit stays free either way.