This guide describes the quickest path to deploy CLARITY Convertor on a fresh Linux server and expose it to remote clients.
- A non-root user with sudo privileges.
- Docker Engine and Docker Compose Plugin installed.
sudo apt-get update sudo apt-get install ca-certificates curl gnupg lsb-release -y curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y
cd /opt
sudo git clone <your-repo-url> clarity-convertor
sudo chown -R $USER:$USER clarity-convertor
cd clarity-convertorEdit docker-compose.yml to suit the server:
SECRET_KEYfor JWT signing.REACT_APP_API_BASE_URLbuild arg under thefrontendservice (defaults to/api, matching the bundled nginx proxy).OLLAMA_API_URLunder thebackendservice if Ollama runs outside the Compose stack. Use a resolvable hostname or IP and the port where Ollama listens (e.g.http://clarity.iitj.ac.in:11434). When targeting the host machine from inside Docker on Linux, add:and setextra_hosts: - "host.docker.internal:host-gateway"
OLLAMA_API_URLtohttp://host.docker.internal:11434.OLLAMA_TIMEOUT_SECONDScontrols the per-request timeout between the backend and Ollama. Set it to0(default) to disable the timeout, or a positive value in seconds for an upper bound.
If Ollama runs directly on the host, ensure it listens on all interfaces:
sudo mkdir -p /etc/systemd/system/ollama.service.d
sudo tee /etc/systemd/system/ollama.service.d/override.conf >/dev/null <<'EOF'
[Service]
Environment="OLLAMA_HOST=0.0.0.0"
EOF
sudo systemctl daemon-reload
sudo systemctl restart ollamaVerify the listener:
sudo ss -tulpn | grep 11434The built-in nginx configuration proxies /api/* back to the FastAPI service, so browser calls automatically reach the backend without exposing port 8000 publicly unless you want direct API access.
docker compose up -d --buildServices start under the default ports:
- Frontend (nginx) →
0.0.0.0:3000 - Backend (FastAPI) →
0.0.0.0:8000 - Postgres →
0.0.0.0:5432
Check status:
docker compose psOpen the necessary ports on the server firewall so external users can connect.
sudo ufw allow 3000/tcp # React frontend
sudo ufw allow 8000/tcp # FastAPI API (optional if only the frontend is exposed)
sudo ufw allow 5432/tcp # Only if remote DB access is required
sudo ufw reloadAdd inbound rules for TCP ports 3000 and 8000 from your trusted CIDR ranges.
If you prefer to expose the site on standard HTTP/HTTPS ports, modify docker-compose.yml:
frontend:
ports:
- "80:80"
- "443:80" # Front the container with a TLS terminator such as Caddy or nginx-proxyThen update DNS or load balancer rules accordingly.
- Visit
http://<server-ip>:3000in a browser. - Confirm API health at
http://<server-ip>:3000/api/(proxied) or directly athttp://<server-ip>:8000///docsif that port is exposed. - If Ollama runs externally, verify connectivity from the backend container:
Replace the URL with the hostname/IP you configured.
docker compose exec backend curl -sS http://host.docker.internal:11434/api/tags - Use
check_ollama_endpoint.pyfor a more detailed connectivity check if needed. - Log in with the seeded admin account (
lakshay/1312), then update the password immediately.
- Stop the stack:
docker compose down - Tail logs:
docker compose logs -f backend frontend - Update the app: pull latest code, then
docker compose up -d --build - Backup data: archive the
backend/uploads/directory and dump Postgres (docker compose exec db pg_dump -U user clarity_db > clarity_db.sql).
- Change default credentials and rotate the
SECRET_KEY. - Restrict Postgres to local connections unless remote clients are required.
- Run the frontend behind a reverse proxy (Caddy/nginx) that terminates TLS and handles domain routing.
- Enable automatic Docker updates or rebuild the stack regularly to pick up security patches.
- Monitor Ollama availability; large PDFs can take several minutes per conversion, so keep
OLLAMA_TIMEOUT_SECONDSaligned with your expectations and watch backend logs for 504 responses.