AHMEDX
Guide

How to Deploy WhatsApp Bot on Heroku: Complete Beginner Friendly Guide

Want to deploy a WhatsApp MD bot on Heroku? If you have a bot project on GitHub and want to run it on cloud hosting instead of keeping your personal computer switched on, Heroku is one platform you may consider. Heroku is a cloud application platform that runs applications inside containers called dynos. It supports applications built with technologies such as Node.js, making it relevant to many JavaScript based WhatsApp MD bot projects.

By AHMED X · November 12, 2026

Guide

Complete Beginner Friendly Guide

Want to deploy a WhatsApp MD bot on Heroku?

Want to deploy a WhatsApp MD bot on Heroku? If you have a bot project on GitHub and want to run it on cloud hosting instead of keeping your personal computer switched on, Heroku is one platform you may consider.

Heroku is a cloud application platform that runs applications inside containers called dynos. It supports applications built with technologies such as Node.js, making it relevant to many JavaScript based WhatsApp MD bot projects.

However, deploying a WhatsApp bot on Heroku requires more than uploading source code. You need to configure authentication, set environment variables, install the correct buildpacks, configure the application process, and check the deployment logs.

This guide explains the complete Heroku deployment process in beginner friendly English, including Session ID configuration, worker processes, common errors, and important storage limitations.

Guide

What Is Heroku?

Heroku is a cloud platform that allows developers to deploy and run applications without managing a complete physical server.

Heroku is a cloud platform that allows developers to deploy and run applications without managing a complete physical server.

Applications run inside isolated containers called dynos.

A dyno provides the environment required to execute your application.

For example, a WhatsApp MD bot built with Node.js can run inside a suitable Heroku dyno if its dependencies and process configuration are compatible.

Heroku provides different process types:

Web dynos: Handle incoming HTTP requests.

Worker dynos: Run background applications and tasks.

One off dynos: Execute temporary tasks.

For many WhatsApp MD bots, a worker process is the relevant option because the bot needs to maintain a WhatsApp connection and process messages in the background.

Deployment

What Do You Need Before Deploying a WhatsApp Bot on Heroku?

Heroku account: Create and manage your application

Heroku account:Create and manage your application

GitHub account:Access the bot source code

Original bot repository:Obtain application files

Session ID:Authenticate the WhatsApp connection when supported

Node.js configuration:Specify the required runtime

Buildpacks:Install the required application environment

Config Vars:Store authentication and bot settings

Procfile:Define the application process

Important: Not every WhatsApp bot supports Heroku deployment. Check the original GitHub README before proceeding.

Step 1: Choose a WhatsApp MD Bot From GitHub

First, find the WhatsApp MD bot you want to deploy.

Many developers publish their bot projects on GitHub.

Before choosing a repository, check:

Whether the repository is maintained.

Whether the README contains Heroku instructions.

Whether the project supports Node.js.

Whether it supports Session ID authentication.

Whether it includes a Procfile.

Whether the required dependencies are documented.

Whether the developer provides any additional buildpack requirements.

Guide

Read the README

The README is particularly important because different bots have different deployment requirements.

The README is particularly important because different bots have different deployment requirements.

Look for sections covering:

Installation.

Heroku deployment.

Authentication.

Environment variables.

Buildpacks.

Process configuration.

Troubleshooting.

Some repositories provide a Heroku deployment template button. Others require you to create an application manually.

Do not assume that every GitHub project supports automatic deployment.

Step 2: Fork the Bot Repository on GitHub

A fork creates your own copy of an existing GitHub repository.

This is useful because you can connect your repository to Heroku and manage your own version of the application.

Follow these steps:

Open the original bot repository.

Find the Fork option.

Select your GitHub account.

Create your fork.

Wait for GitHub to finish copying the repository.

Check that your fork contains the required application files.

You should now have your own copy of the bot source code.

What can go wrong?

If the repository is unavailable, private, or restricted, you may not be able to fork it.

If the fork is missing important files, check whether you selected the correct repository.

Step 3: Create a Heroku Application

Now open the official Heroku website.

Sign in to your account.

The general process is:

