# 1 GB VPS Privacy Stack: Caddy 2, Vaultwarden, Memos, and Actual Budget

> Source: <https://dev.to/gongkang/1-gb-vps-privacy-stack-caddy-2-vaultwarden-memos-and-actual-budget-131n>
> Published: 2026-11-20 03:35:39+00:00

**Recommendation:** Keep a single ingress proxy and named volumes for self-hosted services, and set Docker log-opts since the json-file driver grows unbounded on a 1 GB VPS.
More in the playbook "Running AI in production": <https://wpnews.pro/playbooks/production-ops>

This tutorial was written with AI assistance from the project's official documentation. Verification status is stated at the end of the article.

Three services, one proxy, one file. Caddy 2 terminates HTTP (and later HTTPS) and routes by `Host` header to three internal containers. Vaultwarden handles passwords, Memos handles notes, Actual Budget handles envelope budgeting. None of them publish ports on the host. Only Caddy binds `127.0.0.1:${CADDY_HTTP_PORT:-18080}:80` in the sandbox profile, which keeps the attack surface to a single ingress.

The Caddyfile lives inside `compose.yml` as a top-level `configs:` entry with `content: |`. No `./Caddyfile` bind mount, no `/var/run/docker.sock`, no host paths. Persistent state lives in named volumes: `vaultwarden_data`, `memos_data`, `actual_data`, `caddy_data`, `caddy_config`. That means you can copy `compose.yml` and `.env` to any VPS and `docker compose up -d` without shipping a directory tree.

Why these three fit on 1 GB: Vaultwarden is a Rust binary that idles around 7 MB. Memos is a Go binary idling around 18 MB. Actual Budget is a Node process idling around 148 MB. Caddy adds a few MB. The real constraint is not RAM but disk I/O and backup discipline — Actual writes SQLite frequently, Memos writes SQLite on note changes, Vaultwarden writes SQLite on vault mutations. Plan for snapshots, not for tuning.

Each app was verified individually in its own guide: [Vaultwarden](https://dev.to/vaultwarden-docker-compose-self-hosting/), [Memos](https://dev.to/self-host-memos-docker-compose/), [Actual Budget](https://dev.to/self-host-actual-budget-docker/). This stack reuses those exact image tags, internal ports, and volume paths.

`docker compose version` should print v2.x).`docker` group, or `sudo` for every command.`127.0.0.1:18080` is published in the sandbox profile. In production you publish `80:80` and `443:443` on Caddy.
Sizing notes for 1 GB:

`json-file` driver grows unbounded; set `log-opts` in `/etc/docker/daemon.json` or per-service `logging:` blocks if you plan to keep logs long.
Create the stack directory and write both files. The `compose.yml` below is the exact file used for verification.

```
mkdir -p ~/privacy-stack && cd ~/privacy-stack
cat <<'EOF' > compose.yml
services:
  caddy:
    image: caddy:2-alpine
    container_name: caddy
    restart: unless-stopped
    ports:
      - "127.0.0.1:${CADDY_HTTP_PORT:-18080}:80"
    environment:
      VAULT_HOST: ${VAULT_HOST:-vault.local}
      MEMOS_HOST: ${MEMOS_HOST:-memos.local}
      BUDGET_HOST: ${BUDGET_HOST:-budget.local}
    configs:
      - source: caddyfile
        target: /etc/caddy/Caddyfile
    volumes:
      - caddy_data:/data
      - caddy_config:/config
    depends_on:
      - vaultwarden
      - memos
      - actual

  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    environment:
      DOMAIN: ${VAULT_DOMAIN:-http://vault.local}
      ADMIN_TOKEN: ${ADMIN_TOKEN}
      PUSH_INSTALLATION_KEY: ${PUSH_INSTALLATION_KEY:-}
      SIGNUPS_ALLOWED: ${SIGNUPS_ALLOWED:-true}
      TZ: ${TZ:-UTC}
      LOG_LEVEL: ${LOG_LEVEL:-info}
      ENABLE_WEBSOCKET: "true"
      IP_HEADER: X-Real-IP
      IP_HEADER_TRUSTED_PROXIES: local
    volumes:
      - vaultwarden_data:/data

  memos:
    image: neosmemo/memos:${MEMOS_TAG:-stable}
    container_name: memos
    restart: unless-stopped
    environment:
      TZ: ${TZ:-UTC}
    volumes:
      - memos_data:/var/opt/memos

  actual:
    image: actualbudget/actual-server:latest
    container_name: actual
    restart: unless-stopped
    environment:
      TZ: ${TZ:-UTC}
    volumes:
      - actual_data:/data
    healthcheck:
      test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:5006/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
      interval: 30s
      timeout: 5s
      retries: 5
      start_period: 20s

configs:
  caddyfile:
    content: |
      {
        auto_https off
      }

      http://vault.local {
        reverse_proxy vaultwarden:80
      }

      http://memos.local {
        reverse_proxy memos:5230
      }

      http://budget.local {
        reverse_proxy actual:5006
      }

volumes:
  caddy_data:
  caddy_config:
  vaultwarden_data:
  memos_data:
  actual_data:
EOF
```

