Prerequisites
Before starting, ensure your host machine has:- A modern Linux distribution (Ubuntu 22.04 LTS recommended)
- Docker and Docker Compose installed
- Node.js 22 (for optionally running local scripts)
- At least 4GB of RAM and 2 vCPUs
The Deployment Guide
1
Clone the repository
Download the Corgtex source code onto your host server.
2
Configure environment variables
Copy the sample environment file to create your active configuration.Open See the Configuration Reference for a complete list of required and optional variables.
.env in an editor and set your core variables. Pay special attention to the secrets.3
Start the stack
Run the self-host compose file. This file starts the PostgreSQL database, the Next.js Web server, and the background Worker process.
4
Access the application
The web container exposes port
3000. If you are running locally:http://localhost:3000If you are deploying to a remote server, you should configure a reverse proxy (like Nginx, Traefik, or Caddy) to route external traffic to 127.0.0.1:3000 and handle TLS/SSL termination.What’s included in the Self-Host bundle?
When you rundocker-compose.selfhost.yml, you are launching three distinct services:
postgres: Apostgres:16-alpinecontainer running the core database and (pgvector). The data is persisted locally in a Docker volume.web: The Next.js application that handles all API requests and user interface rendering.worker: The background Node.js daemon that executes long-running tasks asynchronously.