Open the Heroku Dashboard.

Find the option to create a new application.

Enter an available application name.

Select the appropriate deployment region if requested.

Create the application.

Your Heroku application will provide the environment where the WhatsApp bot runs.

The application name is separate from your WhatsApp bot name.

Connect Your GitHub Repository

After creating the application:

Open its deployment settings.

Find the GitHub deployment option.

Connect your GitHub account if necessary.

Search for your forked bot repository.

Select the correct repository.

Connect it to the Heroku application.

Some projects may provide a deployment template button that automatically prepares part of this process.

Use that option only when the original developer documents it.

What can go wrong?

GitHub account authorization may fail.

The repository may not appear.

The selected repository may be incorrect.

The deployment configuration may be incomplete.

Check your GitHub connection and repository permissions if this happens.

Step 4: Configure Heroku Config Vars

This is one of the most important deployment steps.

Config Vars are configuration values stored separately from your application source code.

Heroku makes these values available to your application as environment variables.

Many WhatsApp MD bots use environment variables for authentication and application settings.

Depending on the project, you may need to configure:

Session ID:WhatsApp authentication

Owner number:Identifies the administrator

Prefix:Command starting symbol

Mode:Public or private operation

Bot name:Application identity

API keys:External service authentication

These are examples of configuration categories, not universal variable names.

Always use the exact variable names documented in your bot's README.

How to Add Config Vars

Open your Heroku application.

Navigate to Settings.

Find the Config Vars section.

Select the option to add a variable.

Enter the variable name required by the project.

Enter the corresponding value.

Save the configuration.

Repeat this process for each required variable.

Example of Configuration Structure

The following is a conceptual example, not a ready to use configuration:

SESSION_ID = YOUR_SESSION_VALUE OWNER_NUMBER = YOUR_OWNER_NUMBER PREFIX = YOUR_DOCUMENTED_PREFIX MODE = YOUR_DOCUMENTED_MODE

Replace the placeholders with the actual values and variable names required by your project.

Never copy another bot's configuration blindly.

Important Session ID Advice

If your bot uses Session ID authentication, configure the credential using the method documented by its developer.

Keep it private.

Do not publish your Session ID in GitHub repositories, screenshots, or public support groups.

What can go wrong?

If a required variable is missing or its name is incorrect, the application may crash during startup.

Check the README and compare each required variable with the values saved in Heroku.

Step 5: Configure the Required Buildpacks

Buildpacks provide the software environment Heroku uses to prepare an application for execution.

For a JavaScript based WhatsApp MD bot, the Node.js buildpack is generally the starting point.

Some projects may require additional software.

For example, certain media features may depend on external media processing tools.

However, do not install extra buildpacks unless the original project documentation requires them.

How to Add Buildpacks

Open your Heroku application.

Navigate to Settings.

Find the Buildpacks section.

Select the option to add a buildpack.

Add the documented Node.js buildpack.

Add any additional documented buildpacks.

Check the buildpack order.

If multiple buildpacks are required, follow the ordering instructions in the README.

For example, a project may require:

Node.js buildpack first.

Additional media processing buildpack afterward, if documented.

The exact requirements depend on the project.

What Can Go Wrong?

Buildpack missing: Heroku may not recognize the application runtime.

Incorrect order: A required software component may not be available during the build.

Unnecessary buildpacks: Extra buildpacks can complicate the build process.

Check the repository documentation before changing the configuration.

Step 6: Configure the Procfile and Worker Process

This is an especially important step for WhatsApp MD bots.

A Procfile tells Heroku which commands to execute when starting application processes.

Heroku recognizes different process types, including web and worker.

A web process handles incoming HTTP traffic, while a worker process is generally used for background tasks.

Many WhatsApp bots are background applications rather than traditional websites.

Check the Project's Procfile

Open your GitHub repository and look for a file named:

Procfile

It should be located in the project root directory.

A project may define its background process using a worker entry.

The exact startup command must come from the project's documentation.

For illustration only:

worker: YOUR_DOCUMENTED_START_COMMAND

Do not replace the actual startup command with an invented one.

Guide

