PortGate

Blueprints · Docker & Databases

Production 15 min · Docker

Vaultwarden on localhost

Publishes Vaultwarden on 127.0.0.1 and leaves public signups off.

Why this should not be public

This is a password vault. It belongs behind a reverse proxy with TLS, with signups off and the /admin page disabled or protected by a strong token, never as a directly published container port.

Live config

Baked-in protections

Step 1 · yaml

Compose file

/opt/vaultwarden-loopback/compose.yaml

Written under the compose directory. It is not started. The image tag is the release this blueprint was checked with: look at the project's release notes and use the newest patched tag.

services:
  app:
    image: vaultwarden/server:1.32.0
    ports:
      - "127.0.0.1:8080:80"
    environment:
      SIGNUPS_ALLOWED: "false"
    security_opt:
      - no-new-privileges:true
    restart: unless-stopped

Step 2 · bash

Start script

/opt/vaultwarden-loopback/up.sh

Review the image tag and the password, then run this yourself.

#!/bin/sh
set -eu
cd "/opt/vaultwarden-loopback"
if grep -q 'change-me' compose.yaml; then
  echo "Replace change-me before starting."
  exit 1
fi
docker compose up -d

Step 3 · bash

Read-only check

/root/portgate-blueprints/vaultwarden-loopback-check.sh

Prints status. It does not change the service.

#!/bin/sh
set -eu
if command -v docker >/dev/null 2>&1; then
  docker ps --format '{{.Names}} {{.Ports}}' || echo "Docker is installed but the daemon did not answer."
else
  echo "Docker is not installed. The compose file is staged only."
fi