Most Instagram DM automation guides end at “sign up for this SaaS tool.” This one is different. We're going to set up a bot that runs on your own server, replies to DMs in seconds, and costs you nothing beyond the server fee every month.
By the end of this guide, you'll have a working Instagram DM bot live on a Hostinger VPS. The whole process takes about an hour — and you only do it once.
Why self-host instead of using a SaaS tool?
Three reasons that matter if you're an Indian seller or agency:
- Cost. The cheapest decent SaaS Instagram DM tool costs ₹2,500–₹5,000/month. A VPS costs ₹299/month. Over a year, you save ₹26,000+.
- Data. SaaS tools store your leads and customer conversations on their servers. Self-hosting means that data never leaves your control.
- Safety. Many SaaS tools use shared IP pools. If someone else on the same pool gets flagged, your account gets painted with the same brush. Your own VPS has your own dedicated IP.
Step 1: Get your VPS (5 minutes)
We use and recommend Hostinger's KVM 1 plan. At ₹299/month, it gives you 1 vCPU, 4GB RAM, and 50GB SSD — more than enough to run the SocialAIFlow bot across 2–3 accounts.
Choose the Mumbai data center and Ubuntu 22.04 LTS as the operating system. During setup, set a strong root password and save it.
Step 2: Connect to your server (5 minutes)
Once your VPS is provisioned, open your terminal and run:
ssh root@YOUR_SERVER_IPUpdate system packages:
apt update && apt upgrade -yStep 3: Install Node.js (5 minutes)
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt install -y nodejs
node --version # Should show v18.x.xInstall PM2 to keep the bot running:
npm install -g pm2Step 4: Download and install the bot (10 minutes)
After purchasing, transfer the bot zip to your server:
scp socialaiflow-bot.zip root@YOUR_SERVER_IP:/root/Extract and install on the server:
cd /root
unzip socialaiflow-bot.zip
cd socialaiflow-bot
npm installStep 5: Configure your triggers (10 minutes)
cp config.example.json config.json
nano config.jsonYou'll see a file like this — fill in your credentials and write your replies:
{
"instagram": {
"username": "your_username_here",
"password": "your_password_here"
},
"triggers": [
{
"keyword": "price",
"reply": "Hi! Our product is ₹1,299 with free shipping. Want details?"
}
],
"settings": {
"reply_delay_min": 3,
"reply_delay_max": 8
}
}Write your replies the way you actually talk. “Hi! Happy to help 😊” converts better than “Greetings. Your query has been received.” The bot is answering for you — make it sound like you.
Step 6: Start the bot (2 minutes)
pm2 start npm --name "socialaiflow" -- start
pm2 save
pm2 startupCheck it's running:
pm2 statusYou should see socialaiflow with status online. Test it by sending your trigger keyword from a second Instagram account.
What to do in week one
- Monitor conversations daily for the first 3 days — you'll quickly find missing triggers to add.
- Add at least 10 keyword triggers covering your most common DM scenarios.
- Set up lead export (CSV) to keep records of everyone who messaged you.
- Test it from a second account once a day to make sure it's still running.