Deploy 12 independent Freqtrade trading bots to Google Cloud Platform with a unified dashboard and monitoring system.
This project provides a complete solution for deploying multiple Freqtrade cryptocurrency trading bots on Google Cloud Platform (GCP). It includes:
- 12 Independent Trading Bots: Each bot runs in its own container with isolated configuration
- Unified Multi-Bot Dashboard: Real-time monitoring of all bots with portfolio analytics
- FreqUI Interface: Official Freqtrade web interface for detailed bot management
- Automated Deployment: Single-command deployment and management scripts
- Health Monitoring: Built-in health checks and logging
- Security: Proper network isolation and firewall rules
- Multi-Bot Dashboard: http://35.185.177.130:5000 - Custom dashboard showing all bots
- FreqUI Interface: http://35.185.177.130:3000 - Official Freqtrade interface
┌─────────────────────────────────────────────────────────────┐
│ GCP VM Instance │
│ (freqtrade-cluster) │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Bot 01 │ │ Bot 02 │ │ ... │ │
│ │ Port: 8080 │ │ Port: 8081 │ │ Bot 12: 8091│ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ FreqUI │ │ Dashboard │ │ Monitoring │ │
│ │ Port: 3000 │ │ Port: 5000 │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
freqtrade-gcp-deployment/
├── configs/ # Bot-specific configurations
│ ├── config-bot-01.json # Individual bot configs
│ └── ...
├── dashboard/ # Multi-bot dashboard
│ ├── app/dashboard.py # Flask backend
│ ├── templates/ # HTML templates
│ └── Dockerfile
├── docker/ # Docker configurations
│ ├── docker-compose-with-ui.yml # Main compose file
│ └── strategies/ # Trading strategies
├── scripts/ # Management scripts
│ ├── manage_cluster.sh # Main management script
│ ├── health_check_cluster.sh # Health monitoring
│ └── deploy_dashboard.sh # Dashboard deployment
└── CLAUDE.md # Claude Code instructions
- Google Cloud Platform account
gcloud
CLI installed and configured- Docker (for local development)
export PROJECT_ID="your-project-id"
export ZONE="asia-southeast1-a"
export REGION="asia-southeast1"
# Clone the repository
git clone https://github.com/myownipgit/freqtrade-gcp-deployment.git
cd freqtrade-gcp-deployment
# Enable required GCP APIs
gcloud services enable compute.googleapis.com
gcloud services enable container.googleapis.com
gcloud services enable storage.googleapis.com
# Create network infrastructure
gcloud compute networks create freqtrade-network --subnet-mode custom
gcloud compute networks subnets create freqtrade-subnet \
--network freqtrade-network \
--range 10.0.0.0/24 \
--region $REGION
# Create firewall rules
gcloud compute firewall-rules create freqtrade-api-access \
--network freqtrade-network \
--allow tcp:8080-8091,tcp:3000,tcp:5000,tcp:22 \
--source-ranges 0.0.0.0/0
# Create VM instance with startup script
gcloud compute instances create freqtrade-cluster \
--zone=$ZONE \
--machine-type=e2-standard-4 \
--network-interface=network-tier=PREMIUM,subnet=freqtrade-subnet \
--tags=freqtrade-cluster \
--image-family=ubuntu-2004-lts \
--image-project=ubuntu-os-cloud \
--boot-disk-size=50GB \
--metadata-from-file startup-script=scripts/startup-script-multibot.sh
# Check cluster status
./scripts/manage_cluster.sh status
# Run health check
./scripts/health_check_cluster.sh
# View logs
./scripts/manage_cluster.sh logs all
# Start/stop entire cluster
./scripts/manage_cluster.sh start
./scripts/manage_cluster.sh stop
./scripts/manage_cluster.sh restart
# Check status
./scripts/manage_cluster.sh status
# SSH into cluster
./scripts/manage_cluster.sh ssh
# Start/stop specific bot
./scripts/manage_cluster.sh start-bot 01
./scripts/manage_cluster.sh stop-bot 01
./scripts/manage_cluster.sh restart-bot 01
# View bot logs
./scripts/manage_cluster.sh logs 01
# Restart dashboard
./scripts/manage_cluster.sh dashboard-restart
# View dashboard logs
./scripts/manage_cluster.sh dashboard-logs
./scripts/health_check_cluster.sh
This will check:
- ✅ VM instance status
- ✅ All 12 bot API endpoints
- ✅ FreqUI dashboard
- ✅ Multi-bot dashboard
- ✅ Container health
The multi-bot dashboard provides:
- Real-time bot status monitoring
- Portfolio-wide profit/loss tracking
- Trade count and open positions
- Individual bot performance metrics
- Auto-refresh every 10 seconds
Each bot has its own configuration file in configs/config-bot-XX.json
:
{
"max_open_trades": 3,
"stake_currency": "USDT",
"stake_amount": 100,
"dry_run": true,
"exchange": {
"name": "binance",
"key": "",
"secret": ""
},
"api_server": {
"enabled": true,
"listen_port": 8080,
"username": "freqtrader",
"password": "botXXpass"
}
}
To connect to real exchanges:
- Edit bot configuration files
- Add API keys and secrets
- Set
"dry_run": false
- Restart affected bots
-
Dashboard showing error bots
- Check API authentication in bot configs
- Verify containers are running:
docker-compose ps
- Check firewall rules
-
Bots not responding
- Check container logs:
./scripts/manage_cluster.sh logs XX
- Restart specific bot:
./scripts/manage_cluster.sh restart-bot XX
- Check container logs:
-
FreqUI connection issues
- Verify bot API server settings
- Check network connectivity
- Restart FreqUI:
./scripts/manage_cluster.sh ui-restart
# View all logs
./scripts/manage_cluster.sh logs all
# View specific bot
./scripts/manage_cluster.sh logs 01
# View dashboard logs
./scripts/manage_cluster.sh logs dashboard
# View FreqUI logs
./scripts/manage_cluster.sh logs ui
- Compute: ~$120/month (e2-standard-4)
- Storage: ~$10/month (50GB persistent disk)
- Network: ~$5/month (egress traffic)
- Total: ~$135/month
- Custom VPC network with isolated subnet
- Firewall rules restricting access to necessary ports
- Individual bot authentication
- Container isolation
- No root SSH access by default
The project includes automated backup scripts:
# Backup all configurations and data
./scripts/backup_restore.sh backup
# Restore from backup
./scripts/backup_restore.sh restore <timestamp>
This project is designed to work seamlessly with Claude Code. See CLAUDE.md for detailed instructions on:
- Project structure and conventions
- Common development commands
- Deployment procedures
- Troubleshooting guides
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Freqtrade - The awesome trading bot framework
- FreqUI - Official Freqtrade web interface
- Google Cloud Platform for reliable infrastructure
For issues and questions:
- Check the troubleshooting section
- Review the logs using provided scripts
- Open an issue on GitHub
- Check Freqtrade documentation: https://www.freqtrade.io/