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

# Deploy Lynkz to Vercel: GitHub Import and CLI Guide

> Deploy your Lynkz instance to Vercel using the GitHub import workflow or the Vercel CLI. Configure environment variables and go live in minutes.

Lynkz is optimized for Vercel's serverless platform — all PIN logic, magic link generation, IP lockout enforcement, and email sending run as Vercel serverless functions. You have two deployment options: **GitHub Import** (recommended for most users) and the **Vercel CLI** (ideal if you prefer working from the terminal or need more control over project configuration).

<Tabs>
  <Tab title="GitHub Import (Recommended)">
    <Steps>
      <Step title="Push Your Code to GitHub">
        Make sure your local Lynkz clone is pushed to a GitHub repository. If you haven't done this yet:

        ```bash theme={null}
        git remote add origin https://github.com/your-username/lynkz.git
        git push -u origin main
        ```
      </Step>

      <Step title="Import the Project on Vercel">
        Go to [vercel.com](https://vercel.com) and sign in. From your dashboard, click **Add New → Project**. Select **Import Git Repository**, then find and select the GitHub repo you just pushed.
      </Step>

      <Step title="Add Environment Variables">
        Before clicking Deploy, expand the **Environment Variables** section. Add every variable from your `.env.local` file here. Pay special attention to:

        * All six `NEXT_PUBLIC_FIREBASE_*` keys
        * `FIREBASE_SERVICE_ACCOUNT_KEY` (paste the full JSON string)
        * `RESEND_API_KEY` and `RESEND_FROM_DOMAIN` (if using magic links)
        * `NEXT_PUBLIC_APP_URL` (set to your Vercel deployment URL or custom domain)

        See the [Environment Variables reference](/setup/environment-variables) for the full list.
      </Step>

      <Step title="Deploy">
        Click **Deploy**. Vercel builds your Next.js app and provisions the serverless functions. When the build finishes, your Lynkz instance is live at the generated `.vercel.app` URL.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Vercel CLI">
    Install the Vercel CLI globally if you haven't already, then run `vercel` from your project root. The CLI walks you through project setup and prompts you to link or create a Vercel project.

    ```bash theme={null}
    npm install -g vercel
    vercel
    ```

    When prompted, confirm your project settings. To deploy to production (rather than a preview URL), use:

    ```bash theme={null}
    vercel --prod
    ```

    After the initial deploy, add your environment variables either through the Vercel dashboard (**Settings → Environment Variables**) or via the CLI:

    ```bash theme={null}
    vercel env add NEXT_PUBLIC_FIREBASE_API_KEY
    vercel env add FIREBASE_SERVICE_ACCOUNT_KEY
    # ... repeat for each variable
    ```
  </Tab>
</Tabs>

<Note>
  After adding or updating environment variables in Vercel, you must redeploy your project for the changes to take effect. You can trigger a redeploy from the Vercel dashboard under **Deployments → Redeploy**, or by pushing a new commit to your connected GitHub branch.
</Note>

## Custom Domain

Lynkz does not have a built-in custom domain feature, but you can point any domain you own to your Vercel deployment. In your Vercel project, go to **Settings → Domains**, add your domain, and follow the DNS instructions. Once your domain is pointing to Vercel, all Lynkz pages — including public pages at `/username` — work automatically under your domain. Update `NEXT_PUBLIC_APP_URL` to your custom domain and redeploy.

<Tip>
  Lynkz can be fully self-hosted outside of Vercel if you prefer. Replace Firebase Firestore with any Firestore-compatible database, swap Resend for any transactional email provider by updating the email-sending logic in the API routes, and deploy to any Node.js-compatible host (Railway, Fly.io, a VPS, etc.). The open-source codebase is designed to make these substitutions straightforward.
</Tip>
