Deploying OctoBot
Introduction
OctoBot is an open-source cryptocurrency trading bot designed to automate trading strategies across multiple exchanges. It provides a flexible framework for implementing and testing trading strategies, with support for technical analysis, AI-based trading, and custom strategy development.
Built with Python, OctoBot offers both a web interface and command-line tools for managing your trading operations. The modular architecture allows you to customize every aspect of your trading setup, from strategy selection to risk management.
Key highlights of OctoBot:
- Multi-Exchange Support: Trade on Binance, Coinbase, Kraken, and more
- Strategy Framework: Pre-built and custom trading strategies
- Backtesting: Test strategies against historical data
- Paper Trading: Simulate trades without risking real money
- Technical Analysis: Built-in indicators and analysis tools
- Web Interface: Monitor and manage trades through a dashboard
- Telegram Integration: Control and monitor via Telegram
- Community Strategies: Access community-developed strategies
- API Access: RESTful API for custom integrations
- Open Source: GPL-3.0 license with active development
This guide walks through deploying OctoBot on Klutch.sh using Docker.
Why Deploy OctoBot on Klutch.sh
Deploying OctoBot on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh handles the Python deployment automatically.
Persistent Storage: Attach persistent volumes for trading data and configurations.
HTTPS by Default: Automatic SSL certificates for secure web access.
Always-On Trading: 24/7 availability for continuous market monitoring.
GitHub Integration: Version-controlled deployments through your repository.
Scalable Resources: Allocate CPU and memory based on your trading needs.
Environment Variable Management: Securely store API keys and credentials.
Custom Domains: Use your own domain for your trading dashboard.
Prerequisites
Before deploying OctoBot on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your configuration
- Exchange API keys (with appropriate permissions)
- Understanding of cryptocurrency trading risks
- (Optional) A custom domain for your OctoBot instance
Understanding OctoBot Architecture
OctoBot consists of several components:
Core Engine: Python-based trading engine managing all operations.
Strategy Evaluators: Modules that analyze market data and generate signals.
Trading Modes: Define how trades are executed based on signals.
Exchange Connectors: API integrations with various cryptocurrency exchanges.
Web Interface: Flask-based dashboard for monitoring and configuration.
Tentacles: Modular extensions for strategies, evaluators, and integrations.
Deploying OctoBot on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 5001
Create Your GitHub Repository
Create a new GitHub repository for your OctoBot deployment configuration.
Create the Dockerfile
Create a Dockerfile in your repository root:
FROM python:3.10-slim
# Install dependenciesRUN apt-get update && apt-get install -y \ build-essential \ git \ curl \ && rm -rf /var/lib/apt/lists/*
# Clone OctoBotWORKDIR /octobotRUN git clone https://github.com/Drakkar-Software/OctoBot.git .
# Install Python dependenciesRUN pip install --no-cache-dir -r requirements.txt
# Install OctoBotRUN pip install --no-cache-dir .
# Install tentaclesRUN python start.py tentacles --install --all
# Set environmentENV OCTOBOT_CONFIG_PATH=/configENV PYTHONUNBUFFERED=1
EXPOSE 5001
CMD ["python", "start.py"]Create a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project.
Create a New App
Within your project, create a new app and connect your GitHub repository.
Configure HTTP Traffic
In the deployment settings:
Set Environment Variables
Configure the following environment variables:
| Variable | Value |
|---|---|
OCTOBOT_CONFIG_PATH | /config |
Exchange API keys (configure through web interface is safer):
| Variable | Value |
|---|---|
EXCHANGE_API_KEY | Your exchange API key |
EXCHANGE_SECRET | Your exchange secret |
Attach Persistent Volumes
Add persistent storage:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/config | 5 GB | Configuration and user data |
/octobot/logs | 5 GB | Trading logs |
/octobot/backtesting | 10 GB | Historical data for backtesting |
Deploy Your Application
Click Deploy to start the build process.
Access OctoBot Dashboard
Once deployed, access the web interface at https://your-app.klutch.sh to complete configuration.
Initial Configuration
First-Time Setup
Complete initial configuration:
- Access the web interface
- Create your user account
- Set a strong password
- Configure basic settings
Exchange Configuration
Connect your exchanges:
- Navigate to Exchanges section
- Select your exchange
- Enter API key and secret
- Set API permissions appropriately
- Test the connection
Strategy Selection
Choose trading strategies:
- Go to Trading section
- Select Trading Mode
- Choose evaluators
- Configure strategy parameters
- Set risk management rules
Trading Modes
Paper Trading
Practice without risk:
- Enable Simulated trading
- Configure virtual balance
- Run strategies in simulation
- Analyze results
Backtesting
Test against historical data:
- Download historical data
- Select strategy to test
- Configure test parameters
- Run backtest
- Analyze performance metrics
Live Trading
Trade with real funds:
- Verify strategy in paper mode first
- Fund your exchange account
- Configure trade amounts
- Enable live trading
- Monitor closely
Strategy Configuration
Technical Analysis
Configure indicators:
- Moving Averages
- RSI (Relative Strength Index)
- MACD
- Bollinger Bands
- Custom indicators
Signal Evaluation
Set up signal processing:
- Configure evaluator weights
- Set confirmation requirements
- Define entry/exit conditions
- Configure timeframes
Risk Management
Protect your capital:
- Set maximum position sizes
- Configure stop-loss orders
- Define take-profit levels
- Set daily loss limits
Production Best Practices
Security Recommendations
- Use API keys with minimal permissions
- Never share API secrets
- Enable 2FA on exchanges
- Restrict IP access for API keys
- Regular security audits
Trading Safety
- Start with paper trading
- Test strategies thoroughly
- Start with small amounts
- Monitor regularly
- Have emergency stop procedures
Performance Monitoring
- Track all trades
- Analyze strategy performance
- Review logs regularly
- Adjust strategies based on results
Troubleshooting Common Issues
Exchange Connection Issues
- Verify API key permissions
- Check API key hasn’t expired
- Confirm IP whitelisting if enabled
- Review exchange status
Strategy Not Trading
- Verify market conditions match strategy
- Check evaluator configurations
- Review trading mode settings
- Check balance and limits
Slow Performance
- Reduce active trading pairs
- Optimize evaluation frequency
- Check server resources
- Review log file sizes
Important Disclaimer
Cryptocurrency trading involves significant risk:
- Past performance doesn’t guarantee future results
- Automated trading can result in losses
- Market conditions can change rapidly
- Only trade what you can afford to lose
- This is not financial advice
Additional Resources
Conclusion
Deploying OctoBot on Klutch.sh provides an always-on automated trading solution with full control over your strategies and data. With support for multiple exchanges, extensive customization options, and built-in backtesting, OctoBot offers a comprehensive platform for cryptocurrency trading automation. Always remember to trade responsibly and never risk more than you can afford to lose.