Ubuntu Server Installation
Prerequisites
System Requirements
- Ubuntu Server (22.04 LTS or later recommended)
- Minimum 2 GB RAM (or 0.5 GB + 2 GB swap, the installer auto-creates the swap file if needed)
- 1 GB free disk
- 1 vCPU
- Clean installation recommended
Tradeboard runs on Ubuntu, Debian, Raspbian, RHEL, Rocky, AlmaLinux, Amazon Linux, Fedora, and Arch - the installation script auto-detects the distro and uses the right package manager. The flow below uses Ubuntu as the example.
Domain and DNS Setup (Required)
- Cloudflare Account Setup
- Create a Cloudflare account if you don't have one
- Add your domain to Cloudflare
- Update your domain's nameservers to Cloudflare's nameservers
- DNS Configuration
Add an A record pointing to your server's IP address
Type: A Name: yourdomain.com Content: YOUR_SERVER_IP Proxy status: ProxiedAdd a CNAME record for
www(optional, not required forsub.yourdomain.com)Type: CNAME Name: www Content: yourdomain.com Proxy status: Proxied
- SSL/TLS Configuration in Cloudflare
- Go to SSL/TLS section
- Set encryption mode to Full (strict)
Broker Setup (Required)
- Obtain your broker's API credentials per the Tradeboard documentation:
- API Key
- API Secret
- Prepare the redirect URL based on your domain and broker name:
# Example - root domain yourdomain.com with Zerodha
https://yourdomain.com/zerodha/callback
# Example - subdomain sub.yourdomain.com with Angel
https://sub.yourdomain.com/angel/callbackLogin to the Ubuntu Server
# Connect to your Ubuntu server via SSH
# Example: ssh root@134.56.76.23
ssh user@your_server_ipInstallation Steps
1. Download the Installation Script
mkdir -p ~/tradeboard-install
cd ~/tradeboard-install
wget https://raw.githubusercontent.com/wesoftcorp/tradeboard-docs/main/install/install.sh
chmod +x install.sh2. Run the Installation Script
sudo ./install.shThe script will interactively prompt you for:
- Your domain name (root domains and subdomains both supported)
- Broker selection from the 36 installed plugins
- Broker API credentials (Key + Secret)
- For XTS-based brokers (5paisa XTS, Compositedge, IIFL, etc.): additional market-data API key/secret
- Enable Remote MCP? (y/N), opt-in to expose
/mcpand/oauth/*for hosted AI clients (Claude.ai, ChatGPT) at the same domain. You can also enable this later from the admin UI
The installer will:
- Detect your distro (Ubuntu / Debian / RHEL / Fedora / Arch / Amazon Linux) and use the right package manager
- Install required packages, including Chromium (used for Telegram /chart rendering, non-fatal if unavailable)
- Install the
uvpackage manager (via snap on Ubuntu, or the Astral standalone installer on PEP 668 systems like Ubuntu 24.04+) - Configure Nginx with HTTPS via Let's Encrypt (Certbot)
- Set up the Tradeboard application under
/var/python/tradeboard - Create the systemd unit
tradeboard.service - Generate timestamped installation logs in
~/tradeboard-install/logs/
Default Layout (single deployment)
After a successful run, the install lives at:
/var/python/tradeboard/ cloned repo
/var/python/tradeboard/.venv/ uv-managed Python virtual environment
/var/python/tradeboard/.env configuration
/var/python/tradeboard/tradeboard.sock Gunicorn Unix socket
/etc/systemd/system/tradeboard.service systemd unit
/etc/nginx/sites-available/tradeboard.conf Nginx vhost (stable name across domain changes)The Nginx vhost name tradeboard.conf is intentionally fixed, install/change-domain.sh updates server_name in place rather than renaming the file.
Multi-Domain Deployment (Optional)
The default install.sh is single-deploy per server. If you need 2+ Tradeboard instances side by side (different broker per instance, etc.), use the dedicated multi-deploy installer:
wget https://raw.githubusercontent.com/wesoftcorp/tradeboard-docs/main/install/install-multi.sh
chmod +x install-multi.sh
sudo ./install-multi.shinstall-multi.sh asks how many instances you want, then collects a domain, broker and credentials for each. Instances are numbered, not named after the domain:
/var/python/tradeboard-flask/tradeboard1/ instance 1 repo
/var/python/tradeboard-flask/tradeboard1/venv/ its virtual environment
/var/python/tradeboard-flask/tradeboard1/.env its configuration
tradeboard1.service its systemd unit
/etc/nginx/sites-available/<domain> its nginx vhost, named after the domainEach instance also gets its own ports, allocated in sequence from the single-deploy defaults:
| Instance | Flask | WebSocket | ZeroMQ |
|---|---|---|---|
| 1 | 5000 | 8765 | 5555 |
| 2 | 5001 | 8766 | 5556 |
| 3 | 5002 | 8767 | 5557 |
Each deployment gets its own service, configuration, virtual environment, SSL certificate, and log file.
WARNING
install/update.sh currently detects the single-deploy layout at /var/python/tradeboard and an older multi-deploy layout of the form /var/python/tradeboard-flask/<name>/tradeboard/ with a service called tradeboard-<name>. It does not recognise the tradeboard1, tradeboard2 directories that the current install-multi.sh creates. Update those instances by hand: cd /var/python/tradeboard-flask/tradeboard1 && sudo git pull, re-sync dependencies, then sudo systemctl restart tradeboard1.
3. Verify the Installation
Check service status
bashsudo systemctl status tradeboardTest the Nginx configuration
bashsudo nginx -t ls -l /etc/nginx/sites-enabled/tradeboard.confOpen the dashboard at
https://yourdomain.comView installation log
bashls -l ~/tradeboard-install/logs/ cat ~/tradeboard-install/logs/install_YYYYMMDD_HHMMSS.log
Remote MCP
Remote MCP exposes /mcp and /oauth/* so hosted AI clients (claude.ai, chatgpt.com) can connect to your Tradeboard install over HTTPS. Local stdio MCP (Claude Desktop, Cursor, Windsurf) is unaffected, it works regardless of this setting.
You can enable Remote MCP two ways:
At install time, answer
ywheninstall.shprompts. The installer setsMCP_HTTP_ENABLED='True'andMCP_PUBLIC_URL='https://yourdomain.com'in.envfor you.From the admin UI, visit
https://yourdomain.com/admin/remote-mcp. The settings card at the top of the page lets you flip Remote MCP on or off, edit the public HTTPS origin, and adjust the OAuth posture toggles. Saving writes the new values to.env; a yellow banner then prompts you to restart the service:bashsudo systemctl restart tradeboardThe banner clears automatically once the running process picks up the new values.
Available Toggles
| Toggle | .env key | Default |
|---|---|---|
| Remote MCP enabled | MCP_HTTP_ENABLED | False |
| Auto-approve hosted clients | MCP_OAUTH_REQUIRE_APPROVAL | False (auto-approve ON) |
| Allow order placement | MCP_OAUTH_WRITE_SCOPE_ENABLED | True |
The MCP URL to give your AI client is the same as your dashboard URL with /mcp appended, e.g. https://yourdomain.com/mcp. The admin page displays it with a copy button when MCP is configured.
Troubleshooting
Common Issues
SSL certificate issues
bashsudo journalctl -u certbot # Re-run Certbot manually sudo certbot --nginx -d yourdomain.comApplication not starting
bash# View live logs sudo journalctl -fu tradeboard # Last 100 lines sudo journalctl -n 100 -u tradeboard # Restart sudo systemctl restart tradeboardNginx issues
bash# Test config sudo nginx -t # Error log sudo tail -f /var/log/nginx/error.log # Access log sudo tail -f /var/log/nginx/access.log # Reload after config changes sudo systemctl reload nginxInstallation logs
bashls -l ~/tradeboard-install/logs/ cat ~/tradeboard-install/logs/$(ls -t ~/tradeboard-install/logs/ | head -1)uvinstall failed withexternally-managed-environmentThis is PEP 668 enforcement on Ubuntu 24.04+ / Debian 12+. The current
install.shfalls through to the Astral standalone installer automatically; if you're on an older copy, refresh the script and re-run:bashcd ~/tradeboard-install rm -f install.sh wget https://raw.githubusercontent.com/wesoftcorp/tradeboard-docs/main/install/install.sh chmod +x install.sh sudo ./install.shInspect the install directly
bash# Repo ls /var/python/tradeboard # Effective configuration sudo cat /var/python/tradeboard/.env # Application logs sudo tail -f /var/python/tradeboard/log/tradeboard_$(date +%F).log # JSON-formatted error log (always-on) sudo tail -f /var/python/tradeboard/log/errors.jsonl
Multi-Domain Deployment Notes
If you ran install-multi.sh, the services are numbered tradeboard1, tradeboard2 and so on:
# List all Tradeboard services on this host
systemctl list-units 'tradeboard*'
# Manage a specific instance
sudo systemctl status tradeboard1
sudo journalctl -fu tradeboard1
# Per-instance install directories
ls /var/python/tradeboard-flask/Updating
cd ~/tradeboard-install
wget https://raw.githubusercontent.com/wesoftcorp/tradeboard-docs/main/install/update.sh
chmod +x update.sh
sudo ./update.shThe update script backs up every database to a timestamped db/backup_<timestamp>/ folder, runs git pull, reports any new variables found in .sample.env, re-installs dependencies from requirements-nginx.txt into the deployment's virtual environment, runs upgrade/migrate_all.py, and restarts the service. Your .env is never overwritten.
It detects the single-deploy layout at /var/python/tradeboard first and falls back to scanning /var/python/tradeboard-flask/ for the legacy <name>/tradeboard/ layout, asking which to update when several are present.
Changing the Domain
cd ~/tradeboard-install
wget https://raw.githubusercontent.com/wesoftcorp/tradeboard-docs/main/install/change-domain.sh
chmod +x change-domain.sh
sudo ./change-domain.shThe script updates .env (HOST_SERVER, WEBSOCKET_URL), the Nginx vhost's server_name, requests a new Let's Encrypt certificate for the new domain, and restarts the service.
Security Notes
Firewall
The installer configures UFW to allow only SSH, HTTP, and HTTPS. Open additional ports as needed:
bashsudo ufw allow <port_number>SSL/TLS
Certificates are auto-renewed by Certbot
The Nginx vhost uses TLS 1.2/1.3, modern ciphers, OCSP stapling, and HSTS
Keep the system patched:
bashsudo apt update && sudo apt upgrade -y
.envfileContains
APP_KEY,API_KEY_PEPPER, and broker credentials. The installer setschmod 600on it and ownership to the service user (www-dataon Ubuntu/Debian,nginxon RHEL,httpon Arch). Never commit this file or expose it via Nginx.Auto-logout
Indian broker tokens expire daily at ~3:00 AM IST and the app forces a re-login at that time. For 24/7 crypto brokers (Delta Exchange), the installer detects this and disables the auto-logout.
Single user per deployment
Tradeboard is designed for one trader per server. There is no multi-user model, server access equals full control of the broker session. Don't share the host.
Post-Installation
- Configure your broker login on the dashboard
- Set up monitoring and Telegram alerts if desired
- Periodically review
log/errors.jsonlfor issues - Apply security updates regularly
Support
- GitHub: github.com/wesoftcorp/tradeboard-docs
- Documentation: docs.algo.wesoftcorp.com
- Discord: tradeboard.in/discord
Remember to:
- Regularly back up your
.envfile and thedb/directory - Monitor system resources
- Keep the system updated
- Review security best practices