Should You Turn On Worker or Web?

For a bot designed to run entirely in the background:

For a bot designed to run entirely in the background:

The worker process generally needs to be enabled.

The web process may remain disabled if the application does not require an HTTP server.

However, some projects provide a web dashboard, authentication page, or health check server.

Those applications may require both process types.

Follow the project's Procfile and deployment documentation.

Guide

How to Enable the Worker

Check that its status changes to running.

Open your Heroku application.

Navigate to the Resources section.

Find the worker process.

Enable the documented worker process.

Check that its status changes to running.

A worker process does not necessarily start automatically just because it is declared in the Procfile. Heroku requires the process to be enabled in the application formation.

Step 7: Deploy the WhatsApp Bot

After completing the configuration, you can deploy the source code.

If your GitHub repository is connected, the general process is:

Open the Deploy section.

Select your connected repository.

Choose the required deployment branch.

Start the deployment.

Wait for the build process to complete.

Heroku will prepare the application using the configured buildpacks and dependencies.

It will then create a build artifact and use it to start the configured processes.

Check the Build Result

A successful deployment should complete the build process without fatal errors.

If the build fails, open the deployment output and identify the first meaningful error.

Do not repeatedly deploy without correcting the problem.

Step 8: Open Heroku Logs and Check the Connection

After deployment, check the application logs.

Logs help you understand what is happening inside the application.

Open your Heroku application and navigate to its log viewing section.

Look for messages related to:

Application startup.

Node.js execution.

Authentication.

WhatsApp connection.

Plugin loading.

Application crashes.

Missing configuration.

Guide

What Does a Successful Connection Look Like?

Do not rely on a website loading successfully as proof that the WhatsApp bot is connected.

The exact messages depend on the bot.

You should look for evidence that:

The application started.

The required configuration was loaded.

Authentication succeeded.

The WhatsApp connection was established.

The worker process remains running.

Do not rely on a website loading successfully as proof that the WhatsApp bot is connected.

A bot may operate entirely through a worker process without serving a website.

Step 9: Test the Bot on WhatsApp

Once the logs indicate that the application is running, test it through WhatsApp.

Send a documented basic command using the correct prefix.

For example, if the project documents a help command, use its actual command syntax.

Check whether:

The bot receives the message.

The command is recognized.

The bot responds.

The logs show message activity.

The worker remains active.

If the bot connects but does not respond, investigate its command handler, configuration, and logs.

Do not assume the deployment has failed simply because one plugin does not work.

Important: Understand Heroku's Temporary File System

This is one of the biggest things WhatsApp bot developers need to understand before choosing Heroku.

Heroku dynos have an ephemeral file system.

Ephemeral means temporary.

Files created or changed while an application is running can disappear when its dyno stops or restarts. Each new dyno starts with a fresh copy of the deployed application.

Why Is This a Problem for WhatsApp MD Bots?

Many WhatsApp MD bots save authentication information inside a local session folder.

For example, a project may use a folder such as:

auth_info_baileys

If the bot stores its only authentication copy in the temporary dyno file system, that information may disappear after a restart.

The bot may then require authentication again.

Session ID

Why Do Some Projects Use Session ID Authentication?

Session ID based authentication can help projects restore their WhatsApp connection without depending entirely on a local session folder that was created during an earlier run.

Session ID based authentication can help projects restore their WhatsApp connection without depending entirely on a local session folder that was created during an earlier run.

However, this depends on how the developer implemented session restoration.

A Session ID stored as a Heroku Config Var is separate from files written to the dyno's temporary file system.

This does not mean every session implementation is automatically persistent or guaranteed to work after every restart.

Always follow the original developer's session storage instructions.

What Should You Do?

Use the documented Session ID authentication method when supported.

Keep secure backups of authentication information.

Avoid treating local dyno files as permanent storage.

Check whether the project supports persistent external storage.

Test authentication after a restart.

Guide

Does Heroku Keep WhatsApp Bots Running All the Time?

Heroku manages application processes through dynos.

Heroku manages application processes through dynos.

Depending on the selected runtime resources and configuration, applications may sleep, restart, or stop when resource limits are reached.

