This project provides a complete Docker-based deployment of Hoppscotch - a free, fast, and beautiful API request builder. Hoppscotch is an open-source alternative to Postman that runs entirely in your browser or as a desktop application.
Hoppscotch is a lightweight, web-based API development ecosystem that helps developers:
- Build and test REST, GraphQL, WebSocket, and other API requests
- Organize API collections and environments
- Collaborate with teams on API development
- Generate API documentation
- Mock API responses
This Docker setup includes:
- Hoppscotch AIO (All-in-One): The complete Hoppscotch application including frontend, backend API, and admin panel
- PostgreSQL Database: Persistent storage for user data, collections, and settings
- Pre-configured Environment: Ready-to-use configuration with sensible defaults
- 🚀 One-command deployment with Docker Compose
- 🔐 Email authentication (with optional SMTP configuration)
- 💾 Persistent data storage with PostgreSQL
- 🔧 Fully configurable through environment variables
- 📱 Desktop app compatible for connecting to your self-hosted instance
- Docker (version 20.10 or later) or Podman
- Docker Compose (version 2.0 or later) or Podman Compose
- 2GB RAM minimum (4GB recommended)
- 1GB disk space for the application and database
git clone https://github.com/leoneljdias/hoppscotch-aio-docker.git
cd hoppscotch-aio-docker
Edit the .env
file to customize your deployment:
# Basic configuration - change these for production
JWT_SECRET="your-secure-jwt-secret-here"
SESSION_SECRET="your-secure-session-secret-here"
DATA_ENCRYPTION_KEY="your-32-character-encryption-key-here"
# Your domain (if using a custom domain)
HOPPSCOTCH_HOST=localhost:5000
VITE_BASE_URL=http://localhost:5000
Using Docker:
docker compose up -d
Using Podman:
podman-compose up -d
- Hoppscotch Web App: http://localhost:5000
- Admin Panel: http://localhost:5000
Add your self-hosted Hoppscotch instance to Hoppscotch Desktop App:
- Open Hoppscotch Desktop App
- Click the Hoppscotch logo in the top-left corner
- Click "Add an instance"
- Enter the URL of your self-hosted Hoppscotch instance (e.g.,
http://localhost:3000
) - Click "Connect"
Note: Download the desktop app from Hoppscotch Downloads if you haven't already.
Key configuration options in .env
:
Variable | Description | Default |
---|---|---|
HOPPSCOTCH_HOST |
Your domain name | hoppscotch.domain.com |
JWT_SECRET |
Secret for JWT tokens | secret1233 |
SESSION_SECRET |
Session encryption secret | XXXXXXXXXX |
DATA_ENCRYPTION_KEY |
32-char encryption key | abcdefghijklmnopqrstuvwxyz123456 |
VITE_ALLOWED_AUTH_PROVIDERS |
Authentication methods | EMAIL |
To enable email sending (for password resets, etc.), configure SMTP:
MAILER_SMTP_ENABLE="true"
MAILER_USE_CUSTOM_CONFIGS="true"
MAILER_SMTP_HOST="your-smtp-server.com"
MAILER_SMTP_PORT="587"
MAILER_SMTP_SECURE="true"
MAILER_SMTP_USER="[email protected]"
MAILER_SMTP_PASSWORD="your-app-password"
MAILER_ADDRESS_FROM="[email protected]"
For production deployments:
-
Change default secrets:
JWT_SECRET="$(openssl rand -base64 32)" SESSION_SECRET="$(openssl rand -base64 32)" DATA_ENCRYPTION_KEY="$(openssl rand -base64 32 | cut -c1-32)"
-
Use HTTPS: Configure SSL/TLS with a reverse proxy like nginx or traefik
- When using HTTPS, update
VITE_BACKEND_WS_URL
to usewss://
instead ofws://
- Example:
VITE_BACKEND_WS_URL=wss://yourdomain.com/backend/graphql
- When using HTTPS, update
-
Secure database: Change the default PostgreSQL password
-
Configure firewall: Restrict access to necessary ports only
-
Regular backups: Backup your PostgreSQL data volume
- Update
HOPPSCOTCH_HOST
in.env
with your domain - Configure DNS to point to your server
- Set up SSL certificates (Let's Encrypt recommended)
- Configure a reverse proxy (nginx, traefik, etc.) to handle SSL termination
Service won't start:
# Check logs
docker compose logs hoppscotch-aio
docker compose logs hoppscotch-db
Database connection issues:
# Restart services
docker compose restart
Desktop app won't connect:
- Verify the instance URL is correct and accessible
- Check that ports are not blocked
- Ensure CORS origins are properly configured in
WHITELISTED_ORIGINS
TypeError: Cannot read properties of undefined (reading 'startsWith'):
- This error is typically caused by WebSocket URL protocol mismatch
- Ensure
VITE_BACKEND_WS_URL
usesws://
for HTTP deployments orwss://
for HTTPS deployments - Example: For HTTP use
ws://localhost:5000/backend/graphql
, for HTTPS usewss://yourdomain.com/backend/graphql
# Backup database
docker exec hoppscotch-db pg_dump -U postgres hoppscotch > backup.sql
# Restore database
docker exec -i hoppscotch-db psql -U postgres hoppscotch < backup.sql
- Documentation: Hoppscotch Docs
- Community: Discord
- Issues: GitHub Issues
This project is licensed under the MIT License - see the LICENSE file for details.
Hoppscotch is licensed under the MIT License - see the Hoppscotch License for details.