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

# Updating LaraOwl

> Safely upgrade your LaraOwl server to the latest version.

Keep LaraOwl current to receive new features, security patches, and bug fixes. The process differs slightly between Docker and Composer installs. Follow the one that matches how you deployed.

<Warning>
  **Back up your database before every update.** Migrations can alter schema and are not always reversible. Take a full database dump first.
</Warning>

## Back up first

Regardless of install method, snapshot your data before upgrading:

<CodeGroup>
  ```bash PostgreSQL theme={null}
  pg_dump -U laraowl laraowl > laraowl-backup.sql
  ```

  ```bash MySQL theme={null}
  mysqldump -u laraowl -p laraowl > laraowl-backup.sql
  ```

  ```bash Docker (PostgreSQL) theme={null}
  docker compose exec db pg_dump -U laraowl laraowl > laraowl-backup.sql
  ```
</CodeGroup>

## Composer install

For a bare-metal / Composer deployment, update the code, dependencies, database, and compiled assets, then restart the background workers.

<Steps>
  <Step title="Enable maintenance mode">
    Take the app offline so no telemetry is processed against a half-migrated schema:

    ```bash theme={null}
    php artisan down
    ```
  </Step>

  <Step title="Pull the latest code">
    ```bash theme={null}
    git pull origin main
    ```
  </Step>

  <Step title="Update dependencies">
    Update PHP and frontend dependencies:

    ```bash theme={null}
    composer update
    npm install
    ```
  </Step>

  <Step title="Run database migrations">
    Apply any new schema changes:

    ```bash theme={null}
    php artisan migrate
    ```

    <Info>
      In an automated deploy pipeline, use `php artisan migrate --force` to run migrations without the interactive confirmation prompt.
    </Info>
  </Step>

  <Step title="Clear cached state">
    Flush stale cached config, routes, views, and events so the new version's values are used:

    ```bash theme={null}
    php artisan optimize:clear
    ```
  </Step>

  <Step title="Rebuild frontend assets">
    ```bash theme={null}
    npm run build
    ```
  </Step>

  <Step title="Restart background workers">
    Queue workers and Reverb hold the **old** code in memory until restarted. Restart them so they pick up the new version:

    ```bash theme={null}
    php artisan queue:restart
    # If you run Horizon:
    php artisan horizon:terminate
    ```

    Your process manager (Supervisor) will automatically start fresh workers. Restart the Reverb process the same way if it is supervised.
  </Step>

  <Step title="Bring the app back online">
    ```bash theme={null}
    php artisan up
    ```
  </Step>
</Steps>

<Tip>
  For production it is often faster to cache config and routes after clearing them: run `php artisan optimize` once the update is complete.
</Tip>

## Docker install

For a Docker deployment, pull the latest code, rebuild the image, and recreate the containers. Because the app, worker, scheduler, and Reverb all share the same image, rebuilding once updates every service.

<Steps>
  <Step title="Pull the latest code">
    ```bash theme={null}
    cd laraowl
    git pull origin main
    ```

    <Info>
      If you deploy from a prebuilt image registry instead of building locally, pull the new image directly with `docker compose pull` and skip the `--build` flag in the next step.
    </Info>
  </Step>

  <Step title="Rebuild and restart the containers">
    ```bash theme={null}
    docker compose up -d --build
    ```

    Compose rebuilds the image and recreates only the containers that changed, restarting the app, Horizon worker, scheduler, and Reverb with the new code.
  </Step>

  <Step title="Run database migrations">
    Migrations do not run automatically on rebuild. Apply them inside the app container:

    ```bash theme={null}
    docker compose exec app php artisan migrate --force
    ```
  </Step>

  <Step title="Clear cached state">
    ```bash theme={null}
    docker compose exec app php artisan optimize:clear
    ```
  </Step>
</Steps>

## After updating

* Confirm the dashboard loads and the connection indicator shows real-time updates are live.
* Send a test event from a monitored app and verify it appears.
* Check the logs for migration or worker errors — see [Troubleshooting](/troubleshooting).
