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

# Production deployment

> Taking Orbit from local development to a real deployment

Orbit doesn't require any infrastructure beyond what a standard Laravel app needs — a database, a web server, and (if you're using queued jobs) a process to run them. There's no separate frontend to deploy or API to stand up.

## Environment

<Steps>
  <Step title="Set production environment variables">
    In `.env` (or your platform's environment variable configuration):

    ```bash theme={null}
    APP_ENV=production
    APP_DEBUG=false
    APP_URL=https://your-domain.example
    ```

    Generate a fresh `APP_KEY` for production — don't reuse a development key:

    ```bash theme={null}
    php artisan key:generate
    ```
  </Step>

  <Step title="Point at a production-grade database">
    SQLite is fine for local development, but for production, switch to MySQL or PostgreSQL — see [Configuration](/deployment/configuration#database) for the variables to set.
  </Step>

  <Step title="Configure mail for email notifications">
    Orbit sends [email notifications](/concepts/notifications#channels) through Laravel's standard mail configuration. `.env.example` defaults `MAIL_MAILER=log`, which just writes emails to the log — point it at a real driver (`smtp`, `ses`, and so on) and fill in `MAIL_HOST`/`MAIL_PORT`/`MAIL_USERNAME`/`MAIL_PASSWORD`/`MAIL_FROM_ADDRESS`/`MAIL_FROM_NAME` before relying on email delivery in production. See [Configuration](/deployment/configuration#mail-and-broadcasting).
  </Step>

  <Step title="Configure avatar moderation (nsfwjs)">
    Avatar uploads are screened by a separate nsfwjs HTTP service before being accepted (see [Configuration](/deployment/configuration#avatar-moderation-nsfwjs)). Run the `nsfwjs` container (or point `NSFW_SERVICE_URL` at your own instance) before enabling avatar uploads in production, or set `NSFW_DETECTION_ENABLED=false` to skip moderation entirely.
  </Step>
</Steps>

## Build and deploy

<Steps>
  <Step title="Install dependencies without dev tooling">
    ```bash theme={null}
    composer install --no-dev --optimize-autoloader
    npm ci
    npm run build
    ```
  </Step>

  <Step title="Run migrations">
    ```bash theme={null}
    php artisan migrate --force
    ```

    <Warning>
      Don't run `migrate:fresh` in production — it drops all tables first. That command is for local/demo data only.
    </Warning>
  </Step>

  <Step title="Cache framework configuration">
    ```bash theme={null}
    php artisan config:cache
    php artisan route:cache
    php artisan view:cache
    ```
  </Step>

  <Step title="Serve the app">
    Point Nginx or Apache with PHP-FPM at the `public/` directory, or run the app's Docker image directly — see [Docker](/deployment/docker) for the container setup, which is suitable for production as well as local development.
  </Step>
</Steps>

## Running the queue

Session, cache, and queue all default to the `database` driver. A queue worker is **required** in production, not optional — [email notifications](/concepts/notifications#channels) are always queued, never sent synchronously, so without a worker running they'll pile up unsent in the `jobs` table. Run it under a process supervisor (such as `supervisord` or systemd) rather than the `queue:listen` command used in local development, so it restarts automatically:

```bash theme={null}
php artisan queue:work --tries=3
```

## What Orbit doesn't need

Since Orbit has no public API (see [Tech stack](/architecture/tech-stack#why-no-api)) and no broadcasting features in active use, you don't need to provision a websocket server or API rate limiting for Orbit's current feature set to work in production. You do need a transactional email provider (for notification emails) and a running queue worker — see above.


## Related topics

- [Quickstart](/quickstart.md)
- [Configuration](/deployment/configuration.md)
- [Testing](/architecture/testing.md)
