Setting up BTCPay with ThunderHub in 5 minutes
By: Anthony Potdevin
Tags: Lightning Network, Docker, Bitcoin, Btcpay Server, Thunderhub

Setting up BTCPay with ThunderHub in 5 minutes

The team over at BTCPay have made it extremely easy to deploy BTCPay to any cloud server or local machine in a matter of minutes. Thanks to their Docker deployment, with a few commands you can have a fully working Bitcoin full node with lightning functionality and a varied assortment of additional apps all tied together behind the great UI of BTCPay.

BTCPay welcome screen.

To go along with this great tech stack, ThunderHub was also integrated into their deployment, allowing you to get a great UX for managing and monitoring your node without complications.

ThunderHub main page.

In this post we will cover the process of getting a BTCPay instance up and running from zero (on DigitalOcean) with ThunderHub integrated.

If you already have BTCPay running somewhere feel free to skip the first two parts and go directly to the “Adding ThunderHub to an existing BTCPay” section.

Starting a Server on DigitalOcean

Create an account on DigitalOcean here. This link will give you two full months to run a BTCPay instance completely for free. It’s a referral link so if you last long enough I also get a commission back. Click on the big green button on the top right to start the process of creating a Droplet (Cloud Server). Select Marketplace and look for Docker in the different options. Chose the Standard plan and select the $10/month server. This is enough to run a pruned Bitcoin node with lightning. For the data center and authentication chose whatever you prefer. Give the droplet any hostname you like (or don’t) and click on Create Droplet

If you want more detail in this first part, please refer to this medium post.

Installing BTCPay with ThunderHub

To install BTCPay and ThunderHub on this new server you need to login to your server with SSH. The simplest way is by using PUTTY. Once inside, copy and paste the following commands into the console.



mdkir btcpay

cd btcpay

git clone

cd btcpayserver-docker sudo su -mdkir btcpaycd btcpaygit clone https://github.com/btcpayserver/btcpayserver-docker cd btcpayserver-docker

With these commands you now have the BTCPay docker repository that will do the complete installation for you. So now let’s give it the correct parameters to start.

export BTCPAY_HOST="YOUROWNDOMAIN.com"

export NBITCOIN_NETWORK="mainnet"

export BTCPAYGEN_CRYPTO1="btc"

export BTCPAYGEN_REVERSEPROXY="nginx"

export BTCPAYGEN_LIGHTNING="lnd"

export BTCPAY_ENABLE_SSH=true

export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-add-thunderhub;opt-save-storage-xs"

Remember to change the BTCPAY_HOST parameter to your website domain. Since we are running a small $10/month server we also need to add opt-save-storage-xs to the additional fragments or the server will run out of space. If you have your own machine and enough space for the full blockchain, this is not needed and you can leave it like this:

export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-add-thunderhub"

Finally run this command to start the installation. Don’t forget the dot at the beginning.

. ./btcpay-setup.sh -i

Once this is finished open the following ports so that your bitcoin and lightning nodes can communicate with other nodes.

sudo ufw allow 43782

sudo ufw allow 39388

sudo ufw allow 9735

And that’s it! If you go to your domain you should now see the awesome BTCPay welcome screen.

Adding ThunderHub to an existing BTCPay

If you already have a BTCPay server running somewhere and just want to add ThunderHub it’s even easier! Two lines of code to copy and it should be up and running. First SSH into your server and paste these two lines:

export BTCPAYGEN_ADDITIONAL_FRAGMENTS="$BTCPAYGEN_ADDITIONAL_FRAGMENTS;opt-add-thunderhub" . btcpay-setup.sh -i

And that’s it! After the setup finishes you can now access ThunderHub.

Access ThunderHub

After you have everything up and running you can now access ThunderHub by going in BTCPay to Server Settings and then into Services. You will find ThunderHub in the Other Services section.

You can also go directly by going to the following URL: YOURBTCPAYDOMAIN.com/thub

Connect ThunderHub to BTCPay

To connect ThunderHub to your BTCPay node you just need one copy/paste.

In Server Settings and Services:

Go into the gRPC server information Click on Show QR Code Click on the See the QR Code information button below the QR code Click to open the configuration file Copy the complete contents of the page that opens

In ThunderHub:

Select to connect with BTCPayServer Paste what you previously copied And connect!

The End

You now have a fully working Bitcoin and Lightning node with a great UI to manage and monitor them at anytime and from anywhere.

Hope this helped you get setup and running :)

If you have any questions or suggestions feel free to hit me up on twitter at @tonyioi

Until next time!