VPS / Dedicated Server
Prerequisites
Make sure you have the prerequisites ready before starting (BotFather token, api_id, api_hash, user ID, MongoDB URL).
Step 1: Install Docker on your server
curl -fsSL https://get.docker.com | shVerify: docker --version
Step 2: Clone and configure
git clone -b wzv3 https://github.com/Imkrishana/HKML-X.git
cd HKML-X
cp config_sample.py config.py
nano config.pyDon't skip the cp
Docker mounts ./config.py into the container. If the file doesn't exist yet, Docker silently creates a directory with that name and the bot crashes on startup with a confusing import error. Always cp config_sample.py config.py before your first docker compose up.
Fill in at minimum these 5 values:
BOT_TOKEN = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
OWNER_ID = 123456789
TELEGRAM_API = 12345
TELEGRAM_HASH = "abc123def456..."
DATABASE_URL = "mongodb+srv://admin:password@cluster0.xxxxx.mongodb.net/?retryWrites=true&w=majority"Step 3: Start the bot
docker compose up -d --buildWait 1-2 minutes. Check it's running:
docker compose ps # both app and tunnel should show "Up"
docker compose logs app --tail 10Get your web UI URL:
docker compose logs tunnelLook for https://abc123.trycloudflare.com — that's your web UI.
Step 4: Talk to your bot
Open Telegram, find your bot, send /start, then /help, then try a mirror.
Updating
The compose file builds the image from source, so docker compose pull does nothing. Pull the code, then rebuild:
cd HKML-X
git pull
docker compose up -d --buildYour config.py, accounts/ and downloads/ are mounted from the host, so they survive the rebuild.
Stopping
docker compose down
docker image prune -a # optional: clean up old images(Optional) Run with VPN
- Uncomment the
gluetunsection indocker-compose.yml - Fill in your VPN provider details
- Uncomment
network_mode: "service:gluetun"on theappservice - Run
docker compose up -d --build
(Optional) Run multiple bots
- Create
config2.pywith different credentials - Uncomment
app2andtunnel2indocker-compose.yml - Run
docker compose up -d --build