Quick Start & Installation
Relevant source files
The following files were used as context for generating this wiki page:
OpenAlgo is a self-hosted algorithmic trading platform that integrates multiple trading surfaces—including a Unified Broker API, Python Strategy Host, and a No-Code Flow Builder—into a single instance. It is designed to normalize interactions across over 34 different broker plugins, allowing traders to execute strategies using a consistent interface while maintaining control over their own market data infrastructure and operational data stores.
Sources: README.md:12-23, CLAUDE.md:10-18
The installation process is tailored for various environments, ranging from local desktop setups using uv or Docker Desktop to production-grade deployments on Ubuntu/Debian servers. Every installation automatically handles security essentials, such as generating unique application keys and configuring isolated data environments for live and sandbox trading.
Sources: CLAUDE.md:28-35, install/README.md:65-75
System Prerequisites
OpenAlgo requires a modern environment to handle its multi-process architecture, which includes the Flask backend, React frontend, and a ZeroMQ-based market data bus.
Hardware and OS Requirements
| Component | Minimum Requirement | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 2GB (or 0.5GB + 2GB Swap) | 2GB+ |
| Disk | 1GB | 20GB SSD |
| Python | 3.12+ | 3.12+ |
| Node.js | 20.20+ (Frontend dev only) | 22.22+ |
Sources: README.md:267-272, install/README.md:8-13, install/Docker-install-readme.md:468-475
Distribution Support
OpenAlgo is verified on several Linux distributions:
- Debian-based: Ubuntu (22.04+ LTS), Debian, Linux Mint.
- RHEL-based: CentOS, RHEL, Fedora, Rocky Linux.
- Arch-based: Arch Linux, Manjaro.
Sources: install/README.md:8-13
Installation Architectures
OpenAlgo supports three primary deployment models. The following diagram illustrates the standard production request flow through the system layers.
1. Local Development (using uv)
The recommended way to run OpenAlgo locally is via the uv package manager. This ensures a consistent environment without global dependency conflicts.
# Clone the repository
git clone --filter=blob:none https://github.com/marketcalls/openalgo.git
cd openalgo
# Install dependencies and run
pip install uv
cp .sample.env .env
uv run app.py
Sources: README.md:276-289, CLAUDE.md:213-216
2. Docker Installation
Docker is the preferred method for isolated personal trading or desktop use.
- Windows: Run
docker-run.bat. - macOS/Linux: Run
docker-run.sh.
The scripts handle image pulling, secure key generation (APP_KEYandAPI_KEY_PEPPER), and volume mapping for databases and logs.
Sources: install/Docker-install-readme.md:15-30, CLAUDE.md:32-35
3. Production Server Deployment
For cloud servers (e.g., Ubuntu 22.04), the install.sh script automates the full stack setup, including:
- Nginx Configuration: With SSL (Certbot/Let's Encrypt) and WebSocket support.
- Firewall Management: UFW or Firewalld configuration.
- Multi-Instance Support: The script allows multiple deployments on a single server, each with a unique
ZMQ_PORTto avoid port contention.
Sources: install/README.md:65-80, CLAUDE.md:139-142
Initial Configuration
After installation, users must configure the .env file and initialize the system.
Environment Variables
Key variables in the .env file include:
VALID_BROKERS: A comma-separated list of enabled broker plugins.APP_KEY: Used for encrypting session cookies.API_KEY_PEPPER: Used for hashing API keys.ZMQ_PORT: Port for the internal market data bus (default: 5555).
Sources: CLAUDE.md:32-35, CLAUDE.md:139-145, INSTALL.md:29-31
Broker Authentication
Indian broker tokens typically expire daily at ~3:00 AM IST. OpenAlgo handles session resumption via _try_resume_broker_session to maintain connectivity across multiple devices sharing the same broker feed.
Sources: CLAUDE.md:46-48, CLAUDE.md:155-159
Verification and Diagnostics
The system provides several ways to verify a successful installation:
- Action Center: Access
/setupimmediately after installation to create the admin account. - Diagnostics Page: The UI provides a
/admin/diagnosticspage that reports system info, hardware stats, and database health. - Connectivity Probes: The system can run on-demand TCP probes to check database and broker reachability.
Sources: frontend/src/pages/admin/Diagnostics.tsx:142-160, frontend/src/pages/admin/Diagnostics.tsx:322-350, INSTALL.md:60-63
Maintenance Commands
For Docker-based installations, the following management interface is provided:
| Command | Action |
|---|---|
openalgo-status | View container and health status |
openalgo-logs | Stream live application logs |
openalgo-restart | Pull latest image and restart with auto-migrations |
openalgo-backup | Creates a tarball of DB, config, and strategies |
Sources: install/Docker-install-readme.md:143-162, install/Docker-install-readme.md:387-392
Summary
OpenAlgo's installation is designed to be highly automated while providing deep architectural isolation between different instances and trading modes. By leveraging modern tools like uv and Docker, it ensures that traders can move from a clean server to a fully functional, SSL-secured trading environment in minutes.
Sources: README.md:12-23, install/README.md:65-75, install/Docker-install-readme.md:175-180