Now write `.env`. Generate real secrets — do not ship the defaults.

```
cat <<'EOF' > .env
# Hostnames used by Caddy for Host-header routing
VAULT_HOST=vault.local
MEMOS_HOST=memos.local
BUDGET_HOST=budget.local

# Sandbox HTTP port on the host loopback
CADDY_HTTP_PORT=18080

# Vaultwarden
VAULT_DOMAIN=http://vault.local
ADMIN_TOKEN=replace-with-strong-random-token
PUSH_INSTALLATION_KEY=
SIGNUPS_ALLOWED=true
LOG_LEVEL=info

# Memos
MEMOS_TAG=stable

# Shared
TZ=UTC
EOF
```

Generate `ADMIN_TOKEN` with `openssl rand -base64 48`. Vaultwarden expects a long random string; the admin panel is disabled if it is empty.

Start the stack:

```
docker compose up -d
docker compose ps
```

All four containers should be `running`. Caddy will be `running` even if a backend is still warming up; Caddy returns 502 until the upstream answers.

Probe each virtual host through Caddy on the loopback port. The `Host` header is what Caddy uses to route, so `curl` must set it explicitly.

```
curl -i -H "Host: vault.local" http://127.0.0.1:18080/
curl -i -H "Host: memos.local" http://127.0.0.1:18080/
curl -i -H "Host: budget.local" http://127.0.0.1:18080/
```

Expected results:

`200 OK` with the web vault HTML.`302` to `/auth` on first run).
If any probe returns `502`, the upstream is not ready or the service name in the Caddyfile is wrong. Check logs:

```
docker compose logs --tail=50 caddy
docker compose logs --tail=50 vaultwarden
docker compose logs --tail=50 memos
docker compose logs --tail=50 actual
```

Common failure modes:

`dial tcp: lookup vaultwarden: no such host` — Caddy started before the backend container existed. `docker compose restart caddy` fixes it; `depends_on` only orders startup, not readiness.`503` for the first 20–30 seconds while it initializes its SQLite database. The healthcheck has a 20s `start_period` for this reason.`404` if `MEMOS_TAG` resolves to an image that changed its default port. The verified tag is `stable` on port `5230`.
Once the three probes pass, open the web vault and create the first Vaultwarden account. Then set `SIGNUPS_ALLOWED=false` in `.env` and `docker compose up -d vaultwarden` to close registration. Do the same for Memos and Actual through their own admin flows.

When you are ready to expose the stack to the internet, three changes are required. Do them together; partial cutover leaves you with plain HTTP on a public IP.

**1. Remove `auto_https off` from the Caddyfile.** Caddy will then attempt ACME on its own. The global block becomes empty, so delete it entirely.

**2. Replace `http://*.local` with real domain names.** Caddy needs the real hostname to request the right certificate. Use environment variables so the same file works in both profiles.

**3. Publish `80:80` and `443:443` on Caddy.** Replace the loopback port mapping.

The diff against the sandbox `compose.yml`:

```
   caddy:
     image: caddy:2-alpine
     container_name: caddy
     restart: unless-stopped
     ports:
-      - "127.0.0.1:${CADDY_HTTP_PORT:-18080}:80"
+      - "80:80"
+      - "443:443"
     environment:
       VAULT_HOST: ${VAULT_HOST:-vault.local}
       MEMOS_HOST: ${MEMOS_HOST:-memos.local}
       BUDGET_HOST: ${BUDGET_HOST:-budget.local}
configs:
   caddyfile:
     content: |
-      {
-        auto_https off
-      }
-
-      http://{$VAULT_HOST} {
+      {$VAULT_HOST} {
         reverse_proxy vaultwarden:80
       }

-      http://{$MEMOS_HOST} {
+      {$MEMOS_HOST} {
         reverse_proxy memos:5230
       }

-      http://{$BUDGET_HOST} {
+      {$BUDGET_HOST} {
         reverse_proxy actual:5006
       }
```

Update `.env` with real hostnames and the matching Vaultwarden domain:

```
VAULT_HOST=vault.example.com
MEMOS_HOST=notes.example.com
BUDGET_HOST=budget.example.com
VAULT_DOMAIN=https://vault.example.com
```

Then `docker compose up -d`. Caddy will request certificates on first request to each hostname. Watch the logs:

```
docker compose logs -f caddy
```

You should see `certificate obtained successfully` for each domain. If ACME fails, the usual causes are: DNS not yet propagated, port 80 blocked by the provider firewall, or a CAA record that excludes Let's Encrypt.

**Remote backups.** The stack itself does not include a backup sidecar. The cleanest pattern is a host-level cron that runs `docker run --rm` against the named volumes, or a separate Compose project with a `restic` container. Do not add a backup container to this stack — it complicates the single-file guarantee and the backup target (S3, B2, rsync) is environment-specific. A minimal host cron:

```
# /etc/cron.d/privacy-stack-backup
0 3 * * * root cd /home/deploy/privacy-stack && docker run --rm \
  -v privacy-stack_vaultwarden_data:/data/vaultwarden:ro \
  -v privacy-stack_memos_data:/data/memos:ro \
  -v privacy-stack_actual_data:/data/actual:ro \
  -v /srv/backups:/backup \
  alpine sh -c 'tar czf /backup/privacy-$(date +\%F).tgz -C /data .'
```

Adjust the volume prefix to match your Compose project name (`docker volume ls` shows it). For off-site copies, pipe the tarball through `restic` or `rclone` instead of writing to `/srv/backups`.

**Upgrades.** Pin image tags in `.env` for reproducibility. `latest` and `stable` are convenient but move under you. For a household stack, pinning to a specific digest and upgrading monthly is safer than tracking `latest`.

```
docker compose pull
docker compose up -d
docker compose ps
```

Vaultwarden and Memos handle in-place upgrades cleanly. Actual Budget occasionally requires a database migration on first start after an upgrade; the healthcheck's `start_period` covers it, but watch the logs for `migration` lines.

**Backups.** The three SQLite databases are the entire state. Back them up nightly, verify the tarball opens, and keep at least one copy off the VPS. A backup you have never restored is not a backup. Test the restore path quarterly: stop the stack, extract the tarball into the named volumes, start the stack, log in.

**Failure modes to expect.**

`docker compose logs caddy | grep -i error` weekly, or use an external uptime check on `https://vault.example.com`.` ADMIN_TOKEN` in `.env`, `docker compose up -d vaultwarden`, and invalidate sessions in the admin panel.
**Trade-offs.**

`compose.yml` to change the Caddyfile. That is the point: one file to copy, one file to review, one file to back up. If you need dynamic Caddy config, move to a separate Caddy project with its own volume.`vim` a config file on the host. Use `docker compose config` to inspect the rendered file, and `docker compose exec caddy cat /etc/caddy/Caddyfile` to see what Caddy actually loaded.
**Measured in our sandbox run:** total memory 173.9 MB (sum of per-container peaks over a 30s idle window after startup) across 4 containers; largest container 138.2 MB; published port(s) 18080; HTTP probe returned 200, 200, 200. The run took 99.9s with the image already cached; a fresh server also has to download it. Required secret(s) ADMIN_TOKEN were generated for the test run, as the tutorial instructs. Container breakdown: actual 138.2 MB, memos 18.5 MB, caddy 10.2 MB, vaultwarden 7.1 MB. Verified routes: Vaultwarden via Caddy (HTTP 200), Memos via Caddy (HTTP 200), Actual Budget via Caddy (HTTP 200).

*Verification: we ran this docker-compose stack in a disposable Docker environment and recorded the measurements above. They describe that run, not a guarantee for your host.*

*Originally published with full interactive benchmark metrics and server sizing notes at [https://vpsfolio.pages.dev/stacks/1gb-vps-privacy-stack-caddy-vaultwarden-memos-actual/](https://vpsfolio.pages.dev/stacks/1gb-vps-privacy-stack-caddy-vaultwarden-memos-actual/).*
