Complete Deployment Guide • v2.1

DEPLOYMENTGUIDE

Step-by-step instructions to deploy iamlegendv2 WhatsApp bot on all major platforms worldwide

Prerequisites

Session Generator

QR Code Method

Scan the QR code with your WhatsApp app to get your session ID instantly. Fast and secure.

Open QR Generator

Pairing Code Method

Enter your phone number to receive an 8-character pairing code via WhatsApp.

Open Pairing Generator

Environment Variables

Configure these variables in your .env file or platform dashboard:

SESSION_ID (required)
OWNER_NUMBER (required)
BOT_NAME (optional)
PREFIXES (default: .,!,/)
COMMAND_MODE (public/private)
TIMEZONE (e.g., Africa/Dar_es_Salaam)

Termux (Android)

~5 min
pkg update && pkg upgrade -y pkg install git nodejs ffmpeg libvips -y git clone https://github.com/YOUR_USERNAME/iamlegendv2.git cd iamlegendv2 npm install cp sample.env .env nano .env # Paste SESSION_ID & OWNER_NUMBER npm start

💡 Pro Tip: Keep bot running after closing Termux by installing tmux:

pkg install tmux tmux new -s bot npm start # Press Ctrl+B then D to detach

VPS / Linux Server

5-7 min
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs git ffmpeg libvips-dev libwebp-dev git clone https://github.com/YOUR_USERNAME/iamlegendv2.git cd iamlegendv2 npm install cp sample.env .env nano .env # Add SESSION_ID & OWNER_NUMBER npm install -g pm2 pm2 start index.js --name iamlegendv2 pm2 save && pm2 startup

Heroku

Deploy to Heroku Deploy to Heroku

After clicking the button, configure these environment variables:

SESSION_ID=Stanytz378/iamlegendv2_abc123xyz OWNER_NUMBER=255618558502

Then click Deploy App to start the process.

Render

Deploy to Render Deploy to Render

Add these environment variables in the Render dashboard:

SESSION_ID=Stanytz378/iamlegendv2_abc123xyz OWNER_NUMBER=255618558502

Railway

Deploy to Railway Deploy to Railway

In the Variables tab, add:

SESSION_ID=Stanytz378/iamlegendv2_abc123xyz OWNER_NUMBER=255618558502

Koyeb

Deploy to Koyeb Deploy to Koyeb

Configure environment variables:

SESSION_ID=Stanytz378/iamlegendv2_abc123xyz OWNER_NUMBER=255618558502

Fly.io

Deploy to Fly.io Deploy to Fly.io

Set secrets via Fly CLI:

fly secrets set SESSION_ID=Stanytz378/iamlegendv2_abc123xyz fly secrets set OWNER_NUMBER=255618558502

Replit

Open in Replit

Add to Secrets (click the 🔒 lock icon in sidebar):

SESSION_ID=Stanytz378/iamlegendv2_abc123xyz OWNER_NUMBER=255618558502

Docker

# Build the image docker build -t iamlegendv2 . # Run the container docker run -d \ -e SESSION_ID=your_session_here \ -e OWNER_NUMBER=your_number_here \ -p 5000:5000 \ --name iamlegendv2 \ iamlegendv2

Windows / WSL

# In WSL Ubuntu terminal: sudo apt update curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs git ffmpeg libvips-dev git clone https://github.com/YOUR_USERNAME/iamlegendv2.git cd iamlegendv2 npm install cp sample.env .env nano .env # Add your credentials npm start

Database Options

MongoDB

Free tier available at MongoDB Atlas

MONGO_URL=mongodb+srv://...

MySQL

Self-hosted or cloud options available

MYSQL_URL=mysql://...

Troubleshooting

  • 🔍 Session ID not working? Ensure you include the full prefix: Stanytz378/iamlegendv2_
  • 🔄 Bot disconnects frequently? Check your internet connection and platform rate limits
  • 📦 "Cannot find module" error? Run npm install to install dependencies
  • 🚫 Commands not responding? Verify your OWNER_NUMBER is in international format
  • 💾 Data lost on restart? Configure a database for persistent storage

Need more help? Join our Support Group