Skip to main content
Get your first Botpress bot up and running in minutes. This guide takes you from installation to deployment with real working code.

Prerequisites

Before you begin, make sure you have:
  • Node.js 18.0.0 or higher installed on your machine
  • A Botpress Cloud account (sign up at app.botpress.cloud)
  • Your Personal Access Token from Botpress Cloud
Find your Personal Access Token in the Botpress Cloud dashboard under your profile settings.

Install the Botpress CLI

1

Install the CLI globally

Choose your preferred package manager:
2

Verify installation

Confirm the CLI is installed correctly:
You should see the version number displayed.
3

Authenticate with Botpress Cloud

Log in to connect your CLI to your Botpress workspace:
When prompted:
  1. Enter your Personal Access Token
  2. Select your workspace from the list
The CLI caches your credentials locally, so you only need to log in once per machine.

Create your first bot

1

Initialize a new bot project

Create a new bot using the interactive CLI:
When prompted:
  • Project type: Select bot
  • Template: Choose empty-bot (default)
  • Name: Enter a name like my-first-bot
This creates a new directory with your bot’s scaffolding.
2

Navigate to your bot directory

3

Understand the project structure

Your bot contains two key files:bot.definition.ts - Defines your bot’s configuration:
bot.definition.ts
src/index.ts - Your bot’s implementation:
src/index.ts

Add bot functionality

Let’s make your bot respond to messages with a friendly greeting.
1

Add a message handler

Edit src/index.ts to handle incoming messages:
src/index.ts
The bot.on.message('*', ...) handler listens for all incoming messages. You can also listen for specific message types like bot.on.message('text', ...).

Test your bot locally

1

Start the development server

Run your bot in development mode:
This command:
  • Builds your bot
  • Starts a local development server
  • Creates a tunnel to Botpress Cloud
  • Deploys a dev version of your bot
  • Watches for file changes and auto-reloads
The bp dev command is experimental and subject to breaking changes. Always check the output for any errors.
2

Test in Botpress Cloud

Once the dev server is running, you’ll see output like:
  1. Open the Botpress Cloud dashboard
  2. Navigate to your dev bot (marked with a dev badge)
  3. Open the Emulator or Web Chat
  4. Send a message - your bot will respond with “Hello, World!”
3

Make changes and watch them reload

The dev server automatically reloads when you save changes:
  1. Edit src/index.ts to customize the greeting
  2. Save the file
  3. The bot rebuilds automatically
  4. Test your changes in the emulator
Press Ctrl+C in your terminal to stop the dev server.

Deploy to production

1

Deploy your bot

When you’re ready to deploy to production:
This command:
  • Builds your bot for production
  • Prompts for confirmation
  • Deploys to Botpress Cloud
  • Returns a bot ID
The first time you run bp deploy, it creates a new bot. Subsequent deploys update the existing bot.
2

Verify deployment

After deployment, you’ll see:
Your bot is now live and ready to connect to channels like Telegram, Slack, WhatsApp, and more.

Troubleshooting

Botpress requires Node.js 18.0.0 or higher. Check your version:
If needed, upgrade Node.js from nodejs.org.
This usually means your Personal Access Token is invalid or expired:
  1. Generate a new token in Botpress Cloud
  2. Run bp login again
  3. Enter the new token
Common causes:
  • Port already in use: The default port (8075) might be occupied. Specify a different port:
  • Build errors: Check the terminal output for TypeScript errors and fix them before running bp dev.
Try these steps:
  1. Wait a few seconds after saving - the rebuild takes time
  2. Refresh the Botpress Cloud dashboard
  3. Clear your browser cache
  4. Restart the dev server with Ctrl+C then bp dev
Ensure you’re logged in and have the correct permissions:
Check that your bot.definition.ts has no validation errors.

Next steps

Add integrations

Learn how to add pre-built integrations like Slack, OpenAI, and more to your bot

Build bots

Learn about bot configuration, handlers, and advanced features

Integration hub

Browse 67+ pre-built integrations available for your bots

SDK reference

Explore the full TypeScript SDK API documentation