Some dyno configurations sleep after inactivity, while other configurations are designed to remain active. Heroku also performs automatic dyno cycling and restarts.

For WhatsApp bots, this matters because a disconnected worker may stop responding to messages.

Before deploying, check:

Whether your selected dyno configuration supports the required runtime.

Whether the worker process is enabled.

Whether the application is reaching memory limits.

Whether the process is crashing.

Whether automatic restarts are occurring.

Whether your application has sufficient available resources.

There is no guarantee that a WhatsApp bot will remain continuously connected simply because its deployment completed successfully.

Deployment

Common Heroku Deployment Errors and How to Fix Them

Even after following all the steps, you may encounter errors.

Even after following all the steps, you may encounter errors.

Here are some common problems and their solutions.

1. Build Failed

A build failure means Heroku could not successfully prepare your application.

Possible reasons:

Incorrect Node.js version.

Missing dependencies.

Incorrect buildpack.

Dependency installation errors.

Missing project files.

Solution:

Open the build logs and find the first actual error. Check the Node.js requirements and buildpack configuration in the README.

2. Application Crashed

This usually means the application started but encountered an error during execution.

Possible reasons:

Missing environment variables.

Invalid Session ID.

Incorrect startup command.

Application memory problems.

Missing configuration files.

Solution:

Open the application logs and check the first error generated by the application.

3. Missing Config Var

The application may require a Session ID, owner number, or another configuration value.

If the required variable is missing, the application may stop during startup.

Solution:

Open Settings, check Config Vars, and compare them with the original README.

Pay attention to spelling and capitalization.

4. Worker Is Not Running

Your application may deploy successfully while the worker remains stopped.

Solution:

Open Resources and check the worker process.

Enable the documented worker process if it is not running.

5. WhatsApp Session Disconnects After Restart

This can happen when authentication information is stored only in the temporary file system.

Solution:

Check whether the project supports Session ID restoration or another persistent authentication method.

Do not repeatedly generate new sessions without understanding why the previous session was lost.

6. Bot Connects but Does Not Reply

Possible reasons include:

Incorrect command prefix.

Disabled command handler.

Incorrect operating mode.

Missing plugins.

Message processing errors.

Solution:

Test a documented basic command and inspect both the worker logs and project configuration.

FAQs

Frequently Asked Questions About Deploying WhatsApp Bot on Heroku

Answers to the questions readers ask most about this topic.

No. The project must be compatible with Heroku's runtime, dependencies, process configuration, and storage environment. Check the original GitHub README before deploying.

Not always. Some projects use Session ID authentication, while others use QR authentication. The required method depends on the developer's implementation.

One possible reason is the temporary file system. If authentication information is stored only in local files, it may disappear after a restart. Other causes include application crashes and resource limitations.

For a background WhatsApp bot, the worker process is generally the relevant process. A web process is needed only if the project requires an HTTP server or web interface. Follow the original Procfile instructions.

It depends on your dyno configuration, available resources, application stability, and authentication storage. Check the current Heroku documentation and test the application after restarts before relying on it for continuous operation.

Deployment

Safety Guide Before Deploying a WhatsApp Bot on Heroku

Before connecting your WhatsApp account, follow these precautions.

Before connecting your WhatsApp account, follow these precautions.

Use a separate number: Consider testing with a separate WhatsApp number instead of your primary personal or business account. This reduces the impact on your main account but does not guarantee protection.

Protect your Session ID: Never publish authentication credentials in GitHub repositories or public groups.

Secure Config Vars: Store private credentials in Heroku configuration rather than hardcoding them into source files.

Verify GitHub repositories: Download code from the original developer.

Review buildpacks: Only install additional software documented by the project.

Back up authentication information: Keep secure backups outside the temporary dyno file system.

Avoid spam: Do not automate unsolicited bulk messaging or abusive activities.

Understand the ban risk: Unofficial WhatsApp automation may result in temporary restrictions or permanent account bans.

Monitor logs: Regularly check application errors, authentication status, and unexpected restarts.

Check Linked Devices: Remove connections you no longer recognize or need.

