There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Vaultwarden using Docker Compose with existing Certificates

Hello Friends,

I have a small ubuntu Server and I finally also want to transfer my Vaultwarden Instance to it. On this Server I have several services running (homeassistant, …) and Certbot via Dehydrated (right now I get a certificate for my duckdns address). In some directory I have the privkey and fullchain files.

Now my Problem is that when I start vaultwarden it wont load as https.

I believe, my Problem is telling Vaultwarden, where my certificate files are located so it can use them accordingly.

This is my Compose File right now:


<span style="color:#323232;">  vaultwarden:
</span><span style="color:#323232;">    container_name: vaultwarden
</span><span style="color:#323232;">    image: vaultwarden/server:latest
</span><span style="color:#323232;">    restart: unless-stopped
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - /home/vaultwarden:/data/
</span><span style="color:#323232;">      - /home/(directory to my certificates):/usr/share/ca-certificates/
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">      - 8129:80
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - DOMAIN=https://hurrdurr.duckdns.org
</span><span style="color:#323232;">      - LOGIN_RATELIMIT_MAX_BURST=10
</span><span style="color:#323232;">      - LOGIN_RATELIMIT_SECONDS=60
</span><span style="color:#323232;">      - ADMIN_RATELIMIT_MAX_BURST=10
</span><span style="color:#323232;">      - ADMIN_RATELIMIT_SECONDS=60
</span><span style="color:#323232;">      - ADMIN_TOKEN=token
</span><span style="color:#323232;">      - SENDS_ALLOWED=true
</span><span style="color:#323232;">      - EMERGENCY_ACCESS_ALLOWED=true
</span><span style="color:#323232;">      - WEB_VAULT_ENABLED=true
</span><span style="color:#323232;">      - SIGNUPS_ALLOWED=true
</span>

The Volume Mapping to the certificates was just me trying it out so maybe its working if I map it like that.

If I open the 8129 in my Browser it will just time out. I also managed it to start but it wouldnt let me register as theres not https certificate.

Decronym Bot , (edited )

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
HTTP Hypertext Transfer Protocol, the Web
IP Internet Protocol
SSL Secure Sockets Layer, for transparent encryption
nginx Popular HTTP server

5 acronyms in this thread; the most compressed thread commented on today has 13 acronyms.

[Thread for this sub, first seen 11th Sep 2023, 03:25] [FAQ] [Full list] [Contact] [Source code]

giddy ,
@giddy@aussie.zone avatar

I use Nginx Proxy Manager to reverse proxy all my services including Vaultwarden -

Setup in NPM -


<span style="color:#323232;">Open Nginx Proxy Manager Admin Portal
</span><span style="color:#323232;">Click Proxy Hosts
</span><span style="color:#323232;">Click Add Proxy Host
</span><span style="color:#323232;">Fill in the details
</span><span style="color:#323232;">    Details tab
</span><span style="color:#323232;">        Domain Names - vault.your.domain
</span><span style="color:#323232;">        Scheme - http
</span><span style="color:#323232;">        Forward Hostname/IP - vaultwarden (this should be the name of your vw container)
</span><span style="color:#323232;">        Forward Port - 80
</span><span style="color:#323232;">        Tick Block Common Exploits
</span><span style="color:#323232;">        Tick Websockets Support
</span><span style="color:#323232;">        Access List - Publicly Accessible
</span><span style="color:#323232;">    Custom locations tab
</span><span style="color:#323232;">        Add the following locations
</span><span style="color:#323232;">            location 1
</span><span style="color:#323232;">                location - /notifications/hub
</span><span style="color:#323232;">                Scheme - http
</span><span style="color:#323232;">                Forward Hostname/IP - vaultwarden
</span><span style="color:#323232;">                Forward Port - 3012
</span><span style="color:#323232;">                Click the cog symbol and add the following to the textbox that appears
</span><span style="color:#323232;">                    proxy_set_header Upgrade $http_upgrade;
</span><span style="color:#323232;">                    proxy_set_header Connection "upgrade";
</span><span style="color:#323232;">                    proxy_set_header X-Real-IP $remote_addr;
</span><span style="color:#323232;">            location 2
</span><span style="color:#323232;">                location - /notifications/hub/negotiate
</span><span style="color:#323232;">                Scheme - http
</span><span style="color:#323232;">                Forward Hostname/IP - vaultwarden
</span><span style="color:#323232;">                Forward Port - 80
</span><span style="color:#323232;">                Click the cog symbol and add the following to the textbox that appears
</span><span style="color:#323232;">                    proxy_set_header Host $host;
</span><span style="color:#323232;">                    proxy_set_header X-Real-IP $remote_addr;
</span><span style="color:#323232;">                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
</span><span style="color:#323232;">                    proxy_set_header X-Forwarded-Proto $scheme;
</span><span style="color:#323232;">            location 3
</span><span style="color:#323232;">                location - /
</span><span style="color:#323232;">                Scheme - http
</span><span style="color:#323232;">                Forward Hostname/IP - vaultwarden
</span><span style="color:#323232;">                Forward Port - 80
</span><span style="color:#323232;">                Click the cog symbol and add the following to the textbox that appears
</span><span style="color:#323232;">                    proxy_set_header Host $host;
</span><span style="color:#323232;">                    proxy_set_header X-Real-IP $remote_addr;
</span><span style="color:#323232;">                    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
</span><span style="color:#323232;">                    proxy_set_header X-Forwarded-Proto $scheme;
</span><span style="color:#323232;">    SSL tab
</span><span style="color:#323232;">        SSL Certificate - Request a new SSL Certificate
</span><span style="color:#323232;">        tick Use a DNS Challenge (or just expose port 80 if you accept the risk)
</span><span style="color:#323232;">        DNS Provider - Dynu (this is my dyndns provider)
</span><span style="color:#323232;">        Credentials File Content - replace YOUR_DYNU_AUTH_TOKEN with the API key from https://www.dynu.com/en-US/ControlPanel/APICredentials
</span><span style="color:#323232;">        Email Address for Let's Encrypt - your email
</span><span style="color:#323232;">        Tick I Agree to the Let's Encrypt Terms of Service
</span><span style="color:#323232;">Click Save
</span><span style="color:#323232;">Vaultwarden should now be accessible via https://vault.your.domain
</span>
Lobotomie OP ,

