> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magic-resume.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-Hosted

> Run Magic Resume on your own machine with no backend, no database, and no account.

In self-hosted mode the web app runs entirely in the browser. Resume data is persisted in IndexedDB under the database name `MagicResumeDB`. There is **no auth, no backend (gateway / platform-api / agent-service), and no product analytics delivery**. **AI is off entirely** — AI Lab and AI PDF import are proxied to the backend and need a signed-in user, so they don't work here.

This is the recommended mode for hacking on the codebase.

## Prerequisites

* Node.js 20+
* pnpm `10.28.1` (the version in `packageManager`). Other versions work but lockfile drift is on you.

<Steps>
  <Step title="Clone the repository">
    ```bash theme={null}
    git clone https://github.com/LinMoQC/Magic-Resume.git
    cd Magic-Resume
    ```
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    pnpm install
    ```

    Run this from the **repo root** — pnpm needs to see `pnpm-workspace.yaml` to resolve `workspace:*` deps.
  </Step>

  <Step title="Configure environment variables">
    ```bash theme={null}
    cp apps/web/.env.example apps/web/.env.local
    ```

    The minimum for self-hosted is:

    ```env filename="apps/web/.env.local" theme={null}
    NEXT_PUBLIC_APP_MODE=self-hosted
    ```

    If `NEXT_PUBLIC_APP_MODE` is unset and `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` is also unset, the app auto-detects `self-hosted`. Setting it explicitly is just clearer.
  </Step>

  <Step title="Start the dev server">
    ```bash theme={null}
    pnpm run dev
    ```

    Turbo spins up every workspace that has a `dev` script; the web app listens on [http://localhost:3000](http://localhost:3000). (These docs are a separate Mintlify site — preview them with `npx mint dev`.)

    To run only the web app:

    ```bash theme={null}
    pnpm --filter @magic-resume/web dev
    ```
  </Step>
</Steps>

## What works without a backend

| Feature                                            | Self-hosted                                                |
| -------------------------------------------------- | ---------------------------------------------------------- |
| Resume editor, all 12 templates, export PDF        | ✅                                                          |
| Local IndexedDB storage                            | ✅                                                          |
| Version history (local only)                       | ✅                                                          |
| AI Lab / AI PDF import                             | ❌ (needs cloud mode + backend)                             |
| Clerk auth, cloud sync, sharing                    | ❌                                                          |
| Interview / JD analyze / translate (agent backend) | ❌ unless you run the backend and set `NEXT_PUBLIC_API_URL` |

<Info>
  There is **no AI** in pure self-hosted mode — every AI feature is proxied to the backend and requires a signed-in user. Run the full backend and switch to cloud mode to enable it; there you can bring your own API key (stored only in the browser) instead of platform credits.
</Info>

## Environment reference

| Variable               | Required | Purpose                                                                   |
| ---------------------- | -------- | ------------------------------------------------------------------------- |
| `NEXT_PUBLIC_APP_MODE` | No       | `self-hosted` or `cloud`. Auto-detected from the presence of a Clerk key. |
| `NEXT_PUBLIC_API_URL`  | No       | The gateway origin. Only needed to point AI Lab at a running backend.     |

See [Cloud Mode](/en/getting-started/cloud) for the full cloud-mode env list.
