[Unit] Description=Vaultwarden Password Manager Container After=network-online.target postgresql.service Wants=network-online.target [Container] ContainerName=vaultwarden Image={{ vaultwarden_image }}:{{ vaultwarden_version }} EnvironmentFile={{ vaultwarden_home }}/.env # Volume mounts # Application data (includes database, attachments, sends, icons, etc.) Volume={{ vaultwarden_data_dir }}:/data:Z # Infrastructure socket (PostgreSQL access with 777 permissions on host) Volume={{ postgresql_unix_socket_directories }}:{{ postgresql_unix_socket_directories }}:Z # Expose HTTP port to localhost only (Caddy will reverse proxy) PublishPort=127.0.0.1:{{ vaultwarden_http_port }}:80 [Service] Restart=always TimeoutStartSec=300 [Install] WantedBy=multi-user.target