Conclusion

Conclusion

Deploying a WhatsApp bot on Heroku can be a useful way to run a compatible Node.js based MD bot in the cloud.

Deploying a WhatsApp bot on Heroku can be a useful way to run a compatible Node.js based MD bot in the cloud.

The general process is straightforward:

Select an original GitHub repository.

Fork the project.

Create a Heroku application.

Connect GitHub.

Configure the required Config Vars.

Add the documented buildpacks.

Configure the worker process.

Deploy the application.

Check logs and test the WhatsApp connection.

However, remember the two important Heroku limitations: dyno storage is temporary, and application availability depends on your runtime configuration and available resources.

Pay particular attention to Session ID storage and worker configuration. These two areas are especially important for WhatsApp MD bots.

For more WhatsApp MD bot tutorials, pairing guides, and deployment resources, explore the AHMED X blog.

Disclaimer: WhatsApp MD bots are unofficial third party applications developed independently by their respective creators. This article is published by AHMED X for educational and informational purposes only. AHMED X is not affiliated with or endorsed by WhatsApp or Meta. WhatsApp is a trademark of its respective owner. Use unofficial WhatsApp automation at your own risk.

Guide

Official Heroku Resources

For additional technical information, consult these official resources:

For additional technical information, consult these official resources:

How Heroku Works

Heroku Dynos and App Containers

Heroku Procfile Documentation

Heroku Dyno Isolation and Temporary Storage

Heroku Dyno Configuration

Bots

Bots You Can Deploy Free

Every bot below deploys the same way on AHMED X: pair site for the session ID, one deploy flow, no server.

ASTRA X

ASTRA X

WhatsApp MD Bot

Advanced AI-first MD bot with dual AI engines, media downloaders and deep group management.

Geston-MD

Geston-MD

WhatsApp MD Bot

Lightning-fast Baileys multi-device bot with AI chat, group protection and replies in many languages.

CELESTIA

CELESTIA

WhatsApp MD Bot

A polished multi-device WhatsApp bot with a large command library, AI chat and safe group tools.

TOXIC-MD

TOXIC-MD

WhatsApp MD Bot

Lightning-fast WhatsApp bot built on Baileys, made for speed and everyday automation.

SUKUNA-MD

SUKUNA-MD

WhatsApp MD Bot

A modular WhatsApp MD bot with group administration, media tools, protection engines and AI voice replies.

Levanter

Levanter

WhatsApp MD Bot

Multi-device WhatsApp bot packed with group protection, AI chat and a plugin system.

View all bots in the catalog

Keep Reading

Related WhatsApp Bot Guides

More free WhatsApp bot guides from the AHMED X blog.

Guide

How to Deploy WhatsApp Bot on Panel: Complete Beginner Friendly Guide

Want to deploy your WhatsApp MD bot using a hosting panel? If you have downloaded a bot from GitHub but do not want to manage everything through a computer terminal, a bot hosting panel can make the process easier. A hosting panel provides a web interface where you can upload files, configure startup settings, install dependencies, monitor logs, and control your application.

Read the guide
Guide

How to Make a WhatsApp Bot for Free: Complete Beginner Guide

Have you ever wanted to create your own WhatsApp bot but thought you needed expensive software, a paid developer, or a powerful server? The good news is that you can make a WhatsApp MD bot for free using open source projects, JavaScript, and freely available development tools. You do not need to build everything from zero. You can start with an existing bot, customize a base bot template, or write your own bot using JavaScript and the Baileys library.

Read the guide
Guide

MD Bot File: Complete Beginner Guide to WhatsApp MD Bot Files

Are you searching for an MD bot file to download and use for your WhatsApp account? If you are new to WhatsApp MD bots, you might be wondering what these files contain, where to download them, and how to know whether a file is genuine or dangerous. An MD bot file is generally a package containing the source code and supporting files required to run a WhatsApp Multi Device bot.

Read the guide

Your Free WhatsApp Bot Is Minutes Away

Pick a bot, grab a session ID from its pair site, and deploy free on AHMED X. No server, no coding.

Browse Free Bots