Can I send you a pm regarding my progress so far? I’m kind off stuck at configuring everything:/

dandroid ,

Seconding a reverse proxy. Once you have it set up, it’s trivial to add a subdomain, forward it to your internal port that your container is exposing, then use certbot or whatever to get a new certificate for that subdomain.

I just use apache because I heavily use it for work, so I already know it well. But lots of people swear by nginx as well. There are lots of other options as well.

lemmyvore ,

No need to get a certificate for ever subdomain, you can get a wildcard cert for *.your. domain.

dandroid ,

True. I did that for one of my domains, but it was really quite annoying to do with certbot, as you needed some sort of plugin.

Kangie ,

It’s fine with Let’sEncrypt via the DNS01 challenge; my lab typically only uses one wildcard certificate for all the services there unless I have a specific need to generate an indovidual cert for a service.

klangcola ,

Thirding a reverse proxy. Probably Nginx Proxy Manager (NPM) is the easiest reverse proxy to get started with, if you don’t want to deal with plain nginx config files

Kangie ,

Here’s the secret to stuff like this:

Run a single reverse proxy / edge router for all of your containerised services.

I recommend Traefik - gitlab.com/…/traefik-grafana-prometheus-docker

You can configure services with labels attached to the container and (almost) never expose ports directly. It also lets you host an arbitrary number of services listening on 80/443.

An example config might look like this:


<span style="color:#323232;"># docker-compose.yml
</span><span style="color:#323232;">version: '3.9'
</span><span style="color:#323232;">
</span><span style="color:#323232;">services:
</span><span style="color:#323232;">  bitwarden:
</span><span style="color:#323232;">    image: vaultwarden/server:latest
</span><span style="color:#323232;">    restart: always
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - /data/vaultwarden/:/data
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">#      - ADMIN_TOKEN=
</span><span style="color:#323232;">      - WEBSOCKET_ENABLED=true
</span><span style="color:#323232;">    networks:
</span><span style="color:#323232;">      - proxy
</span><span style="color:#323232;">    labels:
</span><span style="color:#323232;">      - traefik.enable=true
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-ui-https.tls.certresolver=letsencrypt
</span><span style="color:#323232;">      - traefik.http.middlewares.redirect-https.redirectScheme.scheme=https
</span><span style="color:#323232;">      - traefik.http.middlewares.redirect-https.redirectScheme.permanent=true
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-ui-https.rule=Host(`my.domain.com`)
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-ui-https.entrypoints=websecure
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-ui-https.tls=true
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-ui-https.service=bitwarden-ui
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-ui-http.rule=Host(`my.domain.com`)
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-ui-http.entrypoints=web
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-ui-http.middlewares=redirect-https
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-ui-http.service=bitwarden-ui
</span><span style="color:#323232;">      - traefik.http.services.bitwarden-ui.loadbalancer.server.port=80
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-websocket-https.rule=Host(`my.domain.com) &amp;&amp; Path(`/notifications/hub`)
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-websocket-https.entrypoints=websecure
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-websocket-https.tls=true
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-websocket-https.service=bitwarden-websocket
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-websocket-http.rule=Host(`my.domain.com`) &amp;&amp; Path(`/notifications/hub`)
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-websocket-http.entrypoints=web
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-websocket-http.middlewares=redirect-https
</span><span style="color:#323232;">      - traefik.http.routers.bitwarden-websocket-http.service=bitwarden-websocket
</span><span style="color:#323232;">      - traefik.http.services.bitwarden-websocket.loadbalancer.server.port=3012
</span>
emhl ,

Using traefik as your first reverse proxy might be a bit daunting. Caddy or “nginx reverse proxy” are much easier to configure.

7Sea_Sailor ,

If you want it beginner friendly, I can recommend nginx proxy Manager, which is basically a web ui frontend for nginx. This has its own drawbacks, but makes setup very uncomplicated.

koinu ,

I agree, very beginner friendly. But also, it’s what most people are gonna need.

I actually started with Traefik because I didn’t know any better, and I kinda wanna go back to be honest because with Traefik I was able to configure a Minecraft server, without having to expose the port. But not with NGINX Proxy Manager.l, since it only does http and shit. But I REALLY like being able to do everything via a webUI since I only have a phone to manage my server .

So, I find myself stuck between functionality and ease of use. :(

Kangie ,

At the end of the day Traefik isn’t that hard, especially if you know the core concepts; if you know both and have a need for Traefik I’d just use that everywhere.

lemmyvore ,

Nginx Proxy Manager can do stream hosts, which are encrypted tunnels where you can put any kind of traffic not just HTTP.

koinu ,

I’ve tried, but I wasn’t able to get it working. I’ll look into it again though, cuz I’d love to do it all through NPM.

7Sea_Sailor ,

You should look into NPM Streams, they’re built exactly for this purpose. It’s included by default, just another type of host.

koinu ,

I’ve tried, but I wasn’t able to get it working. I’ll look into it again though, cuz I’d love to do it all through NPM.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines