FAQ
How can I modify my environment?
As root, run . btcpay-setup.sh; this will show you the environment variable it is expecting. For example, if you support btc and ltc already, and want to add btg:
export BTCPAYGEN_CRYPTO3='btg'
. btcpay-setup.sh -i
I deployed before btcpay-setup.sh existed (before May 17, 2018), can I migrate to this new system?
Yes, run the following commands to update:
sudo su -
cd $DOWNLOAD_ROOT/btcpayserver-docker
git checkout master
git pull
git checkout 9acb5d8067cb5c46f59858137feb699b41ac9f19
btcpay-update.sh
. ./btcpay-setup.sh -i
git checkout master
btcpay-update.sh
exit
I'm getting an error on Windows: Cannot create container for service docker: Mount denied?
If you see this error:
Cannot create container for service docker: b'Mount denied:\nThe source path "\\\\var\\\\run\\\\docker.sock:/var/run/docker.sock"\nis not a valid Windows path'.
Run this in powershell:
$Env:COMPOSE_CONVERT_WINDOWS_PATHS=1
Then, run docker-compose -f EXAMPLE.yml up.
This bug comes from Docker for Windows and is tracked on Github.
How I can prune my node(s)?
This will prune your Bitcoin full node to a maximum of 100GB (of blocks):
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage"
. ./btcpay-setup.sh -i
Other options are documented here.
How can I customize the generated docker-compose file?
In some instances, you might want to customize your environment in more detail. While you could modify Generated/docker-compose.generated.yml manually, your changes would be overwritten the next time you run btcpay-update.sh.
Luckily, you can leverage BTCPAYGEN_ADDITIONAL_FRAGMENTS for this!
Let's enable pruning to 60 GB, for example:
First, copy opt-save-storage into the the docker fragment folder as opt-save-storage.custom.yml. Important: the file must end with .custom.yml, or there will be git conflicts whenever you run btcpay-update.sh.
Modify the new opt-save-storage.custom.yml file to your taste:
@@ -14,8 +14,7 @@ version: "3"
services:
bitcoind:
environment:
- BITCOIN_EXTRA_ARGS: prune=100000
+ BITCOIN_EXTRA_ARGS: prune=60000
Copied!
Then set it up:
export BTCPAYGEN_ADDITIONAL_FRAGMENTS="$BTCPAYGEN_ADDITIONAL_FRAGMENTS;opt-save-storage.custom"
. ./btcpay-setup.sh -i
Can I run BTCPay Server on ports other than 80 and 443?
You can change the ports for HTTP and HTTPS by setting the environment variables REVERSEPROXY_HTTP_PORT and REVERSEPROXY_HTTPS_PORT. This is handy when ports 80 and 443 are already in use on your host, or you want to offload SSL termination with an existing web proxy.
When you set REVERSEPROXY_HTTP_PORT to another value than 80, the built-in Let's Encrypt certificate will not work, as Let's Encrypt will try to validate your SSL certificate request by connecting from the internet to your domain on port 80. This validation request should be able to reach BTCPay Server in order to receive the certificate.
If you need to run on a different port, it's best to terminate SSL using another web proxy and forward your traffic.
Can I offload HTTPS termination?
Yes. Please see the documentation.
How can I back up my BTCPay Server?
We provide a backup script that dumps the database and saves the important files:
cd "$BTCPAY_BASE_DIRECTORY/btcpayserver-docker"
./backup.sh
This will save the backup locally as /var/lib/docker/volumes/backup_datadir/_data/backup.tar.gz. These are the options to customize the backup name and location:
BACKUP_TIMESTAMP=truesaves the backup with datetime as part of the file name, so that backups do not get overwritten.BACKUP_PROVIDER=SCPsaves the backup remotely, requires additionalSCP_TARGETenvironment variable (see below).BACKUP_PROVIDER=Dropboxsaves the backup to Dropbox, requires additionalDROPBOX_TOKENenvironment variable (see below).
cd "$BTCPAY_BASE_DIRECTORY/btcpayserver-docker"
# Backup with custom file name and timestamp:
BACKUP_TIMESTAMP=true ./backup.sh
# Backup via SCP:
BACKUP_PROVIDER=SCP SCP_TARGET=myhost:backups/btcpay ./backup.sh
# Backup to Dropbox:
BACKUP_PROVIDER=Dropbox DROPBOX_TOKEN=myDropboxToken ./backup.sh
You can also choose to only dump the database. This option does not need to stop and restart the docker-containers:
cd "$BTCPAY_BASE_DIRECTORY/btcpayserver-docker"
./backup.sh --only-db
How can I connect to the database?
On the server you can open a database session by connecting via psql as the postgres user:
docker exec -ti $(docker ps -a -q -f "name=postgres_1") psql -U postgres
Then, inside psql you can select a database and interact with the tables:
# list databases
\l
# connect to database
\c btcpayservermainnet
# list tables
\dt+
# list users
SELECT "Id", "Email" FROM "AspNetUsers";
# end session
\q
