Self-Hosting Quickstart
Deploy TheTerms on your infrastructure in under 10 minutes. You’ll need Docker and Docker Compose installed.
Prerequisites
Section titled “Prerequisites”- A server with at least 1 CPU core, 2 GB RAM, and 10 GB disk
- Docker Engine 20+ and Docker Compose v2+
- A domain name (recommended for HTTPS)
Deploy
Section titled “Deploy”-
Clone the repository
Terminal window git clone https://github.com/ashwineaso/theterms.gitcd theterms -
Create your environment file
Terminal window cp apps/web/.env.example .env -
Configure required variables
Edit
.envand set at minimum:Terminal window # Generate a secure random secretNEXTAUTH_SECRET=$(openssl rand -base64 32)# Your public URLNEXTAUTH_URL=https://your-domain.com# A strong database passwordPOSTGRES_PASSWORD=your-strong-password-hereSee Environment Variables for the full reference.
-
Build and start all services
Terminal window docker compose up -d --buildThis starts three containers:
- app — TheTerms application (Next.js on port 3000)
- postgres — PostgreSQL 16 database
- redis — Redis 7 cache
Database migrations run automatically on container startup.
-
Verify the deployment
Terminal window docker compose psAll three services should show
Up (healthy).Open
http://your-server:3000in a browser. You should see the login page.
What’s Next?
Section titled “What’s Next?”- Environment Variables — Full configuration reference
- Reverse Proxy — Set up HTTPS with nginx, Caddy, or Traefik
- Backups — Back up your database
- Upgrading — Update to new releases