# Deploy Vaani on a cPanel-managed server

Vaani uses FastAPI with an in-process transcription queue. Run one persistent Uvicorn process behind an HTTPS reverse proxy. The usual cPanel Passenger Python form expects a WSGI application. Ask your host whether it offers a container deployment that accepts this Dockerfile or can proxy a dedicated subdomain to a persistent Uvicorn service.

## Upload and start

1. In cPanel File Manager, upload and extract the ZIP in a private directory such as `/home/CPANEL_USER/vaani`, outside `public_html`. Keep the directory layout intact.
2. On a Linux host with Python 3.11, use Terminal or SSH to run:

   ```sh
   cd ~/vaani
   python3.11 -m venv .venv
   .venv/bin/python -m pip install -r requirements.txt
   cp -n .env.example .env
   ffmpeg -version
   ffprobe -version
   .venv/bin/python -m app
   ```

   Install FFmpeg and FFprobe through the host if either command fails. Both must be on the service user's PATH. The service needs outbound access for model downloads and YouTube access, writable storage for jobs and the model cache, and sufficient CPU, RAM, and disk for long recordings.
3. Have the host supervise the process with automatic restart. Set the service working directory to `/home/CPANEL_USER/vaani` and its command to `/home/CPANEL_USER/vaani/.venv/bin/python -m app`. Use one process because the job queue lives in memory. The startup module is `app/__main__.py`. The ASGI application is `app.main:app` in `app/main.py`.
4. Have the host proxy a dedicated HTTPS subdomain at its root to `http://127.0.0.1:8765`. Restrict access at the proxy or through a private network because the app has no sign-in. Set the proxy upload limit above the configured file limit to allow multipart overhead, and allow enough time for the upload itself. The app processes jobs in the background after upload.
5. Check `curl -fsS http://127.0.0.1:8765/api/health`, then check the same path through the protected HTTPS subdomain. Confirm the tool checks, test a short Hindi recording with automatic detection, and run an end-to-end recording over an hour before accepting the deployment.

## Container option

If the host can build and run the supplied Dockerfile, it installs Python dependencies and FFmpeg and starts with `python -m app` on port `8765`. Configure one replica, persistent writable storage at `/app/data`, and a persistent launch-gates file. If running Docker Compose over SSH, first copy `config/launch-gates.example.json` to `config/launch-gates.json` if it does not already exist, then run `docker compose up -d --build`. Ask the host to configure the HTTPS proxy and access restrictions.

## Release settings

- The example environment permits videos up to two hours and uploads up to 500 MB. Keep proxy, host quotas, and app limits aligned.
- The release includes chunked transcription, FFmpeg output draining, and automatic language selection for new users. The default speech model in the example is for initial testing. Follow [launch gates](LAUNCH-GATES.md) for Hindi quality requirements and enable `VAANI_PRODUCTION=1` only once the gates are satisfied.
- Keep the server's `.env`, `data/`, and `config/launch-gates.json` when upgrading. Install dependencies again and restart the supervised service after replacing the application files.
