Skip to main content
This guide will help you set up a self-hosted instance of PingPilot. Perfect for developers who want full control over their event monitoring infrastructure.
Looking to just use PingPilot? Check out the Quickstart guide instead. This installation guide is for self-hosting the platform.

Prerequisites

Before you begin, ensure you have the following installed:
  • Node.js v18 or higher
  • npm or pnpm package manager
  • PostgreSQL database (local or hosted like Neon)
  • Git for version control
We recommend using Neon for PostgreSQL as it provides serverless Postgres with a generous free tier.

Clone the Repository

Start by cloning the PingPilot repository:
git clone https://github.com/vishnu-mouli-102408/ping-pilot.git
cd ping-pilot

Install Dependencies

Install all required packages:
npm install
The postinstall script will automatically run prisma generate to set up the database client.

Environment Configuration

1

Create Environment File

Create a .env file in the root directory:
cp .env.example .env
2

Configure Database

Add your PostgreSQL connection string:
.env
DATABASE_URL="postgresql://user:password@host:5432/pingpilot?sslmode=require"
3

Configure Clerk Authentication

PingPilot uses Clerk for authentication. Set up your Clerk application:
  1. Create a free account at clerk.com
  2. Create a new application
  3. Copy your API keys from the Clerk dashboard
  4. Add them to your .env file:
.env
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_..."
CLERK_SECRET_KEY="sk_test_..."
Never commit your CLERK_SECRET_KEY to version control. Keep it secure and use environment variables in production.
4

Configure Discord Bot

To send Discord notifications, create a Discord bot:
  1. Go to Discord Developer Portal
  2. Click “New Application” and give it a name
  3. Navigate to the “Bot” section
  4. Click “Reset Token” to get your bot token
  5. Add the token to your .env file:
.env
DISCORD_BOT_TOKEN="your_discord_bot_token_here"
  1. Enable the following Privileged Gateway Intents:
    • Presence Intent
    • Server Members Intent
    • Message Content Intent
5

Configure Telegram Bot (Optional)

For Telegram notifications:
  1. Message @BotFather on Telegram
  2. Send /newbot and follow the instructions
  3. Copy the bot token provided
  4. Add it to your .env file:
.env
TELEGRAM_BOT_TOKEN="your_telegram_bot_token_here"
6

Configure Email (Optional)

For email notifications, configure an SMTP provider:
.env
SMTP_HOST="smtp.gmail.com"
SMTP_PORT="587"
SMTP_USER="[email protected]"
SMTP_PASSWORD="your-app-password"
SMTP_FROM="[email protected]"
For Gmail, you’ll need to generate an App Password instead of using your regular password.
7

Configure Stripe (Optional)

If you want to enable paid plans:
  1. Create a Stripe account
  2. Get your API keys from the dashboard
  3. Add them to your .env file:
.env
STRIPE_SECRET_KEY="sk_test_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
8

Configure Redis (Optional)

For caching and improved performance, add Redis:
.env
REDIS_URL="your_upstash_redis_url"
REDIS_TOKEN="your_upstash_redis_token"
We recommend Upstash Redis for serverless Redis.

Database Setup

Set up your database schema using Prisma:
1

Run Migrations

npx prisma migrate dev
This will:
  • Create all necessary tables (User, Event, EventCategory, Quota)
  • Set up relationships and indexes
  • Generate the Prisma Client
2

Verify Database

Open Prisma Studio to view your database:
npx prisma studio
This opens a visual database browser at http://localhost:5555.

Run the Application

Start the development server with hot reload:
npm run dev
Your application will be available at http://localhost:3000.
The development server includes hot module replacement for faster development.

Deployment Options

PingPilot can be deployed to various platforms:

Post-Deployment

1

Test Your Deployment

  1. Visit your deployed URL
  2. Create a test account
  3. Set up a category and send a test event
  4. Verify notifications are working
2

Set Up Monitoring

Monitor your application health:
  • Enable Vercel Analytics
  • Set up error tracking (e.g., Sentry)
  • Monitor database performance
  • Track API response times
3

Configure Domain (Optional)

Add a custom domain:
  1. Purchase a domain from your preferred registrar
  2. Add it in your hosting platform’s dashboard
  3. Update DNS records as instructed
  4. Enable SSL (usually automatic)

Environment Variables Reference

Here’s a complete list of all environment variables:
.env
# Database
DATABASE_URL="postgresql://user:password@host:5432/pingpilot"

# Authentication (Clerk)
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_..."
CLERK_SECRET_KEY="sk_test_..."

# Notifications
DISCORD_BOT_TOKEN="your_discord_bot_token"
TELEGRAM_BOT_TOKEN="your_telegram_bot_token"

# Email (Optional)
SMTP_HOST="smtp.gmail.com"
SMTP_PORT="587"
SMTP_USER="[email protected]"
SMTP_PASSWORD="your-app-password"
SMTP_FROM="[email protected]"

# Payments (Optional)
STRIPE_SECRET_KEY="sk_test_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."

# Caching (Optional)
REDIS_URL="your_upstash_redis_url"
REDIS_TOKEN="your_upstash_redis_token"

Troubleshooting

  • Verify your DATABASE_URL is correct
  • Check that your database server is running
  • Ensure your IP is whitelisted (for hosted databases)
  • Try connecting with npx prisma db pull to test the connection
  • Clear .next folder: rm -rf .next
  • Delete node_modules and reinstall: rm -rf node_modules && npm install
  • Check that all environment variables are set
  • Run npx prisma generate manually
  • Verify your bot token is correct
  • Ensure the bot has necessary permissions
  • Check that Privileged Gateway Intents are enabled
  • The bot must be able to send DMs to users
Change the port in package.json or use:
PORT=3001 npm run dev

Next Steps

API Reference

Learn how to integrate PingPilot into your applications

Architecture

Understand how PingPilot works under the hood

Contributing

Contribute to the PingPilot open-source project

Support

Get help from the community or report issues

Build docs developers (and LLMs) love