2.9 KiB
2.9 KiB
Deployment Guide
This guide covers deploying Crypto Trader in various environments.
Table of Contents
- AppImage Deployment - Building and distributing AppImage
- Bluefin Linux - Bluefin Linux specific instructions
- PostgreSQL Setup - PostgreSQL configuration
- Updates - Update mechanism and versioning
Deployment Options
AppImage (Recommended)
- Single executable file
- No installation required
- Portable across Linux distributions
- Includes all dependencies
From Source
- Full control over installation
- Customizable configuration
- Development and production use
System Requirements
- OS: Linux (Bluefin recommended), macOS, Windows
- Python: 3.11+ (for source installation)
- Node.js: 18+ (for frontend)
- Memory: 4GB minimum, 8GB recommended
- Storage: 1GB+ for application and data
- Network: Internet connection required
- Redis: Version 5.0+ (for state management)
- PostgreSQL: Version 14+ (for database)
Quick Deployment
AppImage
- Download AppImage
- Make executable:
chmod +x crypto_trader-*.AppImage - Run:
./crypto_trader-*.AppImage
From Source
- Clone repository
- Install dependencies:
pip install -r requirements.txt - Install frontend dependencies:
cd frontend && npm install - Start Redis (see Redis section below for options)
- Start Celery worker:
celery -A src.worker.app worker --loglevel=info & - Start backend:
uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000 & - Start frontend:
cd frontend && npm run dev
Or use the helper script:
./scripts/start_all.sh
Required Services
Redis
Redis is required for distributed state management and Celery background tasks (e.g., ML model training).
# Install (Ubuntu/Debian)
sudo apt-get install redis-server
Starting Redis:
# Option 1: Using system service (requires sudo)
sudo service redis-server start
# Option 2: Direct daemon mode (for containers/restricted environments)
redis-server --daemonize yes
# Verify
redis-cli ping # Should return PONG
Note
: In containerized environments (Toolbox, Distrobox, etc.) where
sudois not available, use the direct daemon mode option.
Celery Worker
Celery handles background tasks like ML training:
# Start worker
celery -A src.worker.app worker --loglevel=info
# Start with specific queues
celery -A src.worker.app worker -Q ml_training,celery --loglevel=info
Post-Deployment
After deployment:
- Configure exchanges
- Set up risk management
- Verify Redis connection:
python scripts/verify_redis.py - Test with paper trading
- Review configuration
- Start with small positions
Production Considerations
- Use a process manager (systemd, supervisor) for services
- Configure Redis persistence (AOF or RDB)
- Set up monitoring and alerting
- Enable HTTPS for the API
- Configure proper firewall rules