Skip to content

Instantly share code, notes, and snippets.

@LizenzFass78851
Last active February 8, 2026 16:08
Show Gist options
  • Select an option

  • Save LizenzFass78851/c15c6f8d6fb8232fefb6c1a44b607eaf to your computer and use it in GitHub Desktop.

Select an option

Save LizenzFass78851/c15c6f8d6fb8232fefb6c1a44b607eaf to your computer and use it in GitHub Desktop.
vaultwarden docker compose file with matching https to http forwarder for use in the internet network without https port forwarding to the outside.
{
# email [email protected]
# acme_ca http://openbao.testdom.internal:8200/v1/pki/acme/directory
}
vaultwarden.testdom.internal {
reverse_proxy bitwarden:80
tls /etc/caddy/certs/caddy.crt /etc/caddy/certs/caddy.key
# tls {
# ca_root /etc/caddy/certs/rootCA.pem
# }
}
version: "3.2"
services:
bitwarden:
image: vaultwarden/server:latest
restart: always
ports:
- "80:80"
environment:
- ADMIN_TOKEN=YOURPASSWORD
- WEBSOCKET_ENABLED=true
- SIGNUPS_ALLOWED=false
- INVITATIONS_ALLOWED=false
- LOG_FILE=/data/vaultwarden.log
- LOG_LEVEL=warn
- EXTENDED_LOGGING=true
# - SMTP_HOST="<smtp.domain.tld>"
# - SMTP_FROM="<[email protected]>"
# - SMTP_PORT="587"
# - SMTP_SECURITY="starttls"
# - SMTP_USERNAME="<username>"
# - SMTP_PASSWORD="<password>"
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
volumes:
- ./data:/data
caddy:
image: caddy:latest
restart: always
ports:
# - "80:80"
- "443:443"
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile:ro
- ./caddy/data:/data
- ./caddy/config:/config
# custom root ca for custom acme server like openbao
# - ./caddy/rootCA.crt:/etc/caddy/certs/rootCA.pem:ro
# custom self generated ca for this webserver
# caddy certs: key = "caddy.key"; cert = "caddy.crt"
- ./caddy/certs:/etc/caddy/certs:ro
depends_on:
- bitwarden

Vaultwarden Docker Compose

instructions for creating and renewing self-created certificates

  • create
mkdir -p ./caddy/certs && cd ./caddy/certs && \ 
  openssl req -x509 -newkey rsa:4096 -keyout caddy.key -out caddy.crt -days 365 -nodes -subj "/CN=vaultwarden.testdom.internal"
  • nenew
cd ./caddy/certs && \ 
  openssl req -new -key caddy.key -out caddy.csr -subj "/CN=vaultwarden.testdom.internal" && \ 
  openssl x509 -req -in caddy.csr -signkey caddy.key -out caddy.crt -days 365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment