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, activate your subscription's access key, 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.

You'll need: a DigitalOcean account ($200 free credit for new accounts), an active Charles subscription, your API keys (Alpaca paper, Telegram, Groq), and the charles-v1.zip bot bundle on your PC.

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 → 4 GB / 2 vCPU — $24/mo
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.

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-v1.zip
scp charles-v1.zip root@YOUR_SERVER_IP:~/charles-v1.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-v1.zip -d ~/charles
rm ~/charles-v1.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
CHARLES_LICENSE_KEY=your_subscription_key

Your CHARLES_LICENSE_KEY is shown on your account page right after you subscribe. It ties this server to your billing.

06 Activate access (the whitelist)

Charles only runs from a server whose IP is on an access whitelist — otherwise you can only load the software locally. Charles only works on one single IP address. Activation registers your droplet's IP so the bot can run live. Run it once:

bash · server
charles-activate
# output
🔑 Registering this server with your subscription…
   IP detected:   198.51.100.24
   License:       CHL-••••-7Q2
✅ IP added to your access whitelist — subscription ACTIVE

From then on, every launch silently re-checks that your IP is whitelisted and your subscription is paid. If billing lapses, the key deactivates and Charles stops on its own — nothing to uninstall.

07 Run Charles

bash · server
charles-start
🔑 License check… IP 198.51.100.24 — ACTIVE ✓
✅ 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.

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-activateRegister this server's IP on your whitelist
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.
AI brain errorsVerify GROQ_API_KEY. Charles falls back to local Ollama automatically if Groq 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.