Deploy a Crypto Payment Gateway in 3 Minutes with Docker
DeFi protocols lost over $200 million to hacks in May 2026 alone. MARA spent $4.3 million on CEO security in 2025. The question isn't whether your payment infrastructure will be targeted — it's how often. Hosted payment gateways hold your keys and your money. A self-hosted gateway puts you in control. Here's how to deploy one in three minutes.
The Problem With Hosted Payment Gateways
Last week, a DeFi lending protocol got drained for $47 million in a flash loan attack. Same week, Bitcoin miner MARA disclosed in an SEC filing that it spent $4.3 million on CEO security in 2025. Different problems, same signal: asset security is becoming a systemic issue in crypto.
Hosted payment gateways — CoinGate, OpenNode, Coinbase Commerce — manage your private keys and funds. Convenient, sure. But you don't control the money. QuadrigaCX in 2019: $190 million gone. FTX in 2022: billions evaporated. Every time, users find out last.
A self-hosted payment gateway flips the model: you run the server, you hold the keys, you control the funds. No intermediary can freeze your assets, hike your rates, or reject your transactions for "compliance review." And in 2026, Docker makes the barrier to entry trivial — one VPS, two commands, three minutes.
Why Xcash for Your Self-Hosted Payment Gateway
There aren't many self-hosted options. BTCPay Server is the most famous — but it's Bitcoin-only. If you need to accept USDT, USDC, ETH, MATIC, or any EVM chain's native token, BTCPay can't help.
Xcash is an open-source multi-chain payment gateway released in 2025. The design goal is blunt: one command to launch, every chain supported. Bitcoin + Ethereum + BSC + Polygon + Arbitrum + Optimism + Avalanche + Fantom + 100+ EVM chains. USDT and USDC across ERC-20, TRC-20, and BEP-20.
No joke — deployment actually takes three minutes:
git clone https://github.com/xca-sh/xcash.git
cd xcash && ./scripts/init_env.sh && docker compose up -d
After that, open http://your-server-ip:8000 in a browser. The admin dashboard is live.
What You Need Before Starting
Three things:
- A Linux server. Minimum 1 vCPU, 2GB RAM, Ubuntu 22.04 or Debian 12. Vultr, Hetzner, DigitalOcean, or AWS Lightsail all work. Xcash doesn't run a full node — no 600GB of blockchain data
- Docker and Docker Compose. If the server is fresh:
curl -fsSL https://get.docker.com | sh. Docker Compose is bundled with Docker now - A domain (optional). IP-only access works fine. If you want a domain, just add an Nginx reverse proxy in front
Compare: BTCPay Server requires a full Bitcoin node first — 600GB+ of data, 1-3 days of sync. Xcash connects via public RPC or your own Infura/Alchemy endpoints. It's ready the moment Docker finishes pulling images.
Step-by-Step Deployment
Step 1: Clone the repo
git clone https://github.com/xca-sh/xcash.git
cd xcash Step 2: Run the init script
./scripts/init_env.sh
The script walks you through a few basic settings — admin username and password, SECRET_KEY, database password. Hit Enter to accept defaults, or customize. Everything lands in .env. You can tweak it anytime after deployment.
The important one is CHAIN_RPC_URLS — RPC endpoints per chain. The defaults use public nodes, which work. If you have Infura, Alchemy, or QuickNode API keys, swap them in for better reliability.
Step 3: Start the stack
docker compose up -d Docker Compose pulls four containers: Django app (API + admin panel), PostgreSQL, Redis cache, and Celery task queue. First build pulls images — about 30 seconds. Subsequent starts are instant.
Once the containers are up, go to http://your-ip:8000/admin/ and log in with the admin credentials you set. The dashboard is ready.
What You Just Deployed
Three commands later, your server is running:
- A web admin dashboard — create wallets, view transactions, configure webhooks, manage API keys
- A full REST API — create invoices, check payment status, generate deposit addresses, initiate withdrawals. Standard JSON request/response
- Multi-chain HD wallet — every transaction gets a unique deposit address per customer. No address reuse, no confusion
- Webhook callbacks — your backend gets notified when a payment confirms. No polling required
- Built-in AML — MistTrack integration flags suspicious addresses automatically
Self-Hosted vs Hosted: At a Glance
| Dimension | Self-Hosted (Xcash) | Hosted (CoinGate/OpenNode) |
|---|---|---|
| Platform fee | Zero | 1% per transaction |
| Private keys | ✅ You hold them | ❌ Platform holds them |
| Chains supported | 100+ EVM + Bitcoin | 10-30 chains |
| KYC required | ❌ No | Mandatory KYC |
| Deploy time | 3 minutes | Sign up (but you don't own it) |
| Fund freeze risk | ❌ Zero (you control) | ✅ Platform can freeze |
| API rate limits | ❌ Unlimited | Per-plan throttling |
| $50K/mo volume, annual cost | ~$20/mo server | 1% = $6,000/year |
| Withdraw to any address | ✅ Yes | Partial / reviewed |
Production Hardening (For Your Ops Team)
The three-command deploy works. For production, add a few layers.
Reverse proxy + HTTPS: Use Nginx as a reverse proxy with TLS termination. Point it at localhost:8000, set X-Forwarded-For and Host headers. Grab certs from Let's Encrypt. Never expose port 8000 directly to the internet — route everything through Nginx on 443.
Database backups: Cron job for nightly automated backups.
0 3 * * * docker exec xcash-db-1 pg_dump -U xcash xcash > /backups/xcash_backup.sql Firewall rules: Only expose necessary ports.
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable Xcash vs Other Self-Hosted Options
BTCPay Server is the only comparable self-hosted alternative. But their philosophies are different:
- BTCPay: Bitcoin-only. Requires a full Bitcoin node + 1-3 days sync + 600GB disk. Excellent Lightning support. Zero stablecoin support. Best for teams already running nodes
- Xcash: Multi-chain by default. No full node required. 100+ EVM chains supported natively. Lightning support in development. Best for businesses that need to accept multiple cryptocurrencies now
See our full BTCPay Server vs Xcash comparison.
Your First Payment
After deployment, create your first invoice with a single POST:
curl -X POST http://your-ip:8000/api/v1/invoices/ \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d @invoice.json
Fill invoice.json with amount, currency, chain, order ID, and callback URL. The response includes a payment_url. Embed it in your checkout page, or send it directly to the customer. They open the link, pay with their wallet, you get the confirmation — same flow as CoinGate, but zero fees and the money lands in your wallet.
Full API docs: docs.xca.sh.
FAQ
Do I need to run a full node?
No. Xcash connects to blockchains via public RPC endpoints or your own Infura/Alchemy/QuickNode API keys. It doesn't store 600GB of chain data. A 1 vCPU, 2GB RAM VPS is plenty.
Which cryptocurrencies does Xcash support?
Bitcoin (BTC), Ethereum (ETH), USDT (ERC-20 / TRC-20 / BEP-20), USDC, and native tokens on 100+ EVM-compatible chains — including BSC, Polygon, Arbitrum, Optimism, Avalanche, and Fantom. All through one API.
How does this compare to CoinGate or OpenNode?
Two things: zero fees and full control. CoinGate takes 1% per transaction. At $50K/month, that's $6,000 a year — buys a lot of VPS. And hosted providers can freeze your account anytime — they hold the keys. Self-hosting saves you more than money. It saves you from being someone else's compliance decision.
How do I update after deployment?
cd xcash && git pull && docker compose pull && docker compose up -d Data lives in Docker volumes — updates don't touch it. Test on staging first.