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

# Self-Hosted

## Requirements

* Node.js 18+
* 1GB+ RAM
* Ubuntu 20.04+ (or similar)
* Domain with DNS access

## Deployment Steps

<Steps>
  <Step title="Build the project">
    On your local machine:

    ```
    npm run build
    ```

    This creates an optimized production build in `.next/`
  </Step>

  <Step title="Upload the files">
    Upload these files/folders to your server:

    ```
    - .next/
    - public/
    - node_modules/
    - package.json
    - package-lock.json
    - next.config.ts
    ```
  </Step>

  <Step title="Start the server">
    ```
    npm run start
    ```

    Your site runs on port 3000 by default.

    To specify a different port:

    ```
    PORT=8080 npm run start
    ```
  </Step>

  <Step title="Use PM2">
    Keep your site running with PM2:

    ```
    # Install PM2
    npm install -g pm2

    # Start your site
    pm2 start npm --name "latch" -- start

    # Auto-restart on server reboot
    pm2 startup
    pm2 save

    # View logs
    pm2 logs latch

    # Restart
    pm2 restart latch
    ```
  </Step>
</Steps>
