Deploy a Freqtrade trading bot on Railway, step by step
Run Freqtrade on Railway with the one-click template: dry-run by default, FreqUI login, Telegram alerts, safe API keys and what it costs at $10 per GB of RAM.
Disclosure: Some links in this article are referral links. If you sign up through them we may earn a commission at no extra cost to you. It doesn't affect what we write. How we make money.
Key takeaways
- Railway's Freqtrade template deploys the official freqtradeorg/freqtrade:2026.8 image with FreqUI on port 8080, a persistent volume and dry-run switched on, so no exchange keys are needed to start.
- The template rewrites config.json on every boot, so all settings (password, pairs, Telegram, exchange keys) belong in FREQTRADE__ environment variables, not in the file.
- Change the default FreqUI password before the first deploy: the service gets a public URL, and anyone with the login can control the bot.
- For live trading, create exchange keys with trading only, no withdrawals. Railway only offers fixed outbound IPs for IP allowlisting on the Pro plan.
Contents 10 sections
- What you get with the Railway Freqtrade template
- Before you start
- Step 1: Deploy the template
- Step 2: Log in to FreqUI
- Step 3: Configure the bot with environment variables
- Step 4: Add your own strategy
- Step 5: Get alerts on Telegram
- Step 6: Going live safely
- How much does Railway cost for a trading bot?
- Railway or a VPS?
The fastest way to get a crypto trading bot running 24/7 without managing a server is Railway’s Freqtrade template: one click deploys the open-source Freqtrade bot with its web dashboard (FreqUI), a persistent volume and paper trading switched on. You then configure everything through environment variables and only add exchange keys once a strategy has proven itself in dry-run.
This guide walks through the template as it exists in September 2026, including one quirk that trips people up: the config file is regenerated on every restart.
What you get with the Railway Freqtrade template
The Freqtrade template is a thin wrapper around the official Docker image, pinned to freqtradeorg/freqtrade:2026.8 (the latest Freqtrade release at the time of writing). According to its source repository, it sets up:
| Part | What the template does |
|---|---|
| Image | Official freqtradeorg/freqtrade:2026.8, no source build |
| Storage | Railway volume mounted at /freqtrade/user_data (strategies, SQLite trade database, logs) |
| Dashboard | FreqUI and the REST API on port 8080, behind a username and password |
| Mode | Dry-run (paper trading) with a 1,000 USD simulated wallet |
| Exchange | Kraken spot, BTC/USD, ETH/USD and SOL/USD, 100 USD per trade |
| Strategy | SampleStrategy, the demo strategy that ships with Freqtrade |
| Health check | /api/v1/ping, restart on failure |
Two honest caveats. First, this is a community template published by a third party, not by the Freqtrade team, and it had only a handful of deploys when we checked. Read the Dockerfile and entrypoint before you put real keys into it. Second, SampleStrategy is a demo. Freqtrade’s own docs warn it exists to show the structure of a strategy, not to make money.
Before you start
You need three things:
- A Railway account. If you sign up for Railway through a referral link, the account gets $20 in credits (per Railway’s affiliate program page). Without one, new trial accounts get a one-time $5 grant.
- A strong password for FreqUI. Generate one with a password manager or
openssl rand -hex 24. - Optionally, a Telegram bot token for phone alerts (covered below).
You do not need exchange API keys for any of the dry-run steps.
Step 1: Deploy the template
- Open the Freqtrade template page and click Deploy Now.
- Railway shows the template’s variables before it deploys. Change these right away:
FREQTRADE__API_SERVER__PASSWORD: replacechange-me-pleasewith your generated password.FREQTRADE__API_SERVER__USERNAME: optional, but anything other than the defaultfreqtraderis one more thing an attacker has to guess.
- Leave
FREQTRADE__DRY_RUNastrue. - Deploy. The first build pulls the image and seeds the volume with the Freqtrade folder structure. The health check allows up to five minutes for the bot to come up.
When the deployment turns green, open the service’s Deployments tab and check the logs. You should see the entrypoint seed user_data, refresh config.json, and then Freqtrade start in dry-run mode with Kraken.
Step 2: Log in to FreqUI
Open the service URL (if none exists yet, go to the service’s Settings, then Networking, and click Generate Domain). FreqUI loads at the root path. Log in with the username and password from your variables.
In the trade view you can watch open dry-run trades, see the simulated balance and start or stop the bot. With a 5-minute strategy on three pairs, don’t expect a flood of trades in the first hour.
A quick health check without logging in: https://your-service.up.railway.app/api/v1/ping should return a small JSON “pong”.
Step 3: Configure the bot with environment variables
This is the part most people miss. On every boot, the template’s entrypoint copies its baked-in default config over /freqtrade/user_data/config.json. Anything you edit inside that file is gone after the next restart.
Instead, use Freqtrade’s environment variable overrides. The Freqtrade configuration docs define the format: prefix FREQTRADE__, then the config path with double underscores as separators. Environment variables beat the config file; command-line arguments beat both.
Useful overrides, set on the service’s Variables tab:
# Trade different pairs (JSON lists are parsed as JSON)
FREQTRADE__EXCHANGE__PAIR_WHITELIST='["BTC/USD", "ETH/USD", "SOL/USD", "XRP/USD"]'
# Size and number of positions
FREQTRADE__STAKE_AMOUNT=50
FREQTRADE__MAX_OPEN_TRADES=3
# Bigger simulated wallet for dry-run
FREQTRADE__DRY_RUN_WALLET=5000
Variable changes are staged. Railway shows them as pending changes that you have to review and deploy before the bot picks them up.
To confirm what the bot actually loaded, open a shell (next step) and run python3 -m freqtrade show-config --config /freqtrade/user_data/config.json (the template runs Freqtrade as a Python module, so use the same form). It prints the merged configuration with secrets redacted.
Step 4: Add your own strategy
Strategies live on the volume at /freqtrade/user_data/strategies/, which survives restarts. The simplest way to get a file there is the Railway CLI:
npm i -g @railway/cli # or: brew install railway
railway login
railway link # pick the project and the freqtrade service
railway ssh # opens a shell inside the running container
Inside the container:
cd /freqtrade/user_data/strategies
cat > MyStrategy.py # paste your strategy, then press Ctrl+D
ls
Then set FREQTRADE__STRATEGY=MyStrategy (the class name, not the file name) in the variables and deploy. The template passes that value to --strategy on startup.
Test a strategy locally with backtesting before you upload it. Freqtrade’s download-data and backtesting commands run fine on a laptop with Docker; our Freqtrade on DigitalOcean guide shows the exact commands.
Step 5: Get alerts on Telegram
Freqtrade can send every entry and exit to Telegram and accept commands like /status, /profit, /balance and /stopentry. Setup, per the Freqtrade Telegram docs:
- Message @BotFather, send
/newbot, pick a name and a username ending inbot. Copy the token. - Open a chat with your new bot and press Start.
- Message @userinfobot to get your numeric user ID.
- Set three variables and deploy:
FREQTRADE__TELEGRAM__ENABLED=true
FREQTRADE__TELEGRAM__TOKEN=123456789:your-bot-token
FREQTRADE__TELEGRAM__CHAT_ID=your-numeric-user-id
Use a private chat, not a group. Everyone in a group chat can send commands to the bot, including /forceexit all.
Step 6: Going live safely
Only switch off dry-run after the strategy has run on paper long enough to see a range of market conditions, and after the dry-run results roughly match your backtest. When you do:
Create a restricted exchange API key. On your exchange, create a key that can read balances and place and cancel orders, and nothing else. Leave withdrawal permission off. If the key leaks, an attacker can make bad trades, but cannot move funds out.
Know the IP allowlist trade-off. Most exchanges let you lock a key to specific IP addresses, which is the single best protection for a bot key. Railway only offers static outbound IPs on the Pro plan (Railway docs). On Hobby, your outbound IP can change, so an allowlist will break. If you want an allowlisted key on a small budget, a VPS with a fixed IP is the better fit: see how to run Freqtrade on DigitalOcean.
Store keys as sealed variables. Add FREQTRADE__EXCHANGE__KEY and FREQTRADE__EXCHANGE__SECRET on the Variables tab, then use the three-dot menu to Seal them. Sealed variables reach the deployment but are no longer visible in the UI or API. They cannot be unsealed, so keep the originals in your password manager until you have confirmed the bot works.
Never put keys in Git. If you fork the template repo to customise it, keys still belong in Railway variables. A key committed to a public repo can be scraped within minutes.
Start from a clean database. Freqtrade’s docs recommend a fresh database for live trading so dry-run trades don’t mix with real ones. The template always uses /freqtrade/user_data/tradesv3.sqlite, so rename it before switching:
railway ssh
mv /freqtrade/user_data/tradesv3.sqlite /freqtrade/user_data/tradesv3.dryrun-archive.sqlite
Then set FREQTRADE__DRY_RUN=false, deploy, and start with a stake small enough that a bug costs you little. Turn on two-factor authentication for Railway, the exchange and Telegram.
How much does Railway cost for a trading bot?
Railway charges for what the container actually uses. As of September 2026, the pricing docs list:
| Plan | Monthly fee | Included usage | Notes |
|---|---|---|---|
| Free | $0 | $1 credit | 0.5 GB RAM per service, too small for 24/7 use |
| Hobby | $5 | $5 | Up to 48 GB RAM per service, 5 GB volumes |
| Pro | $20 | $20 | Static outbound IPs, larger volumes |
Resource prices: $10 per GB of RAM per month, $20 per vCPU per month, $0.15 per GB of volume storage per month and $0.05 per GB of egress.
A worked example: a bot averaging 0.4 GB of RAM and 5% of one vCPU costs about 0.4 × $10 + 0.05 × $20 = $5 a month, which the Hobby plan’s included usage covers. Add more pairs, a shorter timeframe or FreqAI and both numbers climb. Check the service’s Metrics tab after a few days rather than guessing. At that footprint, the $20 referral credit covers roughly four months of usage.
Railway or a VPS?
Railway suits you if you want the bot running in ten minutes, prefer a web dashboard to a terminal, and are happy paper-trading or running a small live account. The trade-offs: config lives in variables rather than a file you can edit, static IPs cost a Pro plan, and you depend on a community template.
A VPS makes more sense for allowlisted API keys, heavy backtesting, or several bots on one machine. DigitalOcean’s cheapest droplet with the 2 GB of RAM that Freqtrade recommends costs $12 a month, with a fixed IP included.
If your trading ideas start as chart setups rather than Python, TradingView is useful for sketching and alerting on them before you code a strategy; our guide to which TradingView plan you need covers which tiers include webhook alerts. And if you’re comparing a self-hosted bot with the ready-made kind, read are Telegram trading bots safe first: the custody model is completely different.
Frequently asked questions
How much does it cost to run Freqtrade on Railway?
Railway bills actual usage at $10 per GB of RAM and $20 per vCPU per month. The Hobby plan costs $5 and includes $5 of usage, so a single lightly loaded bot often stays near that amount. Check the service's Metrics tab after a few days to see your real footprint.
Can I run Freqtrade on Railway's free plan?
The Free plan caps services at 0.5 GB of RAM and $1 of monthly credit, which is too tight for a bot that runs 24/7. The one-time trial grant or referral credit is fine for testing, but plan on Hobby for anything continuous.
Is it safe to put exchange API keys on Railway?
It is reasonable if you store them as variables (sealed, ideally), never commit them to Git, and create keys without withdrawal permission. The remaining risk is someone taking over your Railway account, so turn on two-factor authentication.
Does the Railway template trade with real money?
Not by default. FREQTRADE__DRY_RUN is set to true and the simulated wallet holds 1,000 USD. Real orders only happen after you add exchange keys and set dry-run to false.
