Docker is the fastest and cleanest way to run freqtrade. The official image already includes TA-Lib, hyperopt dependencies and FreqUI, so you avoid most installation problems. This guide follows the official Docker quick start and adds the checks we use ourselves.
Time needed: about 15 minutes. You need: a computer or VPS you can leave running, and basic comfort with a terminal.
Step 1: Prepare the machine
For a bot that runs 24/7, a Linux VPS is the usual choice; our VPS guide covers size and location. Freqtrade's recommended minimum is 2 GB RAM, 2 vCPUs and 1 GB of disk. Ubuntu 24.04 LTS is a solid default.
Make sure the clock is synchronised, because exchanges reject requests with a wrong timestamp:
timedatectl status
# "System clock synchronized: yes" is what you want
Step 2: Install Docker
- Linux: install Docker Engine and the Compose plugin by following Docker's official instructions for your distribution.
- Mac or Windows: install Docker Desktop. On Windows, restart after installing.
Check it works:
docker --version
docker compose version
If you have the older standalone docker-compose, use docker-compose wherever this guide says docker compose.
Step 3: Download the freqtrade compose file
mkdir ft_userdata
cd ft_userdata/
curl https://raw.githubusercontent.com/freqtrade/freqtrade/stable/docker-compose.yml -o docker-compose.yml
docker compose pull
Every command from here on is run inside the ft_userdata folder.
Step 4: Create the user folder and a config
docker compose run --rm freqtrade create-userdir --userdir user_data
docker compose run --rm freqtrade new-config --config user_data/config.json
The second command asks a few questions. Sensible answers for a first setup:
| Question | Suggested answer |
|---|---|
| Dry-run | Yes |
| Stake currency | USDT |
| Stake amount | A fixed amount, or unlimited to split your balance |
| Max open trades | 3–5 |
| Timeframe | Match your strategy (e.g. 5m or 1h) |
| Exchange | The exchange you will use, e.g. bybit |
| Telegram | Optional; see our Telegram guide |
| FreqUI / API server | Yes, if you want the web dashboard |
In dry-run mode you can leave the exchange API key empty. The bot uses live prices with a simulated wallet.
Step 5: Add a strategy
Copy a strategy file into user_data/strategies/. For example, to use AverageStrategy from the community repository:
curl -o user_data/strategies/AverageStrategy.py \
https://raw.githubusercontent.com/freqtrade/freqtrade-strategies/main/user_data/strategies/berlinguyinca/AverageStrategy.py
Then open docker-compose.yml and change --strategy SampleStrategy in the command section to your strategy's class name, e.g. --strategy AverageStrategy.
Step 6: Backtest before you start
Download data and run a quick backtest so you know what to expect:
docker compose run --rm freqtrade download-data --exchange binance \
--pairs BTC/USDT ETH/USDT --timeframes 4h --timerange 20240101-
docker compose run --rm freqtrade backtesting --config user_data/config.json \
--strategy AverageStrategy --timerange 20240101-
Our backtesting tutorial explains how to read the results.
Step 7: Start the bot
docker compose up -d
Use docker compose up -d for trading, not docker compose run. It starts the container properly and restarts it after a reboot.
Check it is running and read the logs:
docker compose ps
docker compose logs -f
Logs are also written to user_data/logs/freqtrade.log, and trades are stored in user_data/tradesv3.sqlite.
Step 8: Open FreqUI safely
If you enabled the API server, FreqUI is at http://localhost:8080 on the machine running the bot. On a VPS, do not expose port 8080 to the internet: FreqUI has no HTTPS by default. Connect through an SSH tunnel instead:
ssh -L 8080:localhost:8080 user@your-server-ip
Then open http://localhost:8080 on your own computer.
Updating freqtrade
docker compose pull
docker compose up -d
Read the release notes first, since updates can include breaking changes.
Troubleshooting
permission denied when running docker. Add your user to the docker group (sudo usermod -aG docker $USER) and log in again, or prefix commands with sudo.
Strategy not found. The class name in --strategy must match the class inside the file exactly, and the file must be in user_data/strategies/.
Timestamp or recvWindow errors. Your clock is out of sync. Enable NTP (sudo timedatectl set-ntp true).
Bot starts, then stops. Run docker compose logs -f and read the last error. Config syntax errors are the most common cause.
Next steps
- Connect your bot to Bybit
- Control the bot from Telegram
- Compare tested strategies before choosing one
Ready to connect an exchange?
Freqtrade needs an exchange account with API access. Bybit supports both spot and futures in freqtrade and offers a demo mode for testing.
Affiliate link: we may earn a commission if you sign up, at no cost to you.
Related guides
- How to connect freqtrade to Bybit (API keys, spot and futures)Create a Bybit sub-account and API key for freqtrade, set the right permissions, configure spot or futures trading and test safely with demo mode.3 min read
- Freqtrade backtesting tutorial: run, read and trust your resultsHow to download data, run freqtrade backtesting, read every important metric and avoid the mistakes that make backtests look better than reality.4 min read
- Freqtrade hyperopt guide: optimise a strategy without over-fitting itHow freqtrade hyperopt works, which spaces and loss functions to use, how to apply the results, and how to check that the optimised strategy still works on new data.3 min read