Deploy Always-On

Test locally on your machine. When you're ready for continuous execution, move to a cloud instance in under 30 minutes.

Local Setup

Run AlgoDeploy on your Windows, Mac, or Linux machine. Ideal for backtesting, paper trading, and strategy development.

1. Install

Extract the AlgoDeploy zip to any directory and create a virtual environment:

cd algodeploy
python -m venv venv

# Windows
venv\Scripts\activate

# Mac / Linux
source venv/bin/activate

pip install -r requirements.txt

2. Configure your broker

Create a .env file in your AlgoDeploy directory with your Alpaca credentials:

ALPACA_API_KEY=your_api_key
ALPACA_SECRET_KEY=your_secret_key
ALPACA_PAPER=true

Or use the Dashboard Settings page to enter and test your connection visually.

3. Backtest

Validate your strategy before risking capital:

# Generate an example config
algodeploy backtest --example

# Run a backtest
algodeploy backtest my_strategy.yaml

4. Paper trade

Run live against the market with paper (simulated) money:

# Make sure ALPACA_PAPER=true in .env
algodeploy run my_strategy.yaml

Monitor via the dashboard:

algodeploy dashboard
When to move to the cloud

Local is great for development, but your laptop sleeps, loses Wi-Fi, and reboots for updates. Once your strategy is validated on paper, move to EC2 for continuous execution. AWS EC2 offers a 99.5% uptime SLA on single instances — but uptime depends on your hosting provider and configuration, not on AlgoDeploy.

Why AWS EC2?

Your trading strategy needs to be running when the market is open — not sleeping when your laptop lid closes. A dedicated cloud instance gives you:

  • Continuous execution — stays running while your laptop can't, survives reboots via systemd auto-restart
  • Low latency — AWS data centers are close to exchange infrastructure
  • Free tier eligible — new AWS accounts get 12 months of t3.micro for free
  • Full control — your instance, your data, your keys. Nothing touches our servers

Cost

ItemMonthly Cost
EC2 t3.micro (free tier, first 12 months)$0.00
EC2 t3.micro (after free tier)~$8.50
EBS storage (8 GB gp3)$0.64
Data transfer (minimal)~$0.00
Total (free tier)~$0.64/mo
Total (after free tier)~$9.14/mo

A t3.micro (2 vCPU, 1 GB RAM) handles AlgoDeploy with headroom to spare. No GPU needed.

Step-by-Step Setup

1. Create an AWS account

Sign up at aws.amazon.com/free. New accounts get 12 months of free tier, which includes 750 hours/month of t3.micro — enough to run one instance continuously for a full year at no compute cost.

2. Launch an EC2 instance

  • Go to EC2 → Launch Instance
  • Name: algodeploy
  • AMI: Ubuntu Server 24.04 LTS (free tier eligible)
  • Instance type: t3.micro
  • Key pair: Create a new key pair (download the .pem file — you'll need it to SSH in)
  • Security group: Allow SSH (port 22) from your IP
  • Storage: 8 GB gp3 (default is fine)
  • Click Launch Instance

3. Connect via SSH

Once the instance is running, connect from your terminal:

# Make your key file read-only (required)
chmod 400 algodeploy-key.pem

# Connect
ssh -i algodeploy-key.pem ubuntu@YOUR_INSTANCE_PUBLIC_IP

On Windows, use PowerShell or WSL. The chmod step isn't needed on PowerShell — just run the ssh command directly.

4. Install Python and dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install -y python3 python3-venv python3-pip

5. Upload AlgoDeploy

From your local machine, copy the AlgoDeploy directory to your instance:

# From your local terminal (not SSH)
scp -i algodeploy-key.pem -r ./algodeploy ubuntu@YOUR_INSTANCE_IP:~/algodeploy

Then on the instance:

cd ~/algodeploy
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

6. Configure environment

Create your .env file on the instance:

nano ~/algodeploy/.env

Add your broker credentials:

ALPACA_API_KEY=your_api_key
ALPACA_SECRET_KEY=your_secret_key
ALPACA_PAPER=true
Start with paper trading

Keep ALPACA_PAPER=true until you've verified the strategy runs correctly on your instance. Switch to false only when you're ready for live capital.

7. Test it manually first

Before setting up auto-start, verify everything works:

source ~/algodeploy/venv/bin/activate
algodeploy run my_strategy.yaml

Watch the output for a few minutes. Confirm it connects to Alpaca, scans for signals, and logs activity. Ctrl+C to stop.

8. Install systemd services for continuous operation

AlgoDeploy ships with systemd service files that auto-start the trader and dashboard on boot:

# Copy the service files
sudo cp ~/algodeploy/services/trader.service /etc/systemd/system/
sudo cp ~/algodeploy/services/dashboard.service /etc/systemd/system/

# Create the logs directory
mkdir -p ~/algodeploy/logs

# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable algodeploy-trader
sudo systemctl enable algodeploy-dashboard
sudo systemctl start algodeploy-trader
sudo systemctl start algodeploy-dashboard

9. Verify it's running

# Check service status
sudo systemctl status algodeploy-trader

# Watch live logs
tail -f ~/algodeploy/logs/trader.log

# Check both services
sudo systemctl status algodeploy-trader algodeploy-dashboard
That's it

Your strategy is now running continuously. It will auto-restart on crashes (after 15 seconds) and auto-start on instance reboot. You can disconnect from SSH — the trader keeps running.

Day-to-Day Operations

Update your strategy

Edit your config locally, then push the update:

# From your local machine
scp -i algodeploy-key.pem my_strategy.yaml ubuntu@YOUR_IP:~/algodeploy/

# SSH in and restart the trader
ssh -i algodeploy-key.pem ubuntu@YOUR_IP
sudo systemctl restart algodeploy-trader

View logs

# Live trader log
tail -f ~/algodeploy/logs/trader.log

# Last 50 lines of errors
tail -50 ~/algodeploy/logs/trader_error.log

# Systemd journal (includes start/stop/crash events)
sudo journalctl -u algodeploy-trader --since "1 hour ago"

Stop / restart

# Stop trading
sudo systemctl stop algodeploy-trader

# Restart (picks up config changes)
sudo systemctl restart algodeploy-trader

# Disable auto-start on boot
sudo systemctl disable algodeploy-trader

Access the dashboard remotely

The dashboard runs on port 8004. To access it securely from your browser, use an SSH tunnel instead of opening the port to the internet:

# From your local machine
ssh -i algodeploy-key.pem -L 8004:localhost:8004 ubuntu@YOUR_IP

Then open http://localhost:8004 in your browser. The dashboard is now accessible through the secure tunnel.

Notifications

Don't SSH in just to check if things are working. Configure alerts in your strategy config to get notified of trades and errors in real time:

notifications:
  telegram:
    bot_token: "your_bot_token"
    chat_id: "your_chat_id"

  discord:
    webhook_url: "https://discord.com/api/webhooks/..."

  webhook:
    url: "https://your-webhook-endpoint.com/alerts"

See the Feature Reference for setup details on each notification channel.

Security Checklist

  • SSH key only — never enable password authentication
  • Restrict SSH access — set your security group to allow port 22 from your IP only
  • Don't open port 8004 — use SSH tunneling for dashboard access (shown above)
  • Keep your .env file secure — it contains your broker API keys
  • Update regularly — run sudo apt update && sudo apt upgrade -y periodically
  • Use paper mode first — validate on the instance before switching to live

Uptime & Reliability

AWS publishes a 99.5% uptime SLA for single EC2 instances (99.99% for multi-AZ deployments). On a single instance, that translates to roughly 4.4 hours of potential downtime per year — significantly more reliable than a laptop or desktop machine.

For additional resilience, consider:

  • Notifications — configure Telegram, Discord, or webhook alerts so you know immediately if the trader stops or encounters errors
  • Systemd auto-restart — the included service files automatically restart the trader within 15 seconds of a crash (up to 3 retries per 5 minutes)
  • AWS CloudWatch — set up a free basic alarm to alert you if your instance becomes unreachable
Important: infrastructure is your responsibility

AlgoDeploy is software middleware that runs on infrastructure you choose and control. We do not host, operate, or monitor your trading instance. Uptime, availability, and network connectivity depend entirely on your hosting provider (e.g., AWS) and your configuration. AlgoDeploy makes no guarantees regarding uninterrupted execution, and is not responsible for missed trades, downtime, or losses resulting from infrastructure failures. Always monitor your deployment and have a plan for when things go offline.