Installation Guide

Set Up Chattie
in Minutes

Follow this step-by-step guide to configure and deploy your AI-powered chat platform using Docker on an Ubuntu server.

💡 Note: We recommend using this documentation as your main guide. If you encounter any issues or get stuck during installation, you can use our Chat Agent to guide you through.

v1.3.3 Latest Stable Release
📋
Step 1

Prerequisites

Before you begin, ensure you have the following ready:

🖥️
Ubuntu Server
20.04 LTS or later
🐳
Docker & Docker Compose
Will be auto-installed if missing
🌐
Domain Name
Pointed to your server IP
☁️
Recommended Hosting
DigitalOcean
💡
We recommend DigitalOcean for hosting — sign up to get $200 free credit. To create a server:
  1. Click Create Droplet.
  2. Go to the Marketplace tab and select Docker on Ubuntu 24.04.
  3. Choose a plan with minimum 4 GB RAM
  4. Pick a datacenter region closest to your users and click Create Droplet.
⚠️
Important: Make sure to point your domain's DNS to the VPS IP address using an A record for @.
⚙️
Step 2

Configuration

All configuration is managed in a single file: .env. Open the .env file in the root directory (do NOT use .env.local as it's for development only) and fill in the following details:

General
Variable Description
DOMAIN Your domain name (e.g., chattie.com or app.chattie.com)
CERTBOT_EMAIL Your email for SSL certificate notifications
Supabase
Variable Description
NEXT_PUBLIC_DRIZZLE_DATABASE_URL Dashboard → Connect (in the navbar) → Session pooler (select in Method dropdown) → Copy connection string at port 5432
NEXT_PUBLIC_SUPABASE_URL Dashboard → Connect (in the navbar) → API keys → Project URL
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY Dashboard → Connect (in the navbar) → API keys → Copy Anon Key (Legacy)
Clerk Authentication
Variable Description
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY Your Clerk Publishable Key
CLERK_SECRET_KEY Your Clerk Secret Key
Payments
Variable Description
STRIPE_SECRET_KEY Your Stripe Secret Key
STRIPE_WEBHOOK_SECRET Your Stripe Webhook Secret
PAYPAL_CLIENT_ID Your PayPal Client ID
PAYPAL_CLIENT_SECRET Your PayPal Client Secret
PAYPAL_MODE Set to sandbox for testing or live for production
PAYPAL_WEBHOOK_ID Your PayPal Webhook ID
NEXT_PUBLIC_PAYPAL_CLIENT_ID Your PayPal Client ID (public)
AI
Variable Description
NEXT_PUBLIC_GEMINI_API_KEY API key for Google Gemini
🗄️
Step 3

Supabase Setup

  1. Create a new project
    Go to supabase.com and create a new project.
  2. Get Connection Details
    You must use the Session Pooler connection string.
    1. Go to your Supabase Project Dashboard.
    2. Click the Connect button in the navbar.
    3. Select Session Pooler in the Method dropdown.
    4. Copy the connection string:
    env
    postgresql://postgres.gvggdffyfuqspfyszhfg:[YOUR-PASSWORD]@aws-1-eu-west-1.pooler.supabase.com:5432/postgres
    ⚠️
    Replace [YOUR-PASSWORD] with your actual database password.
    5. In the same Connect modal, switch to the API Keys tab.
    6. Copy the Project URLNEXT_PUBLIC_SUPABASE_URL
    7. Copy the Anon KeyNEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY
🔐
Step 4

Clerk Setup

  1. Create a new application
    Go to clerk.com and create a new application.
  2. Enable sign-in providers
    Enable Email/Password and Google sign-in providers in your application settings.
  3. Copy API Keys
    Go to API Keys:
    • Copy the Publishable Key → paste as NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY
    • Copy the Secret Key → paste as CLERK_SECRET_KEY
💳
Step 5

Payment Processing - Stripe (Skip if you have the Regular License)

What is Stripe? Stripe is the industry-standard payment processing platform. It handles subscriptions, one-time payments, and provides powerful APIs for your SaaS billing.

  1. Create a Stripe Account
    1. Visit stripe.com.
    2. Click Sign up in the top right.
    3. Enter your email and create a password.
    4. Complete the account setup with your business information.
    5. You'll start in Test mode - perfect for development!
  2. Get Your Stripe Secret Key
    1. In your Stripe Dashboard, click Developers in the top right corner.
    2. Click API keys in the left menu.
    3. Make sure you're in Test mode (toggle at top).
    4. You'll see Publishable key (starts with pk_test_) and Secret key (starts with sk_test_).
    5. Click Reveal test key for the Secret key.
    6. Copy the Secret key → This is your STRIPE_SECRET_KEY.
  3. Create Webhook for Payment Events
    1. Still in the Developers section, click Webhooks in the left menu.
    2. Click + Add endpoint button.
    3. In Endpoint URL, enter:
    https://yourdomain.com/api/webhook/stripe
    (Replace yourdomain.com with your actual domain)
    4. Click Select events and select the following:
    • checkout.session.completed
    • customer.subscription.created
    • customer.subscription.updated
    • customer.subscription.deleted
    • invoice.payment_succeeded
    • invoice.payment_failed
    5. Click Add events then Add endpoint.
    6. Click on your newly created webhook.
    7. Find Signing secret and click Reveal.
    8. Copy this value → This is your STRIPE_WEBHOOK_SECRET.
🚀
Step 6

Installation & Deployment

  1. Compress the Project
    On your local machine, zip the entire project folder (including the .env file you just edited).
    💻
    Windows: Right-click the folder → Send to → Compressed (zipped) folder. Name it chattie.zip.
    Mac/Linux: Run zip -r chattie.zip . inside the project folder.
  2. Transfer to Server
    Use scp to upload the zip file to your server:
    bash
    scp path/to/chattie.zip root@YOUR_SERVER_IP:/root/
    Replace path/to/chattie.zip with the actual path and YOUR_SERVER_IP with your server's IP address.
  3. Connect to Server
    bash
    ssh root@YOUR_SERVER_IP
  4. Prepare the Server
    bash
    apt-get update
    apt-get install unzip
  5. Extract the Project
    bash
    unzip chattie.zip -d chattie-app
    cd chattie-app
  6. Run the Deployment Script
    bash
    chmod +x deploy.sh
    ./deploy.sh
    This script will automatically:
    • Install Docker and Docker Compose (if not installed)
    • Build and start the containers
    • Push the database schema and seed initial data
    • Set up SSL certificates if a valid domain is provided in .env
  7. Verify
    • Use docker compose logs -f to monitor the startup process
    • Open your domain in a browser to confirm everything is working
🔧
Help

Troubleshooting

View All Logs
Monitor all container output in real-time
docker compose logs -f
View App Logs Only
Filter logs for just the application container
docker compose logs -f app
Re-deploy
After changing the .env file, rebuild
./deploy.sh
Restart Containers
Quick restart without rebuilding
docker compose restart
SSL Certificate Failed?
Make sure your domain DNS (A record) points to your server's IP, then run the deploy script again
./deploy.sh