Build Your Own WhatsApp CRM With AI and Automation

Turn WhatsApp Business into your own CRM with a shared inbox, contacts, pipelines, automations, and optional AI replies. Connect the official Meta API, Supabase, and Hostinger so the CRM stays online and works 24/7.

Roadmap & Resources

Requirements (Before You Start)

Install Node.js

Use the current LTS release. You will use it to install the Supabase CLI and to generate the CRM's encryption key.

Download Node.js

https://nodejs.org/en/download

Install Git

Download Git

https://git-scm.com/

Create a GitHub account

You will fork the CRM in Step 1 and connect your fork to Hostinger in Step 4.

Create GitHub Account

https://github.com/signup

Create a Supabase account

You will create the CRM's database and authentication project in Step 2.

Create Supabase Account

https://supabase.com/dashboard

Create a Meta Business account

You will connect the official WhatsApp Business API to it in Step 3.

Open Meta for Developers

https://developers.facebook.com

Get the Open-Source WhatsApp CRM

Fork the wacrm Repository

You do not need to build the CRM from scratch. For this guide, use wacrm, an open-source CRM built around the official WhatsApp Business API.

It already includes: - a shared WhatsApp inbox - contacts and tags - sales pipelines - message templates - broadcasts - no-code automations - team accounts - analytics - optional AI replies and a knowledge base

Open the wacrm repository on GitHub and click Fork to create your own copy.

Open ArnasDon/wacrm on GitHub

The open-source WhatsApp CRM used in this guide.

https://github.com/ArnasDon/wacrm

NOTE

This is important because your fork becomes the version you control, customize, and deploy.

Clone Your Fork

Open a terminal and run:

git clone https://github.com/YOUR_USERNAME/wacrm.git

cd wacrm

Replace YOUR_USERNAME with your GitHub username. You now have your own copy of the CRM.

IMPORTANT

Do not add API keys or passwords directly to GitHub. We will keep the sensitive values in environment variables instead.

Create the Supabase Backend

Create the Supabase Project and Copy Its API Values

The CRM needs a database and authentication system. For this project, that is handled by Supabase. Create a new Supabase project.

Open Supabase

https://supabase.com/dashboard

Then open:

Project Settings API

Copy the Project URL, the anon/public key, and the service role key. They will become:

NEXT_PUBLIC_SUPABASE_URL NEXT_PUBLIC_SUPABASE_ANON_KEY SUPABASE_SERVICE_ROLE_KEY

NEXT_PUBLIC_SUPABASE_URL

Project URL

NEXT_PUBLIC_SUPABASE_ANON_KEY

anon/public key

SUPABASE_SERVICE_ROLE_KEY

service role key

Get these values from Supabase

Open API Settings

https://supabase.com/dashboard/project/_/settings/api

IMPORTANT

Keep the service role key private. It is a server-side secret and must never be committed to the repository or exposed to the browser.

Apply the CRM Database

The repository already contains the database migrations required by the CRM. The easiest way to apply all current migrations without manually copying every SQL file is with the Supabase CLI. From the project folder, run:

npm install --global supabase

supabase login

supabase link --project-ref YOUR_PROJECT_REF

supabase db push

Replace YOUR_PROJECT_REF with the reference ID of your Supabase project.

Confirm the CRM Tables Exist

After the migrations finish, open the Table Editor in Supabase. You should now see tables for things such as:

Supabase Table Editor

contacts

conversations

messages

pipelines

broadcasts

automations

WhatsApp configuration

Generate the Encryption Key

The CRM encrypts sensitive credentials before storing them. Generate an encryption key:

node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Save the generated value. We will use it as:

ENCRYPTION_KEY

ENCRYPTION_KEY

The value the command printed

IMPORTANT

Do not lose or casually change this key after the CRM starts storing encrypted credentials. Keep it somewhere secure and out of the repository.

Connect the Official WhatsApp Business API

Create a Meta App and Add WhatsApp

Now connect the CRM to WhatsApp. Go to Meta for Developers and create a new app. Add the WhatsApp product and connect it to your Meta Business account.

Open Meta for Developers

https://developers.facebook.com

NOTE

Meta can provide a test WhatsApp number while you set everything up, so you do not have to move your real business number immediately.

Collect the WhatsApp Details

From the WhatsApp API setup, find:

Phone Number ID

WhatsApp Business Account ID

A temporary access token for initial testing

For production, create a System User inside Meta Business Settings and generate a long-lived access token with the required WhatsApp permissions.

NOTE

You will later enter these values directly inside the CRM, not in a file in your repository.

Get the Meta App Secret

In your Meta app, open:

App Settings Basic

Copy the App Secret. This becomes:

META_APP_SECRET

META_APP_SECRET

App Secret

IMPORTANT

Keep it private. The CRM uses this secret to verify that incoming webhook requests actually came from Meta.

NOTE

Do not configure the final webhook yet. First, we will deploy the CRM and get a real public HTTPS URL.

Deploy the CRM to Hostinger

Choose Node.js Hosting

A WhatsApp CRM should not depend on your computer staying turned on. Meta needs to send incoming message events to a public webhook, and your automations need the CRM to remain available even when your computer is off.

For this guide, deploy it with Hostinger Managed Node.js hosting. Choose a Hostinger plan that supports Node.js Web Apps.

Get Hostinger Node.js Hosting

Deploy the CRM from GitHub with production environment variables and keep it online 24/7.

USED IN THIS TUTORIAL

https://www.hostg.xyz/SHJyP

Create the Web App From Your Fork

Then open hPanel and go to:

