BTCPay Server on Railway

Hi, is it possible to host BTCPay Server on Railway? I can’t get it to work with the official Docker image. https://docs.btcpayserver.org/Docker/
Introduction | BTCPay Server
BTCPay Server Official Documentation
13 Replies
Percy
Percy11mo ago
Project ID: bab24910-5c0c-4a08-a379-3565325f4ca9
user3249123423
user324912342311mo ago
bab24910-5c0c-4a08-a379-3565325f4ca9
Brody
Brody11mo ago
please specify what specifically you are having troubles with
user3249123423
user324912342311mo ago
BTCPay Sever requires you to configure Environment variables before running a Shell script which will then start the Docker container. Here is some Documentation:
The setup below assumes you want to support Bitcoin, Core Lightning (CLN), HTTPS automatically configured by Nginx. It also enables node pruning, which you can modify or ignore if you have enough disk space for a full node. Finally, your domain is btcpay.EXAMPLE.com should reflect your actual domain name. Environment variables can be tailored to your needs. Some variables require additional storage space. Login as root sudo su - Create a folder for BTCPay mkdir BTCPayServer cd BTCPayServer Clone this repository git clone https://github.com/btcpayserver/btcpayserver-docker cd btcpayserver-docker Run btcpay-setup.sh with the right parameters export BTCPAY_HOST="btcpay.EXAMPLE.com" export NBITCOIN_NETWORK="mainnet" 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 exit btcpay-setup.sh will then: Install Docker Install Docker-Compose Make sure BTCPay starts at reboot via upstart or systemd Setup environment variables to use BTCPay utilities Add BTCPay utilities in /usr/bin Start BTCPay Server
GitHub
GitHub - btcpayserver/btcpayserver-docker: Docker resources for hos...
Docker resources for hosting BTCPayServer easily. Contribute to btcpayserver/btcpayserver-docker development by creating an account on GitHub.
Brody
Brody11mo ago
right but what are you having troubles with?
user3249123423
user324912342311mo ago
I'm inexperienced with Docker but i managed to create Dockerfile # Use a base image with necessary dependencies FROM ubuntu:latest # Install required packages and dependencies RUN apt-get update && apt-get install -y git \ docker \ docker-compose \ && rm -rf /var/lib/apt/lists/* # Set the timezone environment variable ENV TZ=Europe/Berlin # Create a folder for BTCPay WORKDIR /BTCPayServer # Clone BTCPay Server repository RUN git clone https://github.com/btcpayserver/btcpayserver-docker /btcpayserver-docker # Set environment variables with default values ARG BTCPAY_HOST="btcpay.EXAMPLE.com" ARG NBITCOIN_NETWORK="mainnet" ARG BTCPAYGEN_CRYPTO1="btc" ARG BTCPAYGEN_ADDITIONAL_FRAGMENTS="opt-save-storage-s" ARG BTCPAYGEN_REVERSEPROXY="nginx" ARG BTCPAYGEN_LIGHTNING="clightning" ARG BTCPAY_ENABLE_SSH=true ENV BTCPAY_HOST=${BTCPAY_HOST} \ NBITCOIN_NETWORK=${NBITCOIN_NETWORK} \ BTCPAYGEN_CRYPTO1=${BTCPAYGEN_CRYPTO1} \ BTCPAYGEN_ADDITIONAL_FRAGMENTS=${BTCPAYGEN_ADDITIONAL_FRAGMENTS} \ BTCPAYGEN_REVERSEPROXY=${BTCPAYGEN_REVERSEPROXY} \ BTCPAYGEN_LIGHTNING=${BTCPAYGEN_LIGHTNING} \ BTCPAY_ENABLE_SSH=${BTCPAY_ENABLE_SSH} # Set the shell to bash SHELL ["/bin/bash", "-c"] # Run setup script using source command RUN source /btcpayserver-docker/btcpay-setup.sh -i # Expose necessary ports EXPOSE 80 443 # Start BTCPay Server ENTRYPOINT ["/bin/bash", "-c", "/btcpayserver-docker/btcpay-up.sh"] The Build runs fine but the Deploy fails. Deploy Logs: /btcpayserver-docker/btcpay-up.sh: line 12: /etc/profile.d/btcpay-env.sh: No such file or directory Define and run multi-container applications with Docker. Usage: docker-compose [-f <arg>...] [--profile <name>...] [options] [--] [COMMAND] [ARGS...] docker-compose -h|--help Options: -f, --file FILE Specify an alternate compose file (default: docker-compose.yml) -p, --project-name NAME Specify an alternate project name
Charles_
Charles_11mo ago
Nice application!
Jack
Jack11mo ago
Looks like it expects the env variables in an .sh file? You can do that with something like this that sources them.
# Create and source btcpay-env.sh
echo "export BTCPAY_HOST=${BTCPAY_HOST}" > /etc/profile.d/btcpay-env.sh
echo "export NBITCOIN_NETWORK=${NBITCOIN_NETWORK}" >> /etc/profile.d/btcpay-env.sh
# Add other environment variables as needed

# Source the environment variables
source /etc/profile.d/btcpay-env.sh
# Create and source btcpay-env.sh
echo "export BTCPAY_HOST=${BTCPAY_HOST}" > /etc/profile.d/btcpay-env.sh
echo "export NBITCOIN_NETWORK=${NBITCOIN_NETWORK}" >> /etc/profile.d/btcpay-env.sh
# Add other environment variables as needed

# Source the environment variables
source /etc/profile.d/btcpay-env.sh
Jack
Jack11mo ago
Regardless, looking at their site, I noticed they suggest having 80 GB of storage as a minimum. Not sure where this lies with the use of a torrent in the fair use policy either. https://railway.app/legal/fair-use#
Railway
Fair Use
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
user3249123423
user324912342311mo ago
Thanks for helping and saving me time, guess i keep it hosted somewhere else.
Brody
Brody11mo ago
the sh file is only setting the variables, nothing is expecting the variables to be in the sh file, there's no need to overcomplicate this
Jack
Jack11mo ago
Ohh yeah just noticed that, my bad haha, was tired.
Brody
Brody11mo ago
no worries
Want results from more Discord servers?
Add your server