Deploy Hoppscotch on a VPS
Self-hosted API development platform — a lightweight, open-source alternative to Postman with shared team workspaces.
Prerequisites
- A RamNode VPS running Ubuntu 22.04 LTS (1 vCPU / 1 GB RAM minimum, 2 GB recommended)
- A non-root sudo user
- Three subdomains pointed to your server (app, API, admin)
- Ports 80 and 443 open in your firewall
Required Subdomains
| Service | Suggested Subdomain | Purpose |
|---|---|---|
| App | hoppscotch.yourdomain.com | Main API testing UI |
| Backend | api.hoppscotch.yourdomain.com | REST/GraphQL API server |
| Admin | admin.hoppscotch.yourdomain.com | Admin dashboard |
Update the System and Install Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install -y nginx certbot python3-certbot-nginxInstall Docker and Docker Compose
curl -fsSL https://get.docker.com | sudo bash
sudo usermod -aG docker $USER
newgrp dockerdocker --version
docker compose versionClone the Hoppscotch Repository
mkdir -p /opt/hoppscotch && cd /opt/hoppscotch
git clone https://github.com/hoppscotch/hoppscotch.git .Configure Environment Variables
Hoppscotch is configured entirely through environment variables. Copy the example file and edit it:
cp .env.example .env
nano .envDatabase
POSTGRES_USER=hoppscotch
POSTGRES_PASSWORD=your_strong_db_password
POSTGRES_DB=hoppscotch
DATABASE_URL=postgresql://hoppscotch:your_strong_db_password@hoppscotch-db:5432/hoppscotchJWT and Security Secrets
Generate secure random secrets with openssl rand -hex 32:
JWT_SECRET=your_jwt_secret_here
SESSION_SECRET=your_session_secret_hereURLs
VITE_BASE_URL=https://hoppscotch.yourdomain.com
VITE_SHORTCODE_BASE_URL=https://hoppscotch.yourdomain.com
VITE_ADMIN_URL=https://admin.hoppscotch.yourdomain.com
VITE_BACKEND_GQL_URL=https://api.hoppscotch.yourdomain.com/graphql
VITE_BACKEND_WS_URL=wss://api.hoppscotch.yourdomain.com/graphql
VITE_BACKEND_API_URL=https://api.hoppscotch.yourdomain.com/v1
REDIRECT_URL=https://hoppscotch.yourdomain.com
WHITELISTED_ORIGINS=https://hoppscotch.yourdomain.com,https://admin.hoppscotch.yourdomain.com,https://api.hoppscotch.yourdomain.comEmail (SMTP)
MAILER_SMTP_URL=smtps://user:password@smtp.yourprovider.com
MAILER_ADDRESS_FROM="Hoppscotch <noreply@yourdomain.com>"Authentication Providers
ALLOW_SECURE_COOKIES=true
# Google OAuth (optional)
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CALLBACK_URL=https://api.hoppscotch.yourdomain.com/v1/auth/google/callback
GOOGLE_SCOPE=email,profileStart the Hoppscotch Stack
docker compose up -dVerify all four containers are running:
docker compose psYou should see: hoppscotch-app, hoppscotch-backend, hoppscotch-admin, and hoppscotch-db.
Run Database Migrations
docker compose exec hoppscotch-backend pnpx prisma migrate deployConfigure Nginx as a Reverse Proxy
Hoppscotch's three services listen on different internal ports. Nginx handles external HTTPS traffic and proxies requests to each container.
App — hoppscotch.yourdomain.com
server {
listen 80;
server_name hoppscotch.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}Backend API — api.hoppscotch.yourdomain.com
server {
listen 80;
server_name api.hoppscotch.yourdomain.com;
location / {
proxy_pass http://localhost:3170;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}Admin Dashboard — admin.hoppscotch.yourdomain.com
server {
listen 80;
server_name admin.hoppscotch.yourdomain.com;
location / {
proxy_pass http://localhost:3100;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}sudo ln -s /etc/nginx/sites-available/hoppscotch-app /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/hoppscotch-backend /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/hoppscotch-admin /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginxIssue SSL Certificates
sudo certbot --nginx \
-d hoppscotch.yourdomain.com \
-d api.hoppscotch.yourdomain.com \
-d admin.hoppscotch.yourdomain.comConfirm auto-renewal is scheduled:
sudo systemctl status certbot.timerCreate the First Admin Account
Open the admin dashboard at https://admin.hoppscotch.yourdomain.com. The first user to sign up via the main app and then log in to the admin panel is automatically promoted to admin.
From the admin panel you can invite team members, enable or disable authentication providers, view usage analytics, and manage workspaces and collections.
Configure Docker to Start on Boot
sudo systemctl enable dockerVerify each service in docker-compose.yml has a restart policy:
grep restart /opt/hoppscotch/docker-compose.ymlIf any service is missing it, add restart: unless-stopped under each service block.
Maintenance and Updates
Viewing Logs
# All services
docker compose logs -f
# A single service
docker compose logs -f hoppscotch-backendUpdating Hoppscotch
cd /opt/hoppscotch
git pull origin main
docker compose pull
docker compose up -d
docker compose exec hoppscotch-backend pnpx prisma migrate deployBacking Up the Database
docker compose exec hoppscotch-db pg_dump -U hoppscotch hoppscotch > /opt/hoppscotch/backups/hoppscotch-$(date +%F).sqlAutomated Daily Backup
0 2 * * * docker compose -f /opt/hoppscotch/docker-compose.yml exec -T hoppscotch-db pg_dump -U hoppscotch hoppscotch > /opt/hoppscotch/backups/hoppscotch-$(date +\%F).sqlTroubleshooting
Containers are not starting
Check logs for the failing service. The most common causes are incorrect DATABASE_URL values and missing migration runs.
docker compose logs hoppscotch-backend502 Bad Gateway
Nginx is working but the upstream container is not responding. Verify the container is running on the expected port:
docker compose ps
docker inspect hoppscotch-app | grep HostPortMigration errors
docker compose ps hoppscotch-db
docker compose exec hoppscotch-backend pnpx prisma migrate statusEmail sign-in is not working
Double-check your MAILER_SMTP_URL value. The format for SMTPS is smtps://username:password@host:465.
docker compose exec hoppscotch-backend nc -zv smtp.yourprovider.com 465