Raspberry Pi

OpenAlgo on Raspberry Pi — Setup Guide

This guide helps you install and configure OpenAlgo on Raspberry Pi models 3, 4, or 5 (4GB+ RAM), preferably running Ubuntu 24.04+ server edition.

Hardware & OS Recommendations

  • Raspberry Pi Model: 3, 4, or 5 (minimum 4GB RAM)

  • SD Card: Recommended 128GB; minimum 64GB

  • Operating System: Ubuntu 24.04+ Server edition (preferred)

  • RPi official power adapter: Recommended to buy for stable power supply and avoid RPi abrupt shutdowns and restarts. Get Ubuntu images for Raspberry Piarrow-up-right

Initial System Preparation

1. Flash OS to SD Card

2. First Boot & Access

3. Setup Swap

  • Recommend swap size: max 4GB, min 2GB

OpenAlgo Installation

Option 1: Using Official Install Script

1. Install Docker (Ubuntu/ARM)

Docker Ubuntu install guidearrow-up-right

2. Install Docker Buildx for ARM

docker buildx version

If not present, follow: https://docs.docker.com/buildx/working-with-buildx/#install-buildx

3. Get nginx Docker Image (reverse proxy)

docker pull nginx:latest

4. Clone the OpenAlgo Repo

5. Build OpenAlgo Docker Image

docker build -t openalgo:latest .

6. Configure Environment

  • Copy .sample.env as .env and fill in broker API key, secret, and client ID

7. Use docker-compose.yaml

  • Edit/verify docker-compose.yaml inside /openalgo

  • If you have build the docker image in previous step, you can comment the build and its nested tags (using #) in docker-compose.yaml file.

  • Launch services:

8. Configure Nginx Reverse Proxy

I prefer to separate out the runtime files and folders from the github cloned folder and keep them separate. So if you build the docker image as in above step #5, you can very well take the docker-compose.yaml in a separate working folder structure and have your own versions of .env file.

  • Create and mount volumes under /work for logs, keys, strategies, etc.

  • Update docker-compose.yaml examplearrow-up-right:

Securing your setup

A. Basic Server Protection (iptables, fail2ban)

1. Install iptables

2. Install fail2ban

B. Using Cloudflare for Reverse Proxy & Security


Useful References

OpenAlgo is now ready on your Raspberry Pi! Start building and deploying your trading strategies.

Last updated

Was this helpful?