Deployment Guide
Hitler uses a split deployment architecture:- Web app (Next.js) → deployed on Vercel at
mako.devinagiffy.xyz - API + Bot + Databases → deployed via Docker Compose on a VPS at
api.mako.devinagiffy.xyz
Architecture Overview
Part 1: VPS Deployment (API + Bot + Databases)
Prerequisites
- A GCP Compute Engine instance running Ubuntu (22.04 or 24.04 LTS recommended) with at least 2 GB RAM
gcloudCLI installed and authenticated on your local machine- A domain pointing to the instance (
api.mako.devinagiffy.xyz)
Step 1: SSH into Your Instance
GCP automatically creates a user matching your local username and manages SSH keys for you. You
land as a non-root user with sudo access — no need to create a separate user.
Step 2: Initial Server Setup
Step 3: Create a Deploy User
Create a dedicatedhitler user to keep application files separate from your personal account:
hitler user anytime:
hitler user (sudo su - hitler).
Step 4: Configure Firewall
GCP VPC firewall (run from your local machine):hitler user):
Step 5: Install Docker
hitler (re-login to pick up the docker group):
Step 6: Install Node.js and pnpm (optional, for running migrations from host)
Step 7: Set Up GitHub SSH Key
Generate an SSH key on the server and add it to GitHub so you can clone private repos:- Go to github.com/settings/keys
- Click New SSH key
- Title:
Hitler Server(or whatever you like) - Key type: Authentication
- Paste the public key and click Add SSH key
Step 8: Clone and Configure
.env with your production values (see Environment Variables below):
Step 9: Deploy with Docker Compose
The
docker-compose.deploy.yml starts API, Slack Bot, Postgres (pgvector/pgvector:pg16), and Redis. The web service is
deployed separately on Vercel (see Part 2). The Postgres image uses pgvector/pgvector:pg16 instead of standard postgres:16-alpine
to support the pgvector extension required by the context memory system.Step 10: Run Database Migrations
Step 11: Point DNS to VPS
Add an A record at your domain registrar:
Verify it resolves:
Step 12: Set Up Nginx Reverse Proxy
Install Nginx:Step 13: Set Up SSL with Certbot
Install Certbot via snap (recommended by Certbot/EFF):api.mako.devinagiffy.xyz.
Certbot will:
- Verify domain ownership via HTTP challenge
- Generate a Let’s Encrypt SSL certificate
- Automatically modify the Nginx config to add SSL
- Set up auto-renewal (runs twice daily via systemd timer)
Step 14: Verify
Part 2: Vercel Deployment (Web App)
Step 1: Import to Vercel
- Go to vercel.com/new
- Import your Git repository
- Set the following:
- Root Directory:
apps/web - Framework Preset: Next.js
- Build Command:
cd ../.. && pnpm install && pnpm --filter @hitler/web build - Output Directory:
.next
- Root Directory:
Step 2: Set Environment Variables
In Vercel project settings → Environment Variables:Step 3: Configure Custom Domain
- In Vercel project settings → Domains
- Add
mako.devinagiffy.xyz - Add the DNS records Vercel provides to your domain registrar:
- A record:
76.76.21.21(or the IP Vercel gives you) - CNAME:
cname.vercel-dns.com(forwwwsubdomain, optional)
- A record:
Step 4: Deploy
Push to your main branch — Vercel auto-deploys on every push.Environment Variables
Required (VPS .env)
Slack Integration
LLM Provider
Secrets Storage (Production)
URLs and CORS
Full .env Example
DNS Configuration
Set up these DNS records at your domain registrar (devinagiffy.xyz):
Slack App Setup (Dev + Production)
We recommend two separate Slack apps — one for development and one for production. See Slack Setup for details.Services Overview
Updating
API / Bot (VPS)
Web App (Vercel)
Push to main — Vercel auto-deploys:Viewing Logs
Stopping and Cleaning Up
Using an External Database
If you already have Postgres and/or Redis:Production Checklist
- Strong
JWT_SECRET(32+ random bytes) - Unique
API_KEY(matching between API and bot.env) -
POSTGRES_PASSWORDchanged from default -
NEXT_PUBLIC_API_URLset tohttps://api.mako.devinagiffy.xyz/api -
WEB_APP_URLset tohttps://mako.devinagiffy.xyz -
CORS_ORIGINSset tohttps://mako.devinagiffy.xyz - At least one LLM key configured (
ANTHROPIC_API_KEYorOPENAI_API_KEY) - Slack app credentials configured (production app)
- Nginx reverse proxy installed and configured for
api.mako.devinagiffy.xyz - SSL certificate via Certbot (
sudo certbot --nginx) - DNS records for
api.mako.devinagiffy.xyzandmako.devinagiffy.xyz - Automated backups for the
postgres_dataDocker volume - Cloudflare KV configured for per-org secret storage