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.
01 Create your server
Log in to digitalocean.com → Create → Droplets, and choose:
| Setting | Choose |
|---|---|
| Region | New York (closest to US markets) |
| Image | Ubuntu 22.04 LTS |
| Size | Basic → Regular → 4 GB / 2 vCPU — $24/mo |
| Authentication | Password (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.
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.
# push the deploy script to the server scp deploy.sh root@YOUR_SERVER_IP:~/deploy.sh
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.
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
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:
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:
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
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:
| Command | What it does |
|---|---|
| charles-start | License-checks, then starts the bot |
| charles-stop | Stops the bot immediately |
| charles-restart | Restart after uploading new files |
| charles-status | Is it running? Uptime & error count |
| charles-logs | Watch the live log stream |
| charles-activate | Register this server's IP on your whitelist |
| charles-update | Pull 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
| Symptom | Fix |
|---|---|
| “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 start | Check logs: charles-logs. Most often a missing key in ~/charles/.env. |
| Dashboard won't load | Confirm the firewall allows port 8501 and the bot is running: charles-status. |
| AI brain errors | Verify GROQ_API_KEY. Charles falls back to local Ollama automatically if Groq is unreachable. |