Deploy BTCPay Server
Accept Bitcoin payments in your own store with no fees or middleman.
Just deployed
/var/lib/postgresql/data
bitcoind
Just deployed
/data
nbxplorer
Just deployed
/datadir
btcpayserver
Just deployed
/data
Deploy and Host BTCPay Server on Railway

BTCPay Server is a free, open source Bitcoin payment processor that you host yourself. Customers pay invoices straight to your own wallet, with no payment company in the middle, no processing fees from BTCPay and no account that can be frozen. It offers invoices, a point of sale app, crowdfunding pages, payment requests and pay buttons, plus plugins for WooCommerce, Shopify and other stores, and a full API. BTCPay Server is MIT licensed with about 7,900 GitHub stars; this template runs BTCPay 2.4.3 with NBXplorer 2.6.11, Bitcoin Core 31.1 and PostgreSQL 18, all connected over Railway's private network. Out of the box it runs on regtest, a private test chain, so you can try the full payment flow in minutes without real money, then connect your own Bitcoin node for live payments. Card processors typically take around 2.9% plus a fixed fee per payment, and hosted crypto processors often take about 1% (approximate). BTCPay on Railway costs about $10–20/month.
What This Template Deploys
| Service | Purpose |
|---|---|
| btcpayserver | The BTCPay web app and API on port 8080 with a public domain. Volume at /data for settings and plugins. Creates the first admin account on boot and closes public signup. |
| nbxplorer | NBXplorer, the lightweight block explorer that tracks your wallets' addresses and payments. Private only, volume at /datadir. |
| bitcoind | Bitcoin Core 31.1, configured for regtest by default, with a pruned volume at /data. Private only. |
| Postgres | PostgreSQL 18 holding BTCPay's and NBXplorer's databases, which are created on first boot. |
All three Bitcoin services share one RPC password, generated for you, and talk only over the private network.
About Hosting BTCPay Server
Running your own payment processor means the money goes straight to you and nobody can block payments, take a cut or demand identity paperwork for your customers.
No fees and no middleman. BTCPay charges nothing. Payments go directly to your wallet, and you pay only network fees and hosting.
Your keys, your coins. Connect a hardware wallet or extended public key. BTCPay generates a fresh address for every invoice without holding your private keys.
Invoices and checkout. A clean checkout page with QR codes, exchange-rate conversion from many currencies and automatic payment detection.
Built-in apps. Point of sale for shops, crowdfunding pages, payment requests and simple pay buttons for any website.
E-commerce plugins. Connect WooCommerce, Shopify and other platforms, or use the Greenfield API in your own app.
Multiple stores and users. Run several stores from one server and give staff limited roles.
Deploy BTCPay Server in Under 5 Minutes
- Optional: set
BTCPAY_ADMIN_EMAILon the btcpayserver service to your own email. - Click Deploy on Railway and wait for all four services to turn healthy; the first boot runs database migrations.
- Open the btcpayserver domain and sign in with
BTCPAY_ADMIN_EMAILandBTCPAY_ADMIN_PASSWORDfrom the service variables. - Create a store and set up a wallet. On regtest, let BTCPay generate a test wallet.
- Create an invoice and use the built-in test controls to pay it and mine a block, so you see the full flow.
Important: Regtest First, Real Payments Later
The default network is regtest, a private chain with no real coins. BTCPAY_CHEATMODE adds buttons to pay invoices and mine blocks so you can test everything end to end. Do not take customer payments in this mode.
For real payments, a full Bitcoin chain needs far more disk than a small volume. There are two options:
- Use your own node. Remove the bitcoind service, set
BITCOIN_NETWORKtomainneton nbxplorer and btcpayserver, and point NBXplorer's RPC and P2P settings at a Bitcoin node you already run. - Use a large volume. On a plan with enough storage, set
BITCOIN_NETWORKtomainneton all three services and plan for a long initial sync.
Changing the network switches to fresh databases, so test data never mixes with real payments.
Common Use Cases
- Online stores: accept Bitcoin in WooCommerce, Shopify or a custom checkout.
- Point of sale: take Bitcoin payments in a shop or at events from a tablet.
- Donations and crowdfunding: run a fundraising page or donation button without a platform cut.
- Freelance invoicing: send payment requests that clients pay in Bitcoin.
- SaaS billing: create invoices from your app through the Greenfield API.
- Developer testing: build and test Bitcoin payment integrations on regtest.
- Learning Bitcoin payments: explore invoices, wallets and confirmations safely.
Configuration
| Variable | Service | Default | Description |
|---|---|---|---|
BTCPAY_ADMIN_EMAIL | btcpayserver | admin@example.dev | First server admin email |
BTCPAY_ADMIN_PASSWORD | btcpayserver | 🔐 Auto-generated | First server admin password |
BITCOIN_NETWORK | all three | regtest | regtest, signet, testnet or mainnet; must match everywhere |
BTCPAY_CHEATMODE | btcpayserver | true | Test controls on regtest; ignored on mainnet |
BITCOIN_RPC_PASSWORD | bitcoind | 🔐 Auto-generated | Shared RPC secret for NBXplorer |
BITCOIN_PRUNE | bitcoind | 550 | MB of blocks kept on the volume |
BITCOIN_DBCACHE | bitcoind | 512 | UTXO cache in MB |
RAILWAY_HEALTHCHECK_TIMEOUT_SEC | bitcoind, btcpayserver | 900, 600 | Extra time for the first boot |
Admin account. The first admin is created automatically and public signup closes, so nobody can claim your server first. Change the password after signing in.
Custom domain. Add your domain to the btcpayserver service in Railway. Use it in store plugins so checkout links match your brand.
Lightning. Lightning is not included. Connect an external LND, Core Lightning or phoenixd node from the store's Lightning settings.
Backups. Back up Postgres and the btcpayserver volume. Keep your wallet seed offline; BTCPay does not need it once the wallet is set up with a public key.
Updates. The template pins BTCPay 2.4.3, while 2.4.7 is the latest release. Back up before upgrading.
Running BTCPay Safely
Use a watch-only wallet. Set up your store with an extended public key or hardware wallet, so the server never holds keys that can spend funds.
Test on regtest first. Run through invoices, refunds and store plugins on the test chain before switching networks.
Protect the admin account. Use a strong password and turn on two-factor authentication in your account settings.
Mind confirmations. Choose how many confirmations count as paid for each store, balancing speed against risk for large payments.
Keep your node in sync. For mainnet, monitor your Bitcoin node; invoices are only detected while NBXplorer is connected and synced.
Know your obligations. Accepting Bitcoin may have tax and reporting rules where you live. Check them before going live.
BTCPay Server vs. Alternatives
| Feature | BTCPay on Railway | Hosted crypto processors | Card processors | Direct wallet address |
|---|---|---|---|---|
| Hosting | Self-hosted | Hosted | Hosted | None |
| License | MIT | Proprietary | Proprietary | Not applicable |
| Processing fees | None | About 1% (approximate) | About 2.9% plus a fee (approximate) | None |
| Funds go to your wallet | ✅ | Varies | ❌ | ✅ |
| Invoices and checkout | ✅ | ✅ | ✅ | ❌ |
| Store plugins | ✅ | ✅ | ✅ | ❌ |
| Account can be frozen | ❌ | ✅ | ✅ | ❌ |
Hosted processors and card networks need no setup but take a cut and control the account. A bare wallet address has no invoices or tracking. BTCPay gives you a full checkout with funds going straight to you.
Dependencies for BTCPay Server Hosting
- A Railway account.
- For real payments: your own Bitcoin node or a large volume, plus a wallet.
Deployment Dependencies
- BTCPay Server on GitHub: source code and releases
- BTCPay Server documentation: stores, wallets and plugins
- Railway build files: wrappers for the three services
Implementation Details
Small wrapper scripts replace the shared volumes upstream relies on: bitcoind derives its RPC authentication from the shared password, and the Bitcoin services listen on IPv6 for Railway's private network.
Frequently Asked Questions
What is BTCPay Server? An MIT-licensed open source, self-hosted Bitcoin payment processor with no fees.
How much does it cost to host? About $10–20/month on Railway. BTCPay itself charges no fees.
Can I take real payments right away? No. It starts on regtest for testing. Connect your own node to switch to mainnet.
How do I log in?
Use BTCPAY_ADMIN_EMAIL and BTCPAY_ADMIN_PASSWORD from the btcpayserver variables.
Does it support Lightning? Yes, by connecting an external Lightning node from the store settings.
Does BTCPay hold my funds? No. Payments go to your own wallet, and a watch-only setup keeps keys off the server.
Why Deploy and Host BTCPay Server on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying BTCPay Server on Railway, you get a fee-free Bitcoin checkout that pays straight to your own wallet.
Template Content
bitcoind
gridalpha/btcpay-server-railwaynbxplorer
gridalpha/btcpay-server-railwaybtcpayserver
gridalpha/btcpay-server-railway
