Documentation

How to Setup Charles

A complete walkthrough: stand up a DigitalOcean server, push the bot onto it from Windows with PowerShell, extract it with bash, and operate it with the charles-* commands. Budget about 20–30 minutes. You'll switch between two terminals — PowerShell on your own PC and bash on the server.

Two ways to run Charles: on your own computer (great for testing — runs while your machine is on) or on a cloud server that runs it 24/7 (recommended for real use). Pick your path below. Either way you'll need your free API keys (Alpaca paper, Telegram, Groq) and the charles-customer.zip bundle from the download page.
💻

Run locally

On your own Windows, Mac, or Linux machine. Free, fast to try, runs while your computer is on.

Jump to local setup →

💻 Run Charles locally

The fastest way to try Charles — run it directly on your own computer. It runs while your machine is on; close your laptop and it pauses. Great for testing before committing to a 24/7 server.

1 · Install Python 3.11 (if you don't have it)

Download from python.org — during install, check "Add Python to PATH". Mac users can also use brew install python@3.11.

2 · Unzip the bundle

Extract charles-customer.zip to a folder you'll remember, e.g. Desktop/charles.

3 · Add your API keys

In the charles folder, copy .env.example to .env and fill in your keys:

ALPACA_API_KEY=your_key
ALPACA_SECRET_KEY=your_secret
GROQ_API_KEY=your_groq_key
TELEGRAM_BOT_TOKEN=your_token
TELEGRAM_CHAT_ID=your_chat_id

4 · Install dependencies & run

PowerShell / Terminal · your PC
# from inside the charles folder
pip install -r requirements.txt
python main.py

A setup wizard opens in your browser. Fill in any remaining settings and click Launch. The dashboard opens at http://localhost:8501. First start can take a few minutes while it loads models and connects.

That's it for local. Charles is now running on your machine. To run it 24/7 without keeping your computer on, follow the server setup below instead. Everything from here down is the cloud-server path.

01 Create your server

Log in to digitalocean.comCreate → Droplets, and choose:

SettingChoose
RegionNew York (closest to US markets)
ImageUbuntu 22.04 LTS
SizeBasic → Regular → 2 GB / 1 vCPU ($12/mo) or 4 GB / 2 vCPU ($24/mo) — both work fine
AuthenticationPassword (pick a strong one)

Click Create Droplet, wait ~60 seconds, and copy the IPv4 address it gives you. That IP is your server's identity everywhere below — and the address Charles will register on your access whitelist.

💡 New to DigitalOcean? Sign up with this referral link to get $200 in free credit — that covers ~8 months of server costs, making Charles just $19/month all-in during that period.

02 Connect to the server

On your own machine, open PowerShell and SSH in. Replace YOUR_SERVER_IP with the address from step 1.

PowerShell · your PC
ssh root@YOUR_SERVER_IP

Type yes to accept the fingerprint, then your droplet password. Your prompt becomes root@charles:~# — you're now inside the server.

03 Run the deploy script

The deploy script installs everything Charles needs — Miniconda + Python 3.11, the AI runtime, all packages, firewall rules, the auto-start service, and the charles-* commands. First copy it up from your PC, then run it on the server.

PowerShell · your PC
# push the deploy script to the server
scp deploy.sh root@YOUR_SERVER_IP:~/deploy.sh
bash · server
chmod +x deploy.sh
bash deploy.sh

Takes 10–15 minutes. When it's done you'll see the “Deployment Complete” banner with your management commands.

04 Extract the bot onto the server

Now push the bot bundle up and unpack it. You'll do the upload from PowerShell and the extract in bash.

PowerShell · your PC

Upload the zip bundle (one clean transfer):

# from the folder that contains charles-customer.zip
scp charles-customer.zip root@YOUR_SERVER_IP:~/charles-customer.zip
bash · server

Unzip into the bot's home directory and clean up:

mkdir -p ~/charles
apt-get install -y unzip      # if not already present
unzip -o ~/charles-customer.zip -d ~/charles
rm ~/charles-customer.zip
ls ~/charles                  # confirm main.py, brain.py, dashboard.py … are there

Prefer drag-and-drop? FileZilla works too — Host YOUR_SERVER_IP, user root, port 22, upload into /root/charles/. The bash unzip step is only needed if you uploaded a zip.

05 Add your API keys

Charles reads its credentials from a .env file. Create it on the server:

bash · server
nano ~/charles/.env

Paste your keys, then save with Ctrl+X → Y → Enter:

ALPACA_API_KEY=your_key
ALPACA_SECRET_KEY=your_secret
TELEGRAM_BOT_TOKEN=your_token
TELEGRAM_CHAT_ID=your_chat_id
GROQ_API_KEY=your_groq_key

💡 Live trading: Charles runs in paper mode by default. To enable live trading, create an Alpaca live account at alpaca.markets, get your live API keys, and replace the paper keys in your .env file. No other changes needed.

06 Run Charles

bash · server
charles-start
✅ Charles started
📊 Dashboard: http://YOUR_SERVER_IP:8501
📋 Logs: charles-logs

Open http://YOUR_SERVER_IP:8501 in any browser to watch the live dashboard. The bot now runs 24/7 and restarts itself on reboot. That's it — Charles is live.

First startup tip. Charles can take up to 5 minutes to fully initialise on first run — it loads the AI models, connects to Alpaca, and runs the screener before it's fully operational. Run charles-restart && charles-logs to watch it come up and confirm everything connected correctly. You should see ✅ Alpaca connected and ✅ Groq connected in the logs before the bot starts trading.

Command reference

Everything you'll ever need to operate Charles, from your bash terminal on the server:

CommandWhat it does
charles-startLicense-checks, then starts the bot
charles-stopStops the bot immediately
charles-restartRestart after uploading new files
charles-statusIs it running? Uptime & error count
charles-logsWatch the live log stream
charles-updatePull the latest bot version & restart

Updating the bot later: re-upload your files from PowerShell with scp (step 4), then run charles-restart on the server.

! Troubleshooting

SymptomFix
“IP not whitelisted”Your droplet's IP changed or billing lapsed. Re-run charles-activate; confirm your subscription is active on your account page.
Bot won't startCheck logs: charles-logs. Most often a missing key in ~/charles/.env.
Dashboard won't loadConfirm the firewall allows port 8501 and the bot is running: charles-status.
Reasoning engine errorsVerify GROQ_API_KEY at console.groq.com. The free tier is sufficient. Charles falls back to rule-based signals if the API is unreachable.
Reminder. Charles runs in paper-trading mode — simulated orders, no real money, no profit guarantees. This guide is operational documentation, not financial advice.