Content
Hosting BTCPayServer in Linux server
Minimum requirements:
- RAM : 2GB
- Storage : 10 - 80 GB
- Docker
- Domain (should point to the correct IP address)
Steps:
-
Check if git is installed or not in your Linux server since we need git to install BTCPayServer repository.
-
You can install git with following commands:
sudo apt-get update
sudo apt-get install git
- Now, install docker in your linux server with following commands (if you haven’t already installed it with)
sudo apt install apt-transport-https ca certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable”
sudo apt-get update
sudo apt install docker-ce
(For specific version : sudo apt-get install docker-ce=<version>)
You can check version with command : docker –version
- After successfully installation of git and docker , follow steps mentioned below
a. Create a folder for BTCPay
mkdir BTCPayServer
cd BTCPayServer
b. Clone this repository
git clone https://github.com/btcpayserver/btcpayserver-docker
cd btcpayserver-docker
c. Run btcpay-setup.sh with the right parameters. You can always modify these parameters and re-run the installation process with last command (. ./btcpay-setup.sh -i)
export BTCPAY_HOST="btcpay.example.com"
**export NBITCOIN_NETWORK="testnet" //**You can use testnet also here.
export BTCPAYGEN_CRYPTO1="btc"
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage-s"
export BTCPAYGEN_REVERSEPROXY="nginx"
export BTCPAYGEN_LIGHTNING="clightning"
export BTCPAY_ENABLE_SSH=true
. ./btcpay-setup.sh -i
Note: this installation may take 10-15 minutes depending on the performance of your linux server.
Note:
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage-s"
(!) this line could cause the server to be synching indefinitely. Removing it and reinstalling the server ( just deleting the folder btcpayserver-docker and re-cloning and restarting the server helped to resolve the synching issue. Then this parameter can be added again to ensure that the server is using reasonable amount of memory.
- After running above commands, you can go to your browser and hit the domain you provided as BTCPAY_HOST (for eg: btcpay.example.com). Then you will see webpage of your own btcpayserver. Here, you can create your account and do other required steps.
For testing, i have created one account with (email: [email protected] and password: Elintegro@btcpayserver). Recovery phrase for wallet of this account with store Elintegro-Test1 is given below.
How to switch btc-network from testnet to mainnet ?
=> To switch testnet to mainnet , you have to follow these steps:
- Go to your server (by entering your credentials )
Enter your password (you know this ::))
- Enter this command and go to BTCPayServer:
cd BTCPayServer
- Go to btcpayserver-docker by entering this command
cd btcpayserver-docker
- Now enter this command and restart btcpayserver
export NBITCOIN_NETWORK="mainnet"
. ./btcpay-setup.sh -i
Note: After finishing up , you can just go to the browser and enter your site (host).
To stop btcpayserver, enter this command:
. ./btcpay-down.sh
To start again:
. ./btcpay-up.sh