Websites Add Website Deploy Web App

Choose the GitHub option and connect the repository you forked in Step 1.

Add the Environment Variables

Before the application builds, add:

NEXT_PUBLIC_SUPABASE_URL NEXT_PUBLIC_SUPABASE_ANON_KEY SUPABASE_SERVICE_ROLE_KEY ENCRYPTION_KEY META_APP_SECRET NEXT_PUBLIC_SITE_URL

Use the values you collected earlier.

NEXT_PUBLIC_SUPABASE_URL

Supabase Project URL

NEXT_PUBLIC_SUPABASE_ANON_KEY

Supabase anon/public key

SUPABASE_SERVICE_ROLE_KEY

Supabase service role key

ENCRYPTION_KEY

The encryption key you generated in Step 2

META_APP_SECRET

App Secret from your Meta app

NEXT_PUBLIC_SITE_URL

The live HTTPS URL of the CRM

Example NEXT_PUBLIC_SITE_URL

https://crm.yourdomain.com

IMPORTANT

Do not put your secrets directly inside the GitHub repository. Hostinger stores the environment variables separately from your code.

Deploy the Application

Finish the setup and let Hostinger install, build, and start the Node.js application.

Once deployment completes, open your CRM URL.

The CRM opens on its live HTTPS URL

The application starts without build or runtime errors

NOTE

You should now have a real cloud-hosted version of the application. Your computer no longer needs to stay running for the CRM to be available.

Update Supabase Authentication

Return to:

Supabase Authentication URL Configuration

Add your live CRM URL as the production site URL and an allowed redirect URL.

NOTE

This ensures login, account confirmation, and password-reset flows return users to the correct production website.

Finish the WhatsApp Connection

Enter Your WhatsApp Details in the CRM

Open your deployed CRM and create your account. Then go to:

Settings WhatsApp

Enter: - Phone Number ID - WhatsApp Business Account ID - System User access token

Create a random private string for the Verify Token. For example:

Example Verify Token

my-secure-whatsapp-verify-token

Save the configuration.

IMPORTANT

The Verify Token is a shared secret between Meta and your CRM. Use your own random value rather than the example, and keep it out of the repository.

Connect the Production Webhook

Return to your Meta app and open the WhatsApp webhook configuration. For the Callback URL, use:

Webhook Callback URL

https://YOUR-DOMAIN.com/api/whatsapp/webhook

Enter the Callback URL, using your own live CRM domain Enter the exact same Verify Token you entered inside the CRM Click Verify and Save Subscribe the webhook to the WhatsApp message events required by the CRM, including incoming messages and message-template status updates

Test a Real Message

Send a test WhatsApp message using your configured Meta test number or approved business number.

The conversation appears in the CRM Inbox

A reply sent from the CRM arrives inside WhatsApp

The person who messaged you appears under Contacts

The person who messaged you should now exist as a CRM contact instead of being only another phone number inside WhatsApp.

NOTE

At this point, WhatsApp and your CRM are connected.

Add Automation and AI

Create Your First Automation

Now turn the basic WhatsApp connection into something useful. Open:

Automations New Automation

For a simple first automation, choose: Trigger: Keyword Match

Use a keyword such as:

Keyword

pricing

Then add: Action: Send Message

Example Automatic Reply

Thanks for contacting us. I'll send you our pricing information.

Activate the automation.

Test the Automation

Now send a WhatsApp message containing:

Test Message

pricing

The CRM detects the keyword and automatically sends the reply

Plan More Advanced Automations

You can build much more advanced automations later, including:

Automation ideas: - automatically tagging new leads - assigning conversations to team members - creating deals in a sales pipeline - sending approved WhatsApp templates - triggering webhooks - adding conditions - waiting before the next action - following up with leads

IMPORTANT

If you use automation Wait steps, configure the automation cron job on Hostinger so delayed actions can resume at the correct time.

Add AI Replies

wacrm also includes an optional AI Assistant. Open the AI Assistant settings and connect your own OpenAI API key or Anthropic API key.

You can use AI to draft replies for an agent to review before sending them. You can also enable automatic AI replies.

For better answers, add information about your own business to the knowledge base, such as: - services - pricing information - opening hours - FAQs - shipping information - refund policies - product information

The AI can then use that information when helping answer WhatsApp conversations.

IMPORTANT

Start with AI-assisted drafts before enabling fully automatic replies.

Build Your CRM Workflow

You can now customize the CRM around your business. For example, create a simple sales pipeline:

New Lead ↓ Interested ↓ Proposal Sent ↓ Customer

Incoming WhatsApp conversations can become contacts, contacts can become deals, automations can handle repetitive work, and your team can manage everything from the same CRM.

Your Final Workflow

Customer sends a WhatsApp message ↓ Meta WhatsApp Business API ↓ Your CRM on Hostinger ↓ Contact + Conversation ↓ Automation / AI / Team Member ↓ Pipeline and Follow-Up

NOTE

You now have your own cloud-hosted WhatsApp CRM running through the official WhatsApp Business API instead of relying on a computer running WhatsApp Web.

Important — Costs & WhatsApp Rules

Open Source Does Not Mean Free to Run

wacrm is open-source software, but running the complete system is not necessarily free. Depending on how you use it, you may have costs for:

Possible ongoing costs: - hosting - Meta WhatsApp Business messaging - an AI provider if you enable AI features

WhatsApp Messaging Rules

IMPORTANT

WhatsApp has messaging rules. Free-form replies are generally used inside the active customer-service conversation window; outside that window, use Meta-approved message templates where required.