Instructions to deploy BTCPay Server in production environment hosted in Google Cloud.
The following instructions assume
- You already get a domain name from Google Cloud Domain e.g. hypergori.com
- You decided the hostname with the domain name e.g. btcpay.hypergori.com
You can see our video for an overview:
You can find more details about the tooling install in the Virtual Machine in the tooling section of BTCPayServer-Docker repository.
To install BTCPay server with this google cloud deployment template. Here is the steps
- Click
Google Cloud Shellthe link above - Create Google cloud project if you haven't and set default project
- Set the server host name of your to-be-BCTPAY server in deploy.sh
- Run deploy script
- Test to access https://<your host name> and sign up to sign up the admin user
There are two ways to deploy from this document.
- deploy from Google Cloud shell
- deploy from your local computer
This document focuses only on #1 for brievity.
In case that you run the deploy script from local computer, you need to install gcloud sdk tool. https://cloud.google.com/sdk/docs/, clone this github repo and follow the same steps basically.
If you prefer the Google cloud shell, you dont need to install anything. It's already in the cloud shell environment. Just click the link above.
Let's get started !
First, we need google cloud project if you haven't created. I assume you haven't. Let's say the project name is 'btcpay-test'
$ cd btcpayserver-googlecloud
$ gcloud projects create btcpay-test --set-as-default
If you already have a project, set it as a default
$ gcloud config set project btcpay-test
You can customize your BTCPay server install parameters by modifying the file. The default configuration is,
- hostname : btcpay.hypergori.com
- region : us-west1
- zone : us-west1-a
- vm instance type : e2-medium (1 vCPU with 4G Memory)
- linux : ubuntu 20.04 LTS
- boot disksize : 500GB
- bitcoin network: mainnet
- lightning implementation: lnd
- prune mode with 1 year data
Mandatory fields in the red rectangle above are required and you have to decide what to set. Optional parameters are not required and normally just keep it empty. Customze parameters are for experts only and change only when you know what you are doing.
| type | parameter name | description | example value |
|---|---|---|---|
| Mandatory | region | Region to deploy | asia-northeast1 |
| Mandatory | zone | Zone to deploy | asia-northeast1-b |
| Mandatory | vmtype | vm type | e2-medium |
| Mandatory | diskSizeGb | root disk size in GB | 500 |
| Mandatory | BTCPAY_HOST | host name of the btcpay server | btcpaytest.mycompany.net |
| Mandatory | NBITCOIN_NETWORK | network type | mainnet |
| Mandatory | BTCPAYGEN_CRYPTO1 | crypto currecy | btc |
| Mandatory | BTCPAYGEN_LIGHTNING | lightning implementation type (lnd or c-lightning) | lnd |
| Optional | LETSENCRYPT_EMAIL | email notified by let's encrypt free SSL | |
| Optional | LIGHTNING_ALIAS | lightning node's alias | |
| Optional | BTCPAYGEN_CRYPTO2 | other crypto currency, ltc ,btg | |
| Customize | BTCPAYGEN_ADDITIONAL_FRAGMENTS | bitcoind prune config | opt-save-storage |
| Customize | BTCPAY_DOCKER_REPO | btcpay github repo | https://github.com/btcpayserver/btcpayserver-docker |
| Customize | BTCPAY_DOCKER_REPO_BRANCH | btcpay github repo branch | master |
| Customize | BTCPAYGEN_REVERSEPROXY | reverse proxy | nginx |
| Customize | ACME_CA_URI | let's encrpt url | https://acme-staging.api.letsencrypt.org/directory |
- It creates the VM instance as you configured in the yaml, that is CPU, Memory, Disk size.
- create hostname of your domain zone in Google DNS
- It creates 1 public static IP and attached to the hostname
- On the VM side, install BTCPay server as root using docker compose from BTCPay Github repo
- setup SSL certificate for free! with let's encrypt.
It would cost USD 45 with above default vm machine, excluding Domain name cost and DNS (12 bucks?). You can adjust the vm machine spec by changing vmtype.
Once you configure the configuration in deployment.sh You are ready to deploy it to GCP. Do "chmod" to the shell scripts and run it.
chmod 755 *.sh && ./deploy
Around 3+ minutes later, it will say "vm was deployed. Access the url." But it may take a few more minuts because docker compose download many of docker images of BTCPay components. Also, it talks to Let's encrypt and have it verify the host name is legitimit and issue SSL certification and install.
With bash, pass the host name.
./undeploy.sh btcpay.hypergori.com
This will be done automatically by the deployment script.
Test the install by accessing https://<your host name> and signup the first user who becomes the powerful admin user. So, Don't let the server runing without creating the user. You will see the BTCPay top page like this.



