Skip to main content
Enclave

Bare-metal / VPS deployment (without Docker)

Node.js 20+ plus nginx is all it takes: npm ci + build the backend and keep it running with node or pm2; build the frontend into static files and hand them to nginx. The repo ships an nginx config template — replace two placeholders and it's ready to use.

This path is for people who prefer not to introduce Docker, or who want fine control over processes and nginx. Frontend and backend are two independent things: the backend is one Node process; the frontend is a pile of static files.

  1. 1.Install the toolchain

    You need Node.js 20+, pnpm 8.15.4 (the version pinned by the repo's packageManager field — corepack enable fetches it automatically) and nginx (or any web server that can serve static files and reverse-proxy). Compiling better-sqlite3 needs python3, make and g++ — on Linux install build-essential; on macOS run xcode-select --install.

  2. 2.Run the backend (port 3000)

    At the repo root, first run pnpm install --frozen-lockfile (workspace packages); then in api/ run npm ci (api uses npm + package-lock.json and is not in the pnpm workspace), npm run build, and start with node dist/main (pm2 start dist/main recommended for production). api/.env must be in place; SQLite is created automatically at DATABASE_PATH. curl http://127.0.0.1:3000/health should return 200.

  3. 3.Build and serve the frontend (port 5180)

    Run pnpm --filter @yinjie/app build; the output is in apps/app/dist/. The repo ships an nginx template at apps/app/nginx/default.conf.template: replace the APP_API_UPSTREAM placeholder with http://127.0.0.1:3000, adjust the listen port and static root to your actual values, then reload once nginx -t passes. The template already includes the /api and /socket.io proxying plus the SPA fallback.

  4. 4.Verify the ops endpoints

    A request to /api/admin/stats with the X-Admin-Secret header should return 200 + JSON; a 401 means the secret is wrong, or the reverse proxy swallowed the X-Admin-Secret header (see "Reverse proxy and HTTPS" for the fix).

Related questions

  • Can I self-host Enclave? Is it hard?
    Yes, and it's about as hard as running an ordinary web service. If you've used docker compose, three steps get you your own instance: clone the repo, copy .env, and docker compose up. The API, frontend, database, and vector index all run on your own machine.
  • What do I need to self-host Enclave? Do I need a GPU?
    Not necessarily a GPU. If you use cloud model APIs (OpenAI, Anthropic, etc.), an ordinary server or home machine that can run Docker is enough — inference happens in the cloud, and your machine only runs the app and database. You only need the corresponding VRAM and compute if you want offline inference with local models (Ollama / vLLM).
  • What database does Enclave use? Do I need to set it up myself?
    No extra setup needed. Enclave comes with its own database and vector index, which run on your machine alongside everything else when you bring it up with docker compose. Documents, conversations, and memory are all stored there in structured form; in self-hosted mode this data lives only on your own machine.

Related

Back to self-hosting docs
ShareXTelegramLINEWeibo
Bare-metal / VPS deployment (without Docker) · Enclave