Google Cloud
Deploy nostrfy on Google Cloud Compute Engine or Cloud Run.
Options: Compute Engine (VM, recommended) or Cloud Run (containers).
Option 1: Compute Engine (recommended)
- Create a VM: Ubuntu 24.04 LTS (or Debian),
e2-small(2 GB) is enough to start. Choose a region close to your users. - Firewall rule: allow inbound TCP
8080(and443for TLS). Under Network → Firewall, create a rule with the target tags you assigned to the VM. - SSH in (the console's SSH button works) and follow the generic VPS guide:
sh
curl -fsSL https://raw.githubusercontent.com/iqbqioza/nostrfy/main/install.sh | sh
sudo mkdir -p /etc/nostrfy
sudo curl -fsSL -o /etc/nostrfy/nostrfy.toml \
https://raw.githubusercontent.com/iqbqioza/nostrfy/main/deploy/nostrfy.toml
sudo nano /etc/nostrfy/nostrfy.toml # set name, public_url, private_key
sudo curl -fsSL -o /etc/systemd/system/nostrfy.service \
https://raw.githubusercontent.com/iqbqioza/nostrfy/main/deploy/nostrfy.service
sudo systemctl daemon-reload
sudo systemctl enable --now nostrfy- Reserve a static IP (External IP → Reserve) so
public_urlstays valid across reboots. - Verify:
sh
curl http://<external-ip>:8080/health- Add TLS (
wss://) with certbot + nginx (as in the VPS guide) or a GCP load balancer with a managed certificate.
Option 2: Cloud Run (container)
Cloud Run builds from the repository Dockerfile (which downloads the pre-built release
binary):
- Create a service from the GitHub repo (or push the image to Artifact Registry).
- Port: set the container port to
8080. - Allocate memory: at least 512 MB (LMDB + the async runtime).
- Persistent storage: attach a Cloud Run volume (filestore/gcsfuse) at
/data— LMDB needs a filesystem, so a GCS FUSE mount at/dataworks for persistence. - TLS: Cloud Run provides
https://automatically — setrelay.public_url = "wss://<service>.a.run.app"(or your custom domain).