Deploy Next.js Supabase to sherpa.sh

Deploy your MakerKit Next.js Supabase application to sherpa.sh, a cost-effective platform for Next.js applications with responsive support.

Deploy your MakerKit Next.js 16 application to sherpa.sh, a bootstrapped hosting platform built specifically for Next.js. sherpa.sh offers competitive pricing, responsive founder support, and direct integration with the MakerKit community.

Video Tutorial

Watch the step-by-step deployment process:


Prerequisites

Before deploying:

  1. Set up your Supabase project
  2. Generate environment variables
  3. Push your code to GitHub

Step 1: Create sherpa.sh Account

  1. Go to sherpa.sh
  2. Create a new account
  3. Link your GitHub account or organization containing your MakerKit repository

Step 2: Import Project

  1. Click New Project
  2. Select your MakerKit repository from the list
  3. Proceed to build configuration

Step 3: Configure Build Settings

Configure your build settings exactly as shown:

Click to expand

Required Settings

SettingValue
Framework PresetNext.js
Install Commandpnpm install
Build Commandpnpm run build
Output Directoryapps/web
Root Directoryapps/web

Video reference: Build settings configuration


Step 4: Set Environment Variables

Add your production environment variables in the sherpa.sh project settings.

Generate your variables using:

pnpm turbo gen env

Copy the contents of turbo/generators/templates/env/.env.local to sherpa.sh.

Required Variables

# Application
NEXT_PUBLIC_SITE_URL=https://yourdomain.com
NEXT_PUBLIC_PRODUCT_NAME=Your App Name
# Supabase
NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLIC_KEY=eyJ...
SUPABASE_SECRET_KEY=eyJ...
# Billing
NEXT_PUBLIC_BILLING_PROVIDER=stripe
STRIPE_SECRET_KEY=sk_live_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Email
MAILER_PROVIDER=resend
RESEND_API_KEY=re_...
# Webhooks
SUPABASE_DB_WEBHOOK_SECRET=your-secret

For the complete list, see Environment Variables.

Video reference: Environment Variables


Step 5: Deploy

Click Deploy to start the build process. sherpa.sh will:

  1. Clone your repository
  2. Install dependencies with pnpm
  3. Build the Next.js application
  4. Deploy to their infrastructure

First Deployment

Your first deployment may fail if:

  • NEXT_PUBLIC_SITE_URL is set to a custom domain you haven't configured yet
  • Environment variables are missing

This is normal. After getting your sherpa.sh URL, update the environment variables and redeploy.


Post-Deployment Setup

After successful deployment:

Update Supabase URLs

In Supabase Dashboard (Authentication > URL Configuration):

FieldValue
Site URLYour sherpa.sh URL or custom domain
Redirect URLshttps://yourdomain.com/auth/callback**

Configure Webhooks

Point your webhooks to your sherpa.sh deployment:

  • Supabase DB webhook: https://yourdomain.com/api/db/webhook
  • Stripe webhook: https://yourdomain.com/api/billing/webhook

Multiple Apps

If you have multiple apps in your monorepo:

  1. Change the Output Directory to your app's path (e.g., apps/admin)
  2. Change the Root Directory to match (e.g., apps/admin)
  3. Create separate sherpa.sh projects for each app

Custom Domain

To add a custom domain:

  1. Go to your sherpa.sh project settings
  2. Add your domain
  3. Configure DNS records as instructed
  4. Update NEXT_PUBLIC_SITE_URL to your custom domain
  5. Update Supabase Site URL and Redirect URLs

Troubleshooting

Build fails with missing variables

Check the build logs for specific error messages. MakerKit's Zod validation will tell you exactly which variables are missing.

pnpm not found

Ensure the Install Command is set to pnpm install (not npm install).

Build output not found

Verify:

  • Output Directory is set to apps/web
  • Root Directory is set to apps/web
  • Build Command is pnpm run build

Environment variables not working

  1. Verify variables are saved in sherpa.sh settings
  2. Check for typos in variable names
  3. Redeploy after adding variables

Getting Help

sherpa.sh offers responsive support:

  1. Discord: Contact @Zach @ sherpa.sh in the MakerKit Discord
  2. Documentation: sherpa.sh docs
  3. Feature requests: Reach out directly via Discord

Next Steps