dadatuputi/bitwarden_gcloud
Acerca de
Bitwarden installation optimized for Google Cloud's 'always free' e2-micro compute instance
Sistemas e infraestructuraCrecimiento de estrellas medido
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- Recopilando historial
Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.
README.md
OriginalBitwarden self-hosted on Google Cloud for Free
Vaultwarden on a Google Cloud e2-micro, within the Always Free tier. Works with every official Bitwarden client.
- HTTPS with no manual certificate renewal
- Scheduled backups, optionally encrypted, to disk, e-mail or cloud storage
- Weekly check for stopped backups and unsupported OS milestones
- Vault data on its own persistent disk, so OS upgrades are a disk reattach
Free on the Caddy path while egress stays under 1 GB per month and away from China and Australia, the two destinations Google's free tier excludes (countryblock blocks those and Hong Kong by default). The Cloudflare Tunnel path costs a little every month: see Connectivity.
New install
Existing deployment
Your vault, your .env and your data are untouched by a pull.
watchtower, which applies image updates, moves to the maintained
nickfedor/watchtower image and runs by default. The old
containrrr/watchtower is abandoned and does not work with current Docker
releases, so an older deployment may have had no image updates for some time.
One pull and docker-compose up -d brings them back. To have watchtower
report updates without applying them, set WATCHTOWER_MONITOR_ONLY=true in
.env.
On the data disk, the stack closes the deployment and .env to other local
users before every start. See
Keeping the deployment private.
Everything else below is opt-in.
| Goal | Page |
|---|---|
| (Required for the next steps) Move vault data off the boot disk. | Migrating to a Data Disk |
| (Recommended) Replace an unsupported OS milestone | Upgrading Container-Optimized OS |
| Close ports 80 and 443 and retire four containers, in exchange for a small monthly egress charge | Switching to a Cloudflare Tunnel |
Connectivity
Caddy is the default and the recommended path. The tunnel is a supported alternative that is not free.
| Caddy (default) | Cloudflare Tunnel | |
|---|---|---|
| Monthly cost on the free tier | none: egress within the allowance, countryblock keeps the non-free destinations off the bill |
small but non-zero: every byte the vault sends is carrier-peering egress, about $0.10 to $0.20 a month observed for one user |
| Ports open to the internet | 80 and 443 | none |
| TLS terminates at | the instance | Cloudflare's edge |
| DNS | A record maintained by ddns |
CNAME created by the tunnel |
| Instance address changes | unreachable until DNS updates | no effect |
| Maximum attachment size | unlimited | 100 MB |
| Containers | 6 | 3 |
On the tunnel path Cloudflare decrypts traffic at its edge. Vault contents are encrypted client-side before transmission; metadata and authentication traffic are not.
What the free tier includes for network traffic
From Google's free tier page and network pricing, checked September 2026. Google changes both, so check them before you rely on a number here.
- 1 GB per month of outbound data transfer from North American regions to all
destinations except China and Australia. Those two are billed from the first
byte, which is what
countryblockexists to prevent on the Caddy path. - The allowance is per billing account, not per project or per instance.
- Data transfer to networks Google reaches by Direct or Carrier Peering is a
separate SKU, "Network Data Transfer Out via Carrier Peering Network", with
no free allowance. Cloudflare's edge is such a network, so on the tunnel path
every byte the vault sends (client syncs, web vault assets,
cloudflaredkeepalives) is billed. On the Caddy path responses go to your clients' ISPs as ordinary internet egress, inside the allowance. - The same charge applies on the Caddy path if the DNS record is proxied through Cloudflare (the orange cloud). Keep it DNS-only: see DDNS.
- Inbound data transfer is free, and so is data transfer to Google services.
Observed on one deployment with one user, September 2026: 1.37 GiB on the SKU "Network Data Transfer Out via Carrier Peering Network - Americas Based", $0.11, which is about $0.08 per GiB, while every other line on the bill netted to zero. To check your own: Billing, Reports, group by SKU, and look for "Carrier Peering".
Documentation
| Installation | Build from nothing |
| Cloud Shell Setup | Environment assumed by every other page |
| Backup | Configuration and restore |
| Operations | Secrets, image updates, log growth, SSH, resource limits |
| Migrating to a Data Disk | Move the vault off the boot disk |
| Upgrading Container-Optimized OS | Replace the OS, keep the data |
| Switching to a Cloudflare Tunnel | Move to a tunnel, or back to Caddy |
| Instance Metadata | Contents of the cloud-config |
Feature Container Projects
Containers maintained in other projects. Report issues there.
- Backup - automatic backup services
- Caddy - reverse proxy and TLS certificate renewal
- Countryblock - IP Tables block lists by country
cloudflared, ddclient and fail2ban come from cloudflare/cloudflared, linuxserver/ddclient and crazymax/fail2ban, and are not maintained here.
Changelog
Unreleased
4 November 2026:
watchtowerruns by default again, so image security updates apply without anyone logging in. It was briefly opt-in behind a compose profile; a deployment that setCOMPOSE_PROFILES=watchtowerkeeps working, andWATCHTOWER_MONITOR_ONLY=trueturns updating off29 September 2026: Caddy is the recommended path again, and the tunnel is a documented alternative. Google bills egress to Cloudflare's edge on the carrier-peering SKU ("Network Data Transfer Out via Carrier Peering Network"), which has no free allowance, so a tunnel deployment is not free: about $0.10 a month for one user, scaling with traffic. Nothing in the compose files changes;
COMPOSE_FILEstill selects the tunnel, and a deployment on either path keeps working as it did. See ConnectivityCloudflare Tunnel was made the default for new installs (reversed above).
COMPOSE_FILEin.envselects it;proxy,ddns,countryblockandfail2bando not run on that path. Existing Caddy deployments are unaffected until they set itVault data moves to its own persistent disk (
utilities/migrate-to-data-disk.sh), and OS milestone upgrades become a disk reattach (utilities/upgrade-cos.sh)Startup moves to cloud-init:
bwgc.servicestarts the stack once the data disk is mounted, andbwgc-supervise.timerrestarts what stopsOn the data disk the stack closes the deployment and
.envto other users before every start, and the migration and upgrade scripts do the sameSecurity headers in
caddy/Caddyfilenow apply to every path. Theheader /matcher was an exact match, so/adminand/api/*were served withoutX-Frame-OptionsandX-Content-Type-Optionswatchtowerwas made opt-in behind a compose profile, withrenovate.jsonas the reviewed replacement (reversed above)Removed the Docker socket mount from
backup; restore now needs the operator to stopbitwardenfirstRemoved
privileged: truefromcountryblock;NET_ADMINandNET_RAWare sufficientNarrowed the
fail2banmounts: dropped the host-wide/var/logmountAdded
mem_limitandpids_limitto every serviceAdded a systemd timer that applies staged COS updates; deprecated
utilities/reboot-on-update.shin favour of it
2.0.3 - 21 May 2025
- Added backup restore feature to backup image, documented
2.0.2 - 7 November 2023
- Improve
fail2banSMTP env variable documentation in.env.template(#79) - Update IP Header env var (#77)
- Push
fail2banlogs to STDOUT / docker logging - Update
docker-composeto latest version (#76). Requires manual updating of~/.bash_aliaswith the following command:
$ docker-compose version
$ sed -i "s|docker/compose|docker compose|g" ~/.bash_alias
$ source ~/.bash_alias
$ docker-compose version
2.0.1 - 25 October 2023
- Update backup option to include
.envfor full restoration. Off by default. Please encrypt your backup if including.env - Starting new versioning/tagging system to keep track of changes. Arbitrarily starting after 2.0, which was the fully modular approach.
3 April 2023 Alert: Recent changes to Vaultwarden may cause Vaultwarden to fail to start due to default environmental variables.
.env.templatehas been updated in this repo, however, if you are affected, you must also update.envand comment out allYUBICO_*variables, so that they appear as:#YUBICO_CLIENT_ID= #YUBICO_SECRET_KEY= #YUBICO_SERVER=Restart with
docker-compose, and Vaultwarden should come up as normal. Credit to @AySz88 for reporting this.
Explorar proyectos relacionados
Cargando…