You've built the architecture, the data pipeline, the signal engine, the dashboard, and the AI layer. Now it's time to ship it. Docker, VPS, monitoring, security, and cost optimization — everything you need to run your terminal 24/7 for under $50/month.
Your terminal needs a server that's always on, close to market data sources (US East Coast), and cheap enough to run 24/7. Here's a comparison of the top options:
| Provider | Plan | CPU | RAM | Storage | Cost/mo | Location |
|---|---|---|---|---|---|---|
| Hetzner | CX31 | 2 vCPU | 8 GB | 80 GB NVMe | $8.50 | US East, EU |
| DigitalOcean | Basic | 2 vCPU | 4 GB | 80 GB SSD | $24 | NYC, SFO |
| Railway | Pro | Shared | 8 GB | Ephemeral | $20+usage | US East |
| Fly.io | Performance | 2 CPU | 4 GB | Volumes | $20 | Global |
| AWS Lightsail | 4GB | 2 vCPU | 4 GB | 80 GB SSD | $20 | us-east-1 |
Hetzner CX31 at $8.50/month is the best value. 8 GB RAM is enough for TimescaleDB + Redis + all your services. NVMe storage is fast. The US East datacenter (Ashburn, VA) puts you <10ms from NYSE/NASDAQ. European traders can use Falkenstein or Helsinki. For comparison, the same specs on DigitalOcean costs 3x more.
Docker Compose orchestrates all your services: database, cache, ingestion, signals, AI, and dashboard. One file, one command, everything runs.
Your terminal has multiple time-critical jobs that need to run reliably. Here's the complete cron schedule:
| Job | Schedule (ET) | Service | Duration | Critical? |
|---|---|---|---|---|
| Morning briefing | 06:45 Mon-Fri | AI | ~30s | Yes |
| Pre-market scan | 09:00 Mon-Fri | Signals | ~2 min | Yes |
| Intraday quotes | Every 5 min (9:30-16:00) | Ingestion | ~10s | No |
| Daily bars (US) | 17:30 Mon-Fri | Ingestion | ~3 min | Yes |
| Daily bars (EU) | 12:00 Mon-Fri | Ingestion | ~1 min | No |
| Signal generation | 18:00 Mon-Fri | Signals | ~5 min | Yes |
| Evening scanner | 18:30 Mon-Fri | Signals+AI | ~3 min | Yes |
| Crypto quotes | Every 5 min | Ingestion | ~10s | No |
| Macro data | 08:00 Daily | Ingestion | ~30s | No |
| Weekly financials | 02:00 Sunday | Ingestion | ~20 min | No |
| DB backup | 03:00 Daily | TimescaleDB | ~5 min | Yes |
| Health check | Every 10 min | All | ~5s | Yes |
A terminal that goes down on a volatile day is worse than no terminal. You need monitoring at three levels:
External ping every 60s. UptimeRobot (free) or Better Stack ($10/mo). Alert via Telegram if dashboard goes down.
Check that bars_daily was updated within the last 24h. Alert if stale data detected. Prevents trading on old prices.
Log all errors to a rotating file. Alert on >5 errors/hour or any critical failure (DB down, API key expired).
Your terminal handles API keys worth money and potentially trading credentials. Security is not optional.
| Threat | Mitigation | Implementation |
|---|---|---|
| API key leak | .env file + Docker secrets | .gitignore on day 1, rotate quarterly |
| Dashboard exposure | Caddy + HTTP auth or Cloudflare Tunnel | Password-protect dashboard, no public access |
| DB access | Network isolation | DB only accessible from Docker network, never expose port 5432 |
| SSH bruteforce | Key-only auth + fail2ban | Disable password SSH, install fail2ban |
| Supply chain | Pin Docker image versions | Use image:tag@sha256:hash for critical services |
Your .env file should contain: database password, Yahoo cookie, Alpha Vantage key, Polygon API key, Anthropic API key, Telegram bot token + chat ID, Discord webhook URL. Back it up offline (encrypted USB or password manager). If your VPS dies, you need these keys to redeploy in minutes, not hours.
| Item | Provider | Cost/mo | Notes |
|---|---|---|---|
| VPS | Hetzner CX31 | $8.50 | 8 GB RAM, 2 vCPU, 80 GB NVMe |
| Data API | Polygon Starter | $29.00 | 15-min delayed, unlimited calls |
| Claude API | Anthropic | ~$15.00 | 10 analyses/day + briefings |
| Uptime monitor | UptimeRobot | $0 | Free tier (50 monitors) |
| Domain + DNS | Cloudflare | $0 | Free tier (DNS + proxy) |
| Telegram bot | Telegram | $0 | Free forever |
| Discord webhook | Discord | $0 | Free forever |
| TOTAL | ~$52.50 | vs. Bloomberg $2,000/mo |
Your terminal starts with 50 symbols. As you grow confidence, you'll want to cover the full S&P 500, European markets, and crypto. Here's how each layer scales:
| Component | 50 Symbols | 500 Symbols | Bottleneck | Solution |
|---|---|---|---|---|
| Ingestion | 3 min/day | 30 min/day | API rate limits | Parallel providers, batch requests |
| TimescaleDB | 200 MB | 2 GB | Query speed at scale | Compression, indexes, materialized views |
| Redis | 50 MB | 256 MB | Memory cap | LRU eviction, TTL tuning |
| Signal engine | 30 sec | 5 min | CPU for indicators | Vectorized numpy, pre-compute on ingest |
| Dashboard | 50 rows | 500 rows | DOM rendering | Virtual scrolling, pagination |
Monitor RAM usage. When TimescaleDB + Redis + all services consistently use >75% of your RAM, upgrade to the next tier. On Hetzner, going from CX31 (8 GB) to CX41 (16 GB) is $15.90/month — still 99% cheaper than Bloomberg. You won't need this until you're running 1,000+ symbols with real-time streaming.
You now have the complete blueprint to build, deploy, and operate a personal trading terminal with AI. From architecture to production in 6 parts. Go build it.
Re-read Part 1 Back to Home