CodeHost is a minimalist, beginner-friendly Cloud Hosting (PaaS) platform designed for students and developers who want to deploy their code online without touching a terminal.
"Deploy your project in one click — even if you don't know what a terminal is."
- One-Click Deployment: Upload a
.zipfile or connect a GitHub Repository to get a live URL in seconds. - GitHub Integration: Deploy directly from any public GitHub repository with branch and subdirectory support.
- Auto-Detection: Automatically detects 20+ frameworks and languages including Next.js, Nuxt, Angular, SvelteKit, Astro, Django, FastAPI, Flask, Go, Rust, Java (Maven/Gradle), Ruby on Rails, PHP/Laravel, Deno, Bun, .NET, and more.
- Modern Build Stack: Supports Node.js 20+, smart package manager detection (npm/yarn/pnpm), and optimized multi-stage Docker builds for each framework.
- Subdomain Hosting: Projects are hosted at
{project}.yourdomain.com(legacy path-based hosting also supported). - Real-time Logs: Stream build and runtime logs directly to your browser via WebSockets.
- Safe by Default: Sandboxed container isolation with strict resource limits (128MB RAM).
- Admin Console: Enhanced panel for monitoring platform health, users, and detailed deployment stats.
- Multi-Provider Auth: Sign in with email/password, Google, or GitHub. Email verification included.
CodeHost follows a distributed architecture:
- Control Plane: Central brain managing users, projects, and scheduling.
- Data Plane: Worker nodes running the CodeHost Agent, responsible for building and running containers.
- Reverse Proxy: Dynamic routing managed by Traefik.
- Backend: Node.js (TypeScript) + Express
- Frontend: Next.js + Tailwind CSS
- Database: PostgreSQL (Prisma ORM)
- Real-time: Socket.IO
- Auth: JWT + Google OAuth + GitHub OAuth + Nodemailer
- Infrastructure: Docker + Traefik + Redis
- Docker and Docker Compose
- Node.js 20+
Create a .env file in the project root:
NODE_ENV=production
PORT=80
DOMAIN=your-domain.com
# Database
DB_USER=codehost
DB_PASS=securepass
DB_NAME=codehost
DATABASE_URL=postgresql://codehost:securepass@postgres:5432/codehost
REDIS_URL=redis://redis:6379
# JWT (generate with: openssl rand -base64 32)
JWT_SECRET=your-jwt-secret
JWT_REFRESH_SECRET=your-refresh-secret
# OAuth — Google (https://console.cloud.google.com/apis/credentials)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
# OAuth — GitHub (https://github.com/settings/developers)
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
# URLs
APP_URL=https://host.your-domain.com
API_URL=https://api.your-domain.com
# SMTP — Email verification (optional, links logged to console if not set)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password- Go to Google Cloud Console
- Create a new OAuth 2.0 Client ID (Web application)
- Set Authorized JavaScript origins:
https://api.your-domain.com - Set Authorized redirect URIs:
https://api.your-domain.com/auth/oauth/google/callback - Copy the Client ID and Client Secret into your
.env
- Go to GitHub Developer Settings
- Click New OAuth App
- Set Homepage URL:
https://host.your-domain.com - Set Authorization callback URL:
https://api.your-domain.com/auth/oauth/github/callback - Copy the Client ID, generate a Client Secret, and add both to your
.env
- Enable 2-Step Verification on your Google account
- Go to App Passwords
- Create an app password named
CodeHost SMTP - Use the 16-character password as
SMTP_PASS(no spaces)
docker compose --env-file .env -f infra/docker/docker-compose.yml up --build -dAfter the stack is running, apply the Prisma migration:
docker exec -it codehost-api npx prisma migrate deployIf you are on a VPS, ensure you allow traffic:
sudo ufw allow 80/tcp
sudo ufw allow 443/tcpapps/api: Express backend managing the deployment lifecycle and authentication.apps/web: Next.js frontend and Admin Console.packages/: Shared logic for database, docker, logger, and config.infra/docker: Deployment orchestration and proxy configuration.
To promote a user to Admin:
docker exec -it codehost-db psql -U ${DB_USER:-codehost} -d ${DB_NAME:-codehost} -c "UPDATE \"User\" SET role = 'ADMIN' WHERE email = 'your@email.com';"| Method | Email Verified | Password Required |
|---|---|---|
| Email + Password | Manual (via email link) | Yes |
| Google OAuth | Automatic | No |
| GitHub OAuth | Automatic | No |
- Unverified users can log in but cannot create projects or deploy
- OAuth auto-links accounts when the email matches an existing user
- Users can log in with either their email or username
MIT © Arsh Pathan