This guide explains the different ways to set up and run the platform, including the demo UI.
# Install dependencies and run demo
pip install flask
python -m freqtrade.ui.demo_server
# Open http://127.0.0.1:5000# Create and activate virtual environment
python3 -m venv .venv
source .venv/bin/activate # Linux/Mac
# or
.venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements-dev.txt
# Run demo
python -m freqtrade.ui.demo_server# Build and run with Docker
docker-compose up -dFor the Demo UI: ❌ Not required (but recommended)
- The demo UI only needs Flask
- Can install directly:
pip install flask - Run with:
python -m freqtrade.ui.demo_server
For Development: ✅ Recommended
- Isolates dependencies from system Python
- Prevents conflicts with other projects
- Easy to reset if something goes wrong
For Production Trading: ✅✅ Strongly Recommended
- Use Docker (even better isolation)
- Or use virtual environment for clean dependency management
| Method | When to Use | Pros | Cons |
|---|---|---|---|
| Direct Install | Quick demo | Fastest setup | May conflict with system packages |
| Virtual Environment | Development | Clean, isolated, easy to manage | Need to activate each session |
| Docker | Production, isolation | Complete isolation, reproducible | Larger footprint, slower startup |
| Automated Setup Script | First time setup | Handles everything | Interactive prompts |
# Install just Flask
pip install flask
# Run the demo
python -m freqtrade.ui.demo_server
# Open browser
# http://127.0.0.1:5000# Install all dependencies
pip install -r requirements.txt
# For development (includes testing tools)
pip install -r requirements-dev.txt
# Run demo
python -m freqtrade.ui.demo_serverPros:
- ✅ Fastest to get started
- ✅ No extra setup needed
- ✅ Perfect for trying the demo
Cons:
- ❌ May conflict with system Python packages
- ❌ Harder to clean up
- ❌ Not recommended for production
Linux/Mac:
# Create virtual environment
python3 -m venv .venv
# Activate it
source .venv/bin/activate
# You'll see (.venv) in your promptWindows:
# Create virtual environment
python -m venv .venv
# Activate it
.venv\Scripts\activate
# You'll see (.venv) in your prompt# For demo UI only
pip install flask
# For full development
pip install -r requirements-dev.txt
# Or for just the core platform
pip install -r requirements.txt# Method 1: Use the startup script
./start_demo.sh # Linux/Mac
./start_demo.ps1 # Windows
# Method 2: Run directly
python -m freqtrade.ui.demo_server
# Open browser to http://127.0.0.1:5000# When you're done
deactivatePros:
- ✅ Clean dependency isolation
- ✅ Easy to reset (just delete .venv and recreate)
- ✅ No conflicts with system packages
- ✅ Industry best practice
Cons:
⚠️ Must activate each time you open a new terminal⚠️ Slightly more setup than direct install
The repository includes setup scripts that handle everything automatically.
# Run the setup script
./setup.sh
# Follow the prompts:
# - Creates .venv automatically
# - Installs dependencies
# - Sets up the platform
# After setup, activate the environment
source .venv/bin/activate
# Run the demo
python -m freqtrade.ui.demo_server# Run the setup script
./setup.ps1
# Follow the prompts
# Then activate and run demoWhat the script does:
- Checks for Python 3.11+
- Creates
.venvdirectory - Installs pip/wheel/setuptools
- Asks what dependencies you want
- Installs everything automatically
Pros:
- ✅ Handles everything automatically
- ✅ Creates virtual environment for you
- ✅ Checks for proper Python version
- ✅ Installs only what you need
Cons:
⚠️ Interactive prompts (can't fully automate)⚠️ May install more than needed for just demo
# Start the platform
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the platform
docker-compose down# Build the image
docker build -t freqtrade .
# Run the container
docker run -d --name freqtrade freqtrade
# For the demo UI (not in standard Docker setup)
# You'll need to expose port 5000 and install Flask
docker run -p 5000:5000 -it freqtrade bash
pip install flask
python -m freqtrade.ui.demo_server --host 0.0.0.0Pros:
- ✅ Complete isolation from host system
- ✅ Reproducible environment
- ✅ Easy to deploy to servers
- ✅ All dependencies containerized
Cons:
- ❌ Larger footprint (~1GB+)
- ❌ Slower startup
- ❌ Demo UI requires custom setup
- ❌ More complex to customize
After setup using any method above:
# If you have a virtual environment, activate it first
source .venv/bin/activate # Linux/Mac
.venv\Scripts\activate # Windows
# Method 1: Use the startup script
./start_demo.sh # Linux/Mac (checks dependencies)
./start_demo.ps1 # Windows (checks dependencies)
# Method 2: Run directly
python -m freqtrade.ui.demo_server
# Open browser
# http://127.0.0.1:5000# Test the API
curl http://127.0.0.1:5000/api/state
# Should return JSON with capital, trades, etc.pip install flask
python -m freqtrade.ui.demo_serverNo virtual environment needed. Quickest way to see the demo.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
python -m freqtrade.ui.demo_serverUse virtual environment to keep things clean.
source .venv/bin/activate # If using venv
pip install -r requirements-dev.txt
python -m pytest tests/ui/test_demo_e2e.py -v# Use Docker
docker-compose up -d
# Or use virtual environment with strict dependency pinning
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt# Solution: Install Flask
pip install flask
# Or install all dev dependencies
pip install -r requirements-dev.txt# Try just 'python'
python --version
# If version is 3.11+, use 'python' instead of 'python3'# Make sure to use 'source'
source .venv/bin/activate
# Not just:
.venv/bin/activate # This won't work# You may need to allow script execution
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Then activate
.venv\Scripts\activate# Find what's using port 5000
lsof -i :5000 # Linux/Mac
netstat -ano | findstr :5000 # Windows
# Either stop that process or edit demo_server.py to use different portDo you just want to see the demo?
→ Direct install: pip install flask && python -m freqtrade.ui.demo_server
Are you developing or contributing?
→ Virtual environment: Create .venv, activate, install deps
Are you deploying to production?
→ Docker: Use docker-compose up -d
First time setting up everything?
→ Automated script: ./setup.sh (creates venv for you)
Minimal (Demo UI only):
- Flask 3.1.0
Full Development:
- All core dependencies (pandas, numpy, SQLAlchemy, etc.)
- Testing tools (pytest, etc.)
- Development tools (ruff, mypy, etc.)
- Flask for demo UI
Complete Platform:
- Core dependencies
- Optional: hyperopt, plotting, freqai
- Exchange connectors (ccxt)
- All utilities
After setup, see:
- DEMO_UI_QUICKSTART.md - Quick reference for demo
- freqtrade/ui/README.md - Complete demo documentation
- README.md - Platform overview
Happy trading! 🚀