Skip to content

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

    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 dependencies
    RUN apt-get update && apt-get install -y \
    build-essential \
    git \
    curl \
    && rm -rf /var/lib/apt/lists/*
    # Clone OctoBot
    WORKDIR /octobot
    RUN git clone https://github.com/Drakkar-Software/OctoBot.git .
    # Install Python dependencies
    RUN pip install --no-cache-dir -r requirements.txt
    # Install OctoBot
    RUN pip install --no-cache-dir .
    # Install tentacles
    RUN python start.py tentacles --install --all
    # Set environment
    ENV OCTOBOT_CONFIG_PATH=/config
    ENV 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:

    • Select HTTP as the traffic type
    • Set the internal port to 5001

    Set Environment Variables

    Configure the following environment variables:

    VariableValue
    OCTOBOT_CONFIG_PATH/config

    Exchange API keys (configure through web interface is safer):

    VariableValue
    EXCHANGE_API_KEYYour exchange API key
    EXCHANGE_SECRETYour exchange secret

    Attach Persistent Volumes

    Add persistent storage:

    Mount PathRecommended SizePurpose
    /config5 GBConfiguration and user data
    /octobot/logs5 GBTrading logs
    /octobot/backtesting10 GBHistorical 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:

  1. Access the web interface
  2. Create your user account
  3. Set a strong password
  4. Configure basic settings

Exchange Configuration

Connect your exchanges:

  1. Navigate to Exchanges section
  2. Select your exchange
  3. Enter API key and secret
  4. Set API permissions appropriately
  5. Test the connection

Strategy Selection

Choose trading strategies:

  1. Go to Trading section
  2. Select Trading Mode
  3. Choose evaluators
  4. Configure strategy parameters
  5. Set risk management rules

Trading Modes

Paper Trading

Practice without risk:

  1. Enable Simulated trading
  2. Configure virtual balance
  3. Run strategies in simulation
  4. Analyze results

Backtesting

Test against historical data:

  1. Download historical data
  2. Select strategy to test
  3. Configure test parameters
  4. Run backtest
  5. Analyze performance metrics

Live Trading

Trade with real funds:

  1. Verify strategy in paper mode first
  2. Fund your exchange account
  3. Configure trade amounts
  4. Enable live trading
  5. 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:

  1. Configure evaluator weights
  2. Set confirmation requirements
  3. Define entry/exit conditions
  4. Configure timeframes

Risk Management

Protect your capital:

  1. Set maximum position sizes
  2. Configure stop-loss orders
  3. Define take-profit levels
  4. 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.