Overview
NeoSC uses a Docker-based infrastructure with Zero Trust networking provided by Pomerium and Zitadel. This guide covers the prerequisites, environment configuration, and deployment steps.Architecture Overview
Domain Structure
| Domain | Service | Purpose |
|---|---|---|
manager.kappa4.com | Zitadel | Identity Provider (OIDC) |
gate.kappa4.com | Pomerium | Authentication service / OAuth flow |
portal.kappa4.com | Frontend | React SPA (protected) |
api.portal.kappa4.com | Backend | FastAPI REST API (protected) |
admin.portal.kappa4.com | Backend | Admin panel (admin-only) |
workspace.portal.kappa4.com | Kasm Proxy | VDI streaming (protected) |
Prerequisites
System Requirements
- Docker Engine 20.10+
- Docker Compose 2.0+
- 4GB RAM minimum (8GB recommended)
- 20GB disk space
- Linux host (Ubuntu 20.04+ or similar)
External Dependencies
Zitadel Instance Required: You must have a Zitadel instance running at
manager.kappa4.com before deploying NeoSC. Zitadel acts as the OIDC Identity Provider.- Zitadel at
manager.kappa4.com(pre-existing) - DNS Records configured for all domains
- TLS Certificates for HTTPS (Let’s Encrypt recommended)
DNS Configuration
Configure the following DNS records:Environment Configuration
Step 1: Configure Zitadel OIDC Application
Create a new application in Zitadel:-
Log into Zitadel at
https://manager.kappa4.com - Create a new project: NeoSC Portal
-
Add application with these settings:
- Name: NeoSC Pomerium Gateway
- Type: Web
- Auth Method: Basic (client_id + client_secret)
- Redirect URI:
https://gate.kappa4.com/oauth2/callback - Post-logout URI:
https://portal.kappa4.com - Grant Types: authorization_code, refresh_token
-
Configure scopes:
-
Create roles in the project:
admin- Full administrative accessneosc- Standard NeoSC useruser- Basic user accessdemo-user- Demo session access
- Note the Client ID and Client Secret for the next step.
Step 2: Generate Secrets
Generate required secrets for Pomerium:Step 3: Create Environment File
Createinfra/.env with the following variables:
Deployment Steps
Local Development Deployment
Production Deployment
For production, additional considerations:- TLS Certificates: Use Let’s Encrypt with certbot or cert-manager
- Firewall Rules: Only expose ports 80 and 443
- Resource Limits: Adjust container resources in docker-compose.yml
- Backups: Configure MongoDB backups
- Monitoring: Deploy Prometheus + Grafana
Verification
Health Checks
Verify all services are healthy:Service Status
Post-Deployment
First Login
- Navigate to
https://portal.kappa4.com - You’ll be redirected to
gate.kappa4.com - Authenticate with Zitadel credentials
- Grant consent to the application
- You’ll be redirected back to the portal
User Management
Manage users and roles in Zitadel:- Log into Zitadel admin console
- Navigate to your organization
- Add users and assign roles:
admin- Full access including admin panelneosc- Standard portal accessuser- Basic access
Troubleshooting
Common Issues
Pomerium shows 'Invalid OAuth state'
Pomerium shows 'Invalid OAuth state'
This usually indicates:
- Incorrect redirect URI configured in Zitadel
- Cookie domain mismatch
- Clock skew between servers
https://gate.kappa4.com/oauth2/callback in Zitadel.Frontend shows blank page
Frontend shows blank page
Check that environment variables are correctly set:Verify
REACT_APP_API_URL points to https://api.portal.kappa4.comBackend returns 401 Unauthorized
Backend returns 401 Unauthorized
MongoDB connection refused
MongoDB connection refused
Ensure MongoDB is on the internal network:If this fails, recreate the networks:
Debug Mode
Enable debug logging:Maintenance
Updates
Backups
Monitoring
Monitor resource usage:Next Steps
Zero Trust Architecture
Learn about the Zero Trust security model
Pomerium Configuration
Detailed Pomerium proxy configuration
Docker Compose
Deep dive into service orchestration
NetBird Integration
Configure WireGuard mesh networking