Guides 13 min read ·
How to Install OpenAlgo on a VPS with Your Own Domain and SSL
Install OpenAlgo on an Ubuntu VPS with your own domain and free SSL: DNS, broker redirect URL, static IP registration, the official script, security, updates.
To install OpenAlgo on a VPS with your own domain and SSL, you point a domain or subdomain at the server, create your broker's API app with OpenAlgo's callback URL, register the server's IP with the broker and run one script. OpenAlgo's official install.sh sets up Nginx, a free Let's Encrypt certificate, the firewall and a systemd service on Ubuntu in a single run. It asks only for the domain, the broker and the broker's API key and secret. This guide follows the official docs as they stood in October 2026.
What OpenAlgo is, and who it suits
OpenAlgo is a free, open-source trading platform for Indian brokers that you host yourself. It is published on GitHub by Marketcalls, whose profile describes it as the creator of OpenAlgo. The code is released under the AGPL-3.0 licence, and the README promises that your data stays on your server.
At its core is one REST API that sits in front of your broker. TradingView alerts, ChartInk scans, Amibroker AFL code and your own Python scripts all send orders to OpenAlgo in the same format, and OpenAlgo translates them for the broker you've connected. As of October 2026 the docs list more than 30 broker plugins, including Zerodha, Dhan, Upstox, FYERS, Angel One and Kotak Neo. An Analyzer Mode lets you test with simulated orders.
The latest release when we checked was v2.0.2.9, published on 17 October 2026. New versions come out every week or two, so plan for updates.
OpenAlgo is built for one trader per installation. The docs say it has no multi-user model and that access to the server means full control of the broker session, so don't share the server.
Why your own static-IP server fits SEBI's rule
Since 1 April 2026, Indian brokers accept API orders only from a static IP address you have registered with them. Our static IP guide explains the rule, and our overview of SEBI's algo trading rules covers the wider framework.
OpenAlgo fits the rule well because it is the program that talks to your broker. Your signals can come from a TradingView alert or Amibroker on your home PC, but as OpenAlgo's static IP page puts it, the broker only sees your server's static IP. So the IP you register is the server's.
Keep two limits in mind:
- You can change the registered IP only once per calendar week, so settle on the server before you register its address.
- The IP is for you, or for family where your broker allows it. SEBI expects anyone who offers algos to others to be empanelled as an algo provider, so don't place orders for clients from a personal server.
Before you start: server, domain and broker checklist
The Ubuntu Server guide asks for Ubuntu Server 22.04 LTS or later, ideally a clean install, with 2 GB RAM (or 0.5 GB plus 2 GB of swap, which the installer creates), 1 GB of free disk and 1 vCPU. OpenAlgo needs Python 3.12 or newer, the version Ubuntu 24.04 ships. You also need a domain or subdomain you control, SSH access as root or a sudo user, and API access at your broker.
On HostEthical's Algo VPS (4 vCPUs, 8 GB RAM, Ubuntu 24.04), we read the installer script on 19 October 2026, looking for clashes with what the server ships with, and found none:
- The script builds its own Python environment at
/var/python/openalgo/.venvwith theuvpackage manager and leaves the bot environment at/opt/algo/venvalone. - Ubuntu 24.04 blocks system-wide
pipinstalls, so the script installsuvthrough snap or Astral's standalone installer instead. - If automatic updates are running, the script waits up to five minutes. If it gives up, run it again later.
We read the script rather than test-installing it, so keep an eye on the installer's log.
Step 1: point a domain or subdomain at the server
A subdomain such as algo.yourdomain.com is the simplest choice. For a root domain like yourdomain.com, the installer also requests a certificate for www.yourdomain.com, so you'd need a www record as well.
Create an A record that points the name at the server's IPv4 address. The official guide does this in Cloudflare. Here is its example, adapted for a subdomain:
Type: A
Name: algo
Content: YOUR_SERVER_IP
Proxy status: Proxied
In Cloudflare, also set the SSL/TLS encryption mode to Full (strict), as the docs require. With the proxy on, your server's IP stays out of public DNS. Orders never pass through Cloudflare: they go straight from the server to your broker.
The installer itself needs only that the name resolves to your server, so the A record can also live in our free DNS editor if your domain is with HostEthical (see our DNS records guide). One trade-off: in GitHub issue #2130 (September 2026), a user traced TradingView webhook timeouts to the Cloudflare proxy, and TradingView cancels a webhook after three seconds. If you see those errors, try a DNS-only record. Either way, wait until the record resolves before you run the installer.
Step 2: create the broker app and register the server's IP
In your broker's developer portal, create an API app. The redirect (callback) URL is your hostname, then the broker's code, then /callback:
https://algo.yourdomain.com/zerodha/callback
https://algo.yourdomain.com/angel/callback
The installer prints this URL after you choose your broker, so you can also create the app at that point. Some brokers need more than a key and a secret. OpenAlgo's Dhan page shows the key entered as your client ID and API key joined by :::, and XTS-based brokers also ask for a market-data key pair. Read OpenAlgo's page for your broker first.
Register the server's IPv4 address with your broker at the same time. FYERS, for example, asks for it in the same form as the redirect URL. On an Algo VPS, run algo-ip or copy the address from the "Register your static IP" card in your dashboard. The static IP guide shows where each broker keeps this setting. For broker-specific detail, see our Kite Connect and Dhan API guides.
Check which address OpenAlgo actually uses
The Algo VPS also has IPv6, and /etc/gai.conf makes it prefer IPv4 for outgoing connections, so ordinary Python bots connect from the IPv4 address you registered. OpenAlgo needs one extra step: it runs under Gunicorn's eventlet worker, and eventlet's own DNS resolver looks up IPv6 addresses first and ignores gai.conf. One OpenAlgo user hit an IPv6 whitelist mismatch on another provider's VPS in April 2026.
The fix is an eventlet setting, EVENTLET_NO_GREENDNS=yes, which makes it use the system resolver, and with it the IPv4 preference. The Algo VPS ships with this already, as a systemd drop-in that the openalgo service picks up once the installer creates it. On any other server, add it yourself after installing:
sudo mkdir -p /etc/systemd/system/openalgo.service.d
printf '[Service]\nEnvironment=EVENTLET_NO_GREENDNS=yes\n' | sudo tee /etc/systemd/system/openalgo.service.d/ipv4.conf
sudo systemctl daemon-reload && sudo systemctl restart openalgo
As a second safeguard, you can register the server's IPv6 address, which algo-ip also prints, as your secondary IP with a broker that accepts IPv6 (in October 2026, Zerodha, Dhan and Upstox did; Angel One took IPv4 only). Either way, check your first live order: a rejection that quotes an IPv6 address means requests are still leaving over IPv6.
Step 3: run the official installer
On an Algo VPS, give the first-boot setup a few minutes to finish. Then log in over SSH and run the commands from the official guide:
ssh root@your_server_ip
mkdir -p ~/openalgo-install
cd ~/openalgo-install
wget https://raw.githubusercontent.com/marketcalls/openalgo/main/install/install.sh
chmod +x install.sh
sudo ./install.sh
The script asks for your domain, your broker's code, the API key and secret, and then "Enable Remote MCP? (y/N)". Press Enter to leave Remote MCP off. It then installs Nginx, Certbot and the Python tools, clones OpenAlgo into /var/python/openalgo, creates the openalgo systemd service and requests the certificate. Its log goes to ~/openalgo-install/logs/.
Open ports 80 and 443
The Algo VPS comes with ufw allowing SSH only. The installer adds ufw allow ssh and ufw allow 'Nginx Full', which opens ports 80 and 443. Let's Encrypt needs port 80 to verify your domain and renew the certificate, and TradingView sends webhooks only to ports 80 and 443. Check the rules, and add them by hand if you installed some other way:
sudo ufw status
sudo ufw allow 'Nginx Full'
Don't open OpenAlgo's internal ports, such as 8765 or 5555: Nginx handles all outside traffic.
Check the install
sudo systemctl status openalgo
sudo nginx -t
sudo journalctl -fu openalgo
If the certificate step failed, usually because DNS hadn't updated yet, the docs suggest running sudo certbot --nginx -d yourdomain.com again.
Other official routes. The Docker + Custom Domain script installs to /opt/openalgo, with its own update steps:
wget https://raw.githubusercontent.com/marketcalls/openalgo/refs/heads/main/install/install-docker.sh && chmod +x install-docker.sh && ./install-docker.sh
The no-custom-domain guide is for a desktop or laptop, where OpenAlgo listens on 127.0.0.1:5000 and TradingView can't reach it.
Step 4: first login and broker connection
Open https://algo.yourdomain.com straight away and create your account. OpenAlgo's static IP page says the first person to register becomes the admin, so don't leave a fresh install unclaimed.
- Choose a strong, unique password, then turn on TOTP under Profile → My Profile → TOTP Authentication.
- Connect your broker from the dashboard, logging in on the broker's own page.
- Wait for the master contract (the broker's symbol list) to download before you automate anything.
- Generate your OpenAlgo API key under Profile → API Keys.
- Test in Analyzer Mode before you switch to live orders.
The docs say Indian broker tokens expire at about 3:00 AM IST and OpenAlgo forces a re-login then, so you sign in to your broker through OpenAlgo each trading day. For schedules and alerts around that, see our guide to running a trading bot 24/7.
Connect TradingView, ChartInk, Amibroker and Python
TradingView
In OpenAlgo, open Trading Platforms → TradingView, which generates the webhook URL and alert message. For a Pine Script strategy, the alert posts to /api/v1/placesmartorder. That endpoint compares the alert's position size with your open position, so a repeated alert doesn't stack duplicate orders:
{
"apikey": "your_api_key_here",
"strategy": "TradingView Strategy",
"symbol": "NHPC",
"exchange": "NSE",
"action": "{{strategy.order.action}}",
"product": "MIS",
"pricetype": "MARKET",
"quantity": "{{strategy.order.contracts}}",
"position_size": "{{strategy.position_size}}"
}
The message contains your API key, so treat it as a secret. TradingView sends webhooks only if your TradingView account has two-factor authentication turned on. Our TradingView webhook guide covers the rest.
ChartInk
Webhooks need a paid ChartInk account. In OpenAlgo, open Trading Platforms → Chartink, create a strategy, add its symbols (NSE and BSE only) and paste the strategy's webhook URL, https://your-openalgo-domain/chartink/webhook/<webhook-id>, into the ChartInk alert. The alert's name must contain BUY, SELL, SHORT or COVER.
Amibroker
Amibroker is Windows software, so it stays on your own PC: the Algo VPS runs Linux only. OpenAlgo's AFL modules post each order to OpenAlgo's REST API, with a Host setting that defaults to http://127.0.0.1:5000. Change it to https://algo.yourdomain.com and enter your API key. The order then goes to the broker from the server. For live charts, OpenAlgo's data plugin also connects to the server's WebSocket, so check the Amibroker page of the docs for the address to enter.
Python
The official SDK (version 2.0.5 on PyPI in October 2026, Python 3.12 or newer) uses the same API. On the Algo VPS, install it with /opt/algo/venv/bin/pip install openalgo, or use it from your own computer:
import os
from openalgo import api
client = api(api_key=os.environ["OPENALGO_API_KEY"], host="https://algo.yourdomain.com")
print(client.analyzerstatus()) # check whether Analyzer (test) mode is on
print(client.quotes(symbol="RELIANCE", exchange="NSE"))
Use your domain as the host even on the same server, because the native install serves OpenAlgo through Nginx, not on port 5000. Or upload the script to OpenAlgo's built-in Python strategy host, which runs it on an IST schedule.
Security: admin account, Remote MCP, firewall and backups
- Admin login. Use a unique password and TOTP. OpenAlgo's TOTP setup doesn't generate recovery codes, so store the setup secret safely.
- API key. The key has no per-operation scopes, so anyone who holds it can use the whole API. Keep it in environment variables, and regenerate it if it leaks.
- Remote MCP stays off unless you need it. It lets hosted AI clients such as Claude.ai and ChatGPT reach your install and, with the right scope, place orders. Enabled at install time, it leaves new-client approval off and order placement on, a combination the Remote MCP docs warn against on a public server. If you need it, require approval, start read-only and turn on MCP TOTP.
- Firewall. Allow only ports 22, 80 and 443. OpenAlgo has no built-in IP allowlist, so the host firewall is your boundary. Use SSH keys and keep fail2ban running.
- Updates. Security updates install automatically on the Algo VPS. The docs also suggest an occasional
sudo apt update && sudo apt upgrade -y. - Backups. Back up
.envand thedb/folder together. The.envfile holds the keys that unlock the database, so a database restored without its own.envwon't let you log in. Never runcp .sample.env .envon a working install.
A simple manual backup, to run after market hours before you copy the archive off the server:
sudo systemctl stop openalgo
sudo tar -czf /root/openalgo-backup-$(date +%F).tar.gz -C /var/python/openalgo .env db keys strategies
sudo systemctl start openalgo
Updating OpenAlgo, and what it all costs
If you installed with install.sh, the upgrade docs give one command:
cd /var/python/openalgo
sudo bash install/update.sh
The script stops the service, backs up the databases into a timestamped db/backup_<timestamp>/ folder and pulls the latest code. It lists new settings for .env without overwriting the file, then updates dependencies, runs migrations and restarts. Run it outside market hours, which the docs treat as lasting until 23:30 IST because of MCX's evening session. Afterwards, reconnect your broker and test in Analyzer Mode.
Here is what the setup costs, as of October 2026:
| Item | Cost |
|---|---|
| OpenAlgo | Free and open source (AGPL-3.0) |
| Algo VPS Mumbai | ₹1,510 a month, or about ₹1,325 a month when billed yearly |
| Domain | Nothing extra for a subdomain of a domain you own. A new .in domain from HostEthical costs ₹1,003 for the first year and the same to renew. |
| SSL and DNS | Let's Encrypt is free, and OpenAlgo's static IP page says Cloudflare's free plan is enough |
| Broker API | Varies. Zerodha's API page lists a free Personal tier and a ₹500-a-month Connect tier with live streaming and historical data. |
OpenAlgo's quotes and charts use your broker's market data, so check what your API plan includes. If you'd rather prepare the server yourself, a plain Cloud VPS starts at ₹860 a month, or about ₹774.17 a month when billed yearly, and Mumbai adds a monthly location fee. If your PC is on all day and your ISP gives you a static IP, OpenAlgo can run there for nothing extra.
Frequently asked questions
Is OpenAlgo free to use?
Yes. OpenAlgo is free, open-source software released under the AGPL-3.0 licence, and you host it yourself. You pay only for the server it runs on, a domain if you don't already own one, and any API or market-data fees your broker charges. HostEthical is not affiliated with OpenAlgo or Marketcalls and doesn't preinstall it on its servers.
Does the OpenAlgo installer work on Ubuntu 24.04?
Yes. OpenAlgo's Ubuntu server guide supports Ubuntu 22.04 or later. Ubuntu 24.04 blocks system-wide pip installs, and the current install.sh handles this by installing the uv package manager through snap or Astral's standalone installer. The script builds its own Python environment under /var/python/openalgo. OpenAlgo needs Python 3.12 or newer, which is the version Ubuntu 24.04 ships.
Which IP address do I register with my broker for OpenAlgo?
Register the public IPv4 address of the server that runs OpenAlgo, because OpenAlgo is the program that sends orders to the broker. Signals from TradingView, ChartInk or Amibroker on your PC go to OpenAlgo first, so the broker sees only the server's IP. OpenAlgo's eventlet worker can prefer IPv6, so set EVENTLET_NO_GREENDNS=yes for its service (the Algo VPS does this already) or also register the server's IPv6 address as your secondary IP.
Should I enable Remote MCP when installing OpenAlgo?
Only if you need hosted AI clients such as Claude.ai or ChatGPT to reach your OpenAlgo over the internet. Remote MCP is off by default. If you enable it during a native install, new clients are approved automatically and order placement is allowed, a combination the docs warn against on public servers. Local MCP for desktop AI apps works without it.