VPS 13 min read ·
Static IP for Algo Trading in India: SEBI Rule and VPS Setup
Static IP for algo trading in India: since 1 April 2026, brokers accept API orders only from a registered IP. Compare ISP vs VPS, register it, fix DH-905.
If your own code places orders through a broker API, you now need a static IP for algo trading. Since 1 April 2026, Indian brokers accept API orders only from a static IP address that you have registered with them. This is how SEBI's retail algo framework is enforced.
You get one fixed public IP plus an optional backup, you can change it once per calendar week, and only you or your immediate family may use it. The two usual ways to get one are a static IP add-on from your broadband provider or a small Linux server (VPS) that has its own IPv4 address.
What SEBI's static IP rule says and who it applies to
SEBI issued its circular "Safer participation of retail investors in Algorithmic trading" on 4 February 2025. The start date was pushed back twice. A circular dated 30 September 2025 then made the framework, together with the exchanges' implementation standards, binding on every stock broker from 1 April 2026.
The practical rules are in NSE's implementation standards (circular NSE/INVG/67858, 5 May 2025). For a retail trader using an API, these points matter:
- A static IP is mandatory for API access. If you wrote the algo yourself, the IP must be yours.
- One primary IP and an optional secondary IP, the second one for redundancy.
- No more than one change per calendar week. In extraordinary cases you can ask your broker for help.
- One client per IP. An IP can be mapped to only one client at a time. Members of one family, as SEBI defines it, may share an IP on a written request, if the broker allows it.
- A daily logout. Every API session must be logged out before the next trading day starts, so your bot has to log in again each morning.
- A limit of 10 orders per second. Below 10 orders per second per exchange you don't register the algo yourself, and your orders carry a generic exchange tag. Above that rate, the algo must be registered with each exchange through your broker.
Who doesn't need a static IP. NSE's FAQ of November 2025 says a client static IP is required only for a "tech savvy" investor who uses an API to place orders. You don't need one if you trade through your broker's app or website, or through an algo platform hosted on your broker's servers.
Brokers check the IP only when an order is placed, modified or cancelled. Market data, WebSocket feeds, positions and holdings still work from any IP, according to Zerodha, Upstox, FYERS and Angel One.
How to get a static IP for algo trading: ISP, VPS, free cloud tier or gateway
Any fixed public IP used only by you meets the rule. The options differ in cost, reliability and effort.
| Option | Typical cost | Runs when your PC is off? | Main catch |
|---|---|---|---|
| Static IP from your broadband provider | A monthly add-on; varies by ISP | No | Power cuts, router restarts and outages stop your bot |
| Linux VPS with a dedicated IPv4 | A monthly server fee | Yes, 24/7 in a data centre | You look after the server yourself |
| Free cloud tier | Free within limits | Yes | Capacity limits, and idle servers can be reclaimed |
| Paid static-IP gateway or proxy | A monthly subscription | Only if your bot runs somewhere always-on | The IP must be dedicated to you |
| Mobile data, ordinary home broadband, shared VPN | – | – | Doesn't work: the IP changes or is shared |
ISP static IP. In a March 2026 TradingQnA thread, one trader reported paying about ₹170 a month to a local ISP and being quoted about ₹350 a month, including GST, by a national ISP. That is one user's report, so ask your own provider. It is the cheapest option, but your bot stops whenever your power or internet does.
VPS. A virtual private server runs in a data centre with backup power and its own fixed IP, so your bot keeps running when your laptop is shut.
Free cloud tiers. Oracle Cloud's Always Free tier includes up to two small AMD virtual machines, each with a public IP, and Oracle has regions in Mumbai and Hyderabad. Free instances must run in your home region, capacity can run out, and Oracle may reclaim instances that stay idle for 7 days. A quiet trading bot can easily look idle.
On AWS, every public IPv4 address costs $0.005 an hour, about $3.65 a month, and you pay for the server on top of that.
Gateways. Some vendors sell a static IP as a proxy for your bot's traffic. Confirm the IP is dedicated to you: a shared proxy IP breaks the one-client rule, and Zerodha refuses an IP already linked to another account.
Not shared web hosting. There, one IP serves many customers, and the service isn't built for an always-on trading process (see VPS vs shared hosting).
Registering your IP with Zerodha, Dhan, Upstox, FYERS and Angel One
The table shows what each broker's documentation said as of October 2026. Brokers still update these pages, so check yours before you change anything.
| Broker | Where to add the IP | Changes | IP version |
|---|---|---|---|
| Zerodha (Kite Connect) | Developer account → Profile → IP Whitelist → Update (guide) | One per calendar week | IPv4; Zerodha staff on the Kite forum confirmed IPv6 is allowed |
| Dhan (DhanHQ) | web.dhan.co → My Profile → Get Trading & Data APIs → Add Static IP, or the setIP API (docs) | Locked for 7 days after whitelisting | IPv4 or IPv6 |
| Upstox | My Apps → Static IPs on your algo trading app, or the Update Static IPs API (notice) | One per calendar week; existing access tokens stop working after a change | IPv4 or IPv6 |
| FYERS | API dashboard → "Algo trading app" → enter the IP and redirect URL → Activate (guide) | Not stated on that page | Not stated |
| Angel One (SmartAPI) | smartapi.angelone.in → New Login → create a static-IP API key (notice) | Not stated in the notice | IPv4 only "for now" |
A few details are easy to miss:
- Zerodha allows up to two IPs, and you declare that only you and your immediate family (spouse, dependent children, dependent parents) will use them. Family members share an IP through one developer account, with every family member's client ID added to its apps.
- Not every broker allows family sharing. Dhan says each individual needs a unique static IP, Upstox says an IP can't be shared with any other customer, and Angel One says family sharing isn't supported yet.
- FYERS gives you a new App ID ending in "200" once you activate the app. Your bot must use that ID and its new secret.
- Angel One caps orders at 9 per second, and its static-IP rule covers order and GTT requests.
- If you build bots for clients, each client or family needs its own IP. That covers only the IP rule: SEBI's circular also requires anyone who offers others a way to place algo orders through a broker API to be empanelled with the exchanges as an algo provider, so check with the broker first.
Why a Linux VPS in Mumbai suits a Python trading bot
- It is always on. Your bot keeps running when your laptop sleeps or the power goes.
- The IP is yours alone. Each HostEthical VPS has a dedicated public IPv4 address that nobody else uses. The address stays the same when you reboot or reinstall the operating system. If you ever move to a different server, for example in another region, you get a new IP and have to register it with your broker again.
- It is close to your broker. A server in Mumbai keeps each API call on a short trip within India. It won't match exchange colocation, and no server location makes a strategy profitable. Our Mumbai VPS guide explains why location matters.
- Linux suits Python. Every broker SDK, scheduler and data library runs on Ubuntu or Debian. If you are choosing between them, see the best Linux OS for a VPS.
The VPS is unmanaged, which means you install, update and secure the software yourself. If that is new to you, read managed vs unmanaged VPS first.
Step by step: set up the VPS for your bot
1. Secure the server first
Choose Ubuntu 24.04 LTS when you order. Log in with an SSH key, create a normal user and turn on the firewall. Our VPS setup guide walks through each step.
2. Set Indian time
Set the server to IST so that your logs and schedules line up with market hours:
sudo timedatectl set-timezone Asia/Kolkata
3. Create a bot user and a virtual environment
sudo adduser --disabled-password --gecos "" algo
sudo apt update && sudo apt install -y python3-venv git
sudo -iu algo
python3 -m venv ~/venv
~/venv/bin/pip install kiteconnect # or your broker's Python SDK
mkdir ~/bot # put bot.py here, or git clone your private repo
exit # back to your admin user
4. Keep secrets out of your code
Put your API key, API secret and any TOTP secret in a file that only root can read:
sudo nano /etc/tradingbot.env # API_KEY=... API_SECRET=...
sudo chmod 600 /etc/tradingbot.env
5. Run the bot as a systemd service
Save the following as /etc/systemd/system/tradingbot.service. systemd restarts the bot if it crashes and starts it again after a reboot.
[Unit]
Description=Trading bot
After=network-online.target
Wants=network-online.target
[Service]
User=algo
WorkingDirectory=/home/algo/bot
EnvironmentFile=/etc/tradingbot.env
ExecStart=/home/algo/venv/bin/python bot.py
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now tradingbot
journalctl -u tradingbot -f # watch the logs
Because of the daily logout, your bot needs a login step every trading morning before its first order.
Find and verify your outbound IP (and avoid the IPv6 trap)
Run these on the server itself, as the same user your bot runs as:
curl -4 https://ifconfig.me; echo # your IPv4 address
curl -6 https://ifconfig.me; echo # your IPv6 address, if the server has one
curl -sv -o /dev/null https://api.kite.trade 2>&1 | grep -i "connected to"
The last command shows which address your server actually uses to reach the broker. Replace the hostname with your broker's API host.
This is where many traders get caught. When we checked on 15 October 2026, the API hostnames of Zerodha, Dhan, Upstox and FYERS all had IPv6 as well as IPv4 addresses. If your server has IPv6, Linux usually tries it first, so orders leave from the IPv6 address and are rejected even though your IPv4 is whitelisted. Kite forum users reported this in April 2026, with an IPv6 address in the rejection message. In March 2026 another user hit the reverse: IPv6 whitelisted, requests sent over IPv4.
There are two ways to fix it:
- Prefer IPv4 for the whole server. Add one line to
/etc/gai.confand then run thecurl -svtest again:echo 'precedence ::ffff:0:0/96 100' | sudo tee -a /etc/gai.conf - Register the IPv6 address as well, for example as your secondary IP, with a broker that accepts IPv6 (Zerodha, Dhan, Upstox). Angel One accepts only IPv4.
A tip for Python checks: api.ipify.org always answers over IPv4, so it can show the "right" IP while your bot is using IPv6. Use api64.ipify.org instead, which reports whichever address your code actually connects from.
Fixing rejections: DH-905 "Invalid IP" and similar errors
Each broker words the error differently:
- Dhan:
DH-905 Invalid IP. Dhan's fix: go to Profile → Get Trading & Data API, switch to Sandbox, open IP Setup → Get Static IP and send a freshly generated access token. The response shows your primary IP, secondary IP, the detected IP and whether orders are allowed. - Zerodha: forum users have reported the message "IP … is not allowed to place orders for this app."
- Upstox: community users have reported
UDAPI1154("Access to this API is blocked due to static IP restrictions"). The API docs listUDAPI1185for an IP change attempted too soon.
The cause is usually one of these, in rough order of likelihood:
- The request left over IPv6 while you registered IPv4, or the other way round (see the section above).
- The order was sent from your laptop while you were testing, not from the server.
- A VPN or proxy is switched on, on the machine sending the order.
- The access token is older than your IP change. Dhan and Upstox both need a new token.
- A typing mistake in the IP, or, on FYERS, an old App ID still in your code.
- You have already used this week's change. Ask your broker's API support for help.
Security basics for a trading server
A server that places orders in your name needs more care than a hobby project:
- Use SSH keys only. Turn off password logins once your key works.
- Close every inbound port except SSH. A bot only makes outgoing connections, so
sudo ufw allow OpenSSH && sudo ufw enableis enough. If you receive alerts by webhook, open only HTTPS (port 443) behind a proper web server. - Treat the API secret and the TOTP secret as passwords. Keep them in the root-only env file, never commit them to git, and regenerate them at your broker if they ever leak.
- Turn on automatic security updates with
sudo apt install unattended-upgrades. - Don't lend the server. You declared the IP is for you or your family only, so don't run a friend's strategy on it.
- Back up your code to a private repository, and add server backups if rebuilding by hand would hurt.
What it costs each month, and when an ISP static IP is cheaper
HostEthical Cloud VPS plans start at ₹860 a month, or about ₹774.17 a month when billed yearly. India (Mumbai) adds a monthly location fee, shown at checkout. You are billed in rupees and can pay by UPI, card, netbanking or crypto. The smallest plan (4 vCPUs, 8 GB RAM) is more than one Python bot needs, leaving room for several strategies, a tick database and a dashboard.
| Plan | vCPU | RAM | Storage | Network | Monthly | Yearly |
|---|---|---|---|---|---|---|
| VPS Starter | 4 cores | 8 GB | 100 GB SSD | 200 Mbit/s, unlimited traffic | ₹860 | ₹9,290 |
| VPS Pro | 6 cores | 12 GB | 200 GB SSD | 300 Mbit/s, unlimited traffic | ₹1,170 | ₹12,640 |
| VPS Max | 8 cores | 24 GB | 300 GB SSD | 600 Mbit/s, unlimited traffic | ₹2,190 | ₹23,660 |
An extra IPv4 address is available as an add-on, which helps when your broker wants a separate IP for each family member's account. Your code then has to send that account's requests from the second address.
The VPS isn't the best deal for everyone:
- An ISP static IP is cheaper if your desktop is on all day and your power and internet are reliable.
- A free cloud tier costs nothing if you accept its capacity limits and the reclaim risk.
- A broker-hosted platform needs no IP or server at all.
- A Mumbai VPS is the simplest choice for a fixed Indian IP that runs 24/7 without your home connection. For a wider price comparison, see cheap VPS hosting in India.
Frequently asked questions
Do I need a static IP for algo trading in India?
Yes, if your own code places orders through a broker API. Since 1 April 2026, brokers reject API orders that do not come from an IP address you have registered with them. You do not need one to trade in the broker's app or website, or on an algo platform hosted on the broker's servers.
Can I use a VPS IP address for Zerodha Kite Connect?
Yes. You can add any fixed public IP that only you or your immediate family use under IP Whitelist in your Kite Connect developer profile, and a VPS with its own dedicated IPv4 address qualifies. Check that your bot actually connects from that address: if the server also has IPv6, requests may leave over IPv6 instead, so either make the server prefer IPv4 or register the IPv6 address too.
How often can I change my static IP with my broker?
Exchange rules allow one change per calendar week. Dhan locks a whitelisted IP for 7 days, and Upstox invalidates your existing access tokens when you change it. In an emergency, ask your broker's API support, because NSE's standards let brokers help in extraordinary cases.
Can I use the same static IP for two trading accounts?
Only if both accounts belong to one family as SEBI defines it (spouse, dependent children and dependent parents) and your broker allows it. Zerodha does: you use one developer account and add each family member's client ID to its apps. As of October 2026, Dhan, Upstox and Angel One say each account or individual needs its own static IP, so check with your broker before sharing one.