Skip to content

Deploy in VPS

Tuhin Kanti Pal edited this page Sep 18, 2021 · 11 revisions

Deploy Whatsbot in VPS or Local Machine is very simple.

Watch this tutorial on Youtube

Watch it on Youtube

Requirements :

  • VPS with SSH or Local Machine
  • MongoDB
  • YouTube Data API Key

Deploy :

1. You need a MongoDB, You can create it for free. Follow these steps πŸ‘‡

  • Open https://cloud.mongodb.com
  • Click the Try MongoDB Cloud Now Button
  • Now you can Fill the Form or Sign Up with Google
  • After Successfully Signed Up Type any Organization Name, Project Name and select any preferred language and click Continue
  • You can see a Pricing Page select Free and click Create a Cluster
  • Select any datacenter's location and any cloud service provider and click Create Cluster
  • Now you will see a cluster is creating
  • click Network Access in Sidebar & click Add IP Address
  • Now click ALLOW ACCESS FROM ANYWHERE and Confirm that
  • Click Database Access in Sidebar & click Add New Database User
  • Now in Password Authentication Method type a Username and a Password and click Add User
  • Click Clusters in Sidebar & click connect & Select Connect your application
  • Now you will see an URL containing mongodb+srv:// Copy that and replace < password > with Your Previously chosen password (If you used any special character in password you have to url encode the password)
  • You need this MongoDB URL to deploy Whatsbot

2. Now you need a Youtube Data API Key, Follow these steps πŸ‘‡

  • Open https://console.cloud.google.com/ & create a project
  • Go to Apis & Services and search Youtube Data Api you will found YouTube Data API v3 select that and enable that
  • Now again go to Apis & Services click Credentials and click CREATE CREDENTIALS & select API Key
  • An API Key will be displayed Copy That it will need while you deploy Whatsbot

3. Now Everything is ready you can Deploy it, Follow these steps πŸ‘‡

git clone https://github.com/TheWhatsBot/WhatsBot.git
  • Go To its directory
cd WhatsBot
  • Install Requirements
npm install
  • Run genToken.js and scan the QR using your Phone's Whatsapp Web and copy the output after a successful try
npm run gentoken
  • After authenticated see your personal chat on WhatsApp you will see your session.

  • Rename example.env to .env and fill everything

  • Start the server (Development)

npm start
  • Start the server (Using ForeverJS)
npm install forever -g
forever start main.js



You will not get any error if you follow these steps correctly. However, if you encountered any error, you can message at Whatsbot Support on Telegram.