This guide is designed for the easiest setup.
- Open settings.js on GitHub.
- Edit the
botNameandownerNumberdirectly in the file. - Commit changes (Save the file).
- Go to your Render Dashboard.
- Click the "New +" button and select "Web Service".
- Connect your GitHub Repository.
- Fill in these details (Select Docker):
- Name:
knightbot - Environment:
Docker
- Name:
- Click "Advanced" and add ONE Environment Variable:
- Key:
SESSION_ID - Value: (Paste your Session string starting with
KnightBot;;)
- Key:
- Click "Deploy Web Service".
- Wait about 2–3 minutes for the "Build" to finish.
- Click on the "Logs" tab on the left side of your Render screen.
- Look for a line that says:
Your Pairing Code : XXXX-XXXX. - Open WhatsApp on your phone:
- Go to Settings -> Linked Devices -> Link a Device.
- Tap "Link with phone number instead" at the bottom.
- Enter the 8-digit code you saw in the Render logs.
Render's free version "remembers" your login for only 24 hours. To make it permanent:
- Once you link the bot, the bot will send YOU a message on WhatsApp.
- Check your own WhatsApp chat (or the chat from the bot number).
- Look for a message saying: "🤖 Session ID Generated!".
- Copy that long string (starting with
KnightBot;;). - Go back to Render -> Settings -> Environment Variables.
- Click "Add Environment Variable":
- Key:
SESSION_ID - Value: (Paste the long string you copied)
- Key:
- Click "Save Changes".
Your bot is now 100% setup. It will stay online even if you turn off your phone or if Render restarts the service.
If you see a red error at the bottom that says "This action is not allowed", it is usually because:
- One Free Service Limit: Render allows only one free web service per account. If you already have a bot or website running on Render, you must delete it first before creating this new one.
- Verification: Make sure you have verified your email address with Render.
Need to Link Again?
If you ever log out, just delete the SESSION_ID variable in Render Settings and repeat from Step 2.