Go back

Setup and installation of 'BTCPay Server: Bitcoin Payments Made Easy' on GCP

This section describes how to provision and connect to ‘BTCPay Server: Bitcoin Payments Made Easy’ VM solution on GCP.

Note: The VM requires a DNS name to configure BTCPay Server. Please create and allocate an Static IP before deploying the instance and use it on the instance deployment page as shown in below guide. If you have a DNS name, create an A record pointing to the VM’s Static IP. Make sure to use a STATIC IP, as a dynamic IP will change after a VM reboot. If you do not have a DNS Name, you can create Dynamic DNS and configure BTCPay Server. Steps to created DDNS(Dynamic DNS) are covered below.

Please note that the VM can only be deployed in us-cetral1-a zone. So select this zone on deployment page.

  1. Open BTCPay Server: Bitcoin Payments Made Easy listing on GCP Marketplace.

/img/gcp/btcpay-server-with-bitcoin-fullnode/marketplace.png

  1. The VM needs a Static IP to function correctly. Before deploying the instance, ensure that you’ve created a Static IP and attach it during the VM setup as explained in below steps.

To create a Static IP, follow these steps:

a. Open your GCP console and select the project where you plan to deploy the BTCPay Sever instance. In the top search bar, search for IP address and select the IP addresses from the search result.

/img/gcp/nocodb/search-ip-address.png

b. On the IP addresses page, click on RESERVE EXTERNAL STATIC IP ADDRESS link on top.

/img/gcp/nocodb/reserver-static-ip.png

c. On reserve static ip page, provide the name, description. Make sure to select the Network service tier as Premium and keep the IP version as IPv4.

/img/gcp/btcpay-server-with-bitcoin-fullnode/static-ip-name.png

d. On the same page, select the same region us-central1 in which you will deploy the BtcPay Server instance. So that your Static IP and your BtcPay instance will be in the same region. Keep Attached to option to None. We will attach this static ip during VM deployment as explained below. Once done click on Reserve. Now your Static IP is ready.

/img/gcp/btcpay-server-with-bitcoin-fullnode/static-ip-region.png

  1. Go back to GCP marketplace page as shown in step1 of this guide. Click Get Started/Launch button.

/img/gcp/btcpay-server-with-bitcoin-fullnode/marketplace.png

It will ask you to enable the API’s if they are not enabled already for your account. Please click on enable as shown in the screenshot.

/img/gcp/nvidia-ubuntu/enable-api.png

  • It will take you to the agreement page. On this page, you can change the project from the project selector on top navigator bar as shown in the below screenshot.

  • Accept the Terms and agreements by ticking the checkbox and clicking on the AGREE button. /img/common/gcp_agreement_page.png

  • It will show you the successfully agreed popup page. Click on Deploy. /img/common/gcp_agreement_accept_page.png

  • On deployment page, give a name to your deployment.

  • In Deployment Service Account section, click on Existing radio button and Choose a service account from the Select a Service Account dropdown.
  • If you don't see any service account in dropdown, then change the radio button to New Account and create the new service account here.
  • If after selecting New Account option, you get below permission error message then please reach out to your GCP admin to create service account by following Step by step guide to create GCP Service Account and then refresh this deployment page once the service account is created, it should be available in the dropdown.

  • You are missing resourcemanager.projects.setIamPolicy permission, which is needed to set the required roles on the created Service Account
  • Select a zone where you want to launch the VM(such as us-east1-a). Make sure to select us-central1-a zone as the VM can only be deployed in this zone..
  • Optionally change the number of cores and amount of memory. ( This defaults to 1 vCPUs and 3.75 GB RAM) But for fast Bitcoin Full Node syncing use 2vCPU/7.5GB or higher configuration of instance.
  • Optionally change the boot disk type and size. (This defaults to ‘Standard Persistent Disk’ and 20 GB respectively)

/img/gcp/btcpay-server-with-bitcoin-fullnode/deployed-01.png

/img/gcp/btcpay-server-with-bitcoin-fullnode/deployed-02.png

  • Expand the Networking option and select the static IP you created in step2, under the External IP dropdown.

/img/gcp/btcpay-server-with-bitcoin-fullnode/select-static-ip.png

  • Be sure to expose ports 22 (for ssh), 3389 (for RDP), 80 (for HTTP) and 443 (for HTTPs). Please make sure to check the API Access checkbox to allow full access to all google cloud APIs on the VM. The VM comes with 1TB of Bitcoin Full Node DataDisk which gets created and attached in the background during VM deployement. If this option is not selected then DataDisk will not get created. In that case the instance will not work as expected.

/img/gcp/btcpay-server-with-bitcoin-fullnode/deployed-03.png

  • Click Deploy when you are done.

  • BTCPay Server: Bitcoin Payments Made Easy will begin deploying.

  1. A summary page displays when the compute engine is successfully deployed. Click on the Instance link to go to the instance page .

  2. On the instance page, click on the “SSH” button, select “Open in browser window”.

/img/gcp/rancher/ssh-option.png

  1. This will open SSH window in a browser. Switch to ubuntu user and navigate to ubuntu home directory.
sudo su ubuntu
cd /home/ubuntu/

/img/gcp/rancher/switch-ubuntu-user.png

  1. Change the password for ubuntu user using below command
sudo passwd ubuntu

/img/gcp/jupyter-python-notebook/ssh-passwd.png

  1. Now the password for ubuntu user is set, you can connect to the VM’s desktop environment from any local windows machine using RDP or linux machine using Remmina.

  2. To connect using RDP via Windows machine, first note the Static IP of the VM from VM details page as highlighted below

/img/gcp/rancher/public-ip.png

  1. Then From your local windows machine, goto “start” menu, in the search box type and select “Remote desktop connection”

  2. In the “Remote Desktop connection” wizard, paste the Static IP and click connect

/img/gcp/rancher/rdp.png

  1. This will connect you to the VM’s desktop environment. Provide “ubuntu” as the userid and the password set in above step to authenticate. Click OK

/img/gcp/rancher/rdp-login.png

  1. Now you are connected to out of box BTCPay Server: Bitcoin Payments Made Easy VM’s desktop environment via Windows machines.

/img/aws/btcpay-server-with-bitcoin-fullnode/rdp-desktop.png

  1. To connect using RDP via Linux machine, first note the external IP of the VM from VM details page,then from your local Linux machine, goto menu, in the search box type and select “Remmina”.

    Note: If you don’t have Remmina installed on your Linux machine, first Install Remmina as per your linux distribution.

/img/gcp/common/remmina-search.png

  1. In the “Remmina Remote Desktop Client” wizard, select the RDP option from dropdown and paste the external ip and click enter.

/img/gcp/common/remmina-external-ip.png

  1. This will connect you to the VM’s desktop environment. Provide “ubuntu” as the userid and the password set in above step to authenticate. Click OK

/img/gcp/common/remmina-rdp-login.png

  1. Now you are connected to out of box BTCPay Server: Bitcoin Payments Made Easy VM’s desktop environment via Linux machine.

/img/aws/btcpay-server-with-bitcoin-fullnode/rdp-desktop.png

  1. To configure BTCPay Server we need DNS Name. If you do not have a DNS Name , then a Dynamic DNS Providers allows you to have a free domain like example.ddns.net for your server. Additionally Dynamic DNS Providers expose a simple API to update the DNS record automatically when your BTCPay Server instance changes its external IP address.

BTCPay Server, when configured to use Dynamic DNS, will periodically check and update the DNS record if an external IP change is detected. However as we are using Elastic IP for our Ec2 instance, we will not need this extra step.

  1. Please refer to Dynamic DNS Provider list to create a (Free/NonFree) DDNS for this instance. First, create an account on a Dynamic DNS provider of your choice (Free/NonFree) , Once you’ve created an account, you can create a free domain name through their website. Provide the Elastic IP of the instance when prompted and create a DNS Host A record. Proceed to next step when you are ready with your DNS Name.

  2. Connect via SSH terminal using public IP of the VM with ubuntu user as explained in above steps. Switch to root user using -

sudo su -

/img/aws/btcpay-server-with-bitcoin-fullnode/switch-to-root-user-02.png

  1. Run the btcpay-server-setup.sh script using below command. This scrip will ask you for the DNS Name. Copy the DNS Name and paste it when prompted.
./btcpay-server-setup.sh

/img/azure/btcpay-server-with-bitcoin-fullnode/run-btc-script.png

  1. This will start configuring the BTCPay Server. Wait for 5-7 minutes to finish. Once the setup is done the VM will reboot and the SSH connection will lost.

/img/aws/btcpay-server-with-bitcoin-fullnode/script-completed.png

  1. Wait for few minutes to restart the VM. connect via SSH terminal again and check if all the container are up and running using -
sudo docker ps -a

/img/azure/btcpay-server-with-bitcoin-fullnode/container-status.png

  1. If all the containers are up and running then you are good to access BTCPay Server Web Interface. To do so, Copy the DNS Name of the VM and paste it in your favorite browser. For the first time, it will ask you to create admin account. Provide the onscreen details and create your first admin account.

/img/azure/btcpay-server-with-bitcoin-fullnode/access-btc-pay-with-dns.png

  1. On next page, it will ask you to create a store. Provide the details here for your first store and save the changes.

/img/azure/btcpay-server-with-bitcoin-fullnode/create-first-store.png

  1. Now you are in the BTCPay Server Dashboard Page. In the right Pane , you can see the Bitcoin Full Node Syncing Status. As the VM comes with Full Node synced till the VM publication date, the ledger is nearly 99% synced and it will take few minutes to finish the remaining syncing. Once the sync is completed, this popup will disappear.

/img/azure/btcpay-server-with-bitcoin-fullnode/btcpay-dashboard.png

For more details, please visit Official Documentation page

For video tutorials on this solution, please visit Free course on ‘BTCPay Server: Bitcoin Payments Made Easy’

Go back