Deploying PatoLab to production requires a few critical steps beyond a standard Laravel application: Chromium must be available on the host for PDF invoice generation, the Wayfinder TypeScript helpers must be generated before the Vite build, and theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lerichardv/patolab-platform/llms.txt
Use this file to discover all available pages before exploring further.
priorities_specimens_order table must be kept clean after any database restore to prevent Kanban board duplication. This guide covers both a traditional server deployment and a containerised Docker deployment.
- Traditional Server
- Docker
Set production environment values
Create or update the Also configure your production database connection and any other service credentials (WhatsApp, mail, etc.):
.env file on the server. At a minimum, set the following production-critical values:.env
.env
Install Composer dependencies (optimised)
Install PHP packages with development dependencies excluded and the autoloader fully optimised:
Build frontend assets
Install exact npm dependency versions from the lockfile and compile the production Vite bundle:The compiled assets are written to
public/build/ and referenced by Laravel’s Vite blade helper.Cache Laravel configuration, routes, and views
Dramatically improve response times by caching the three most frequently loaded framework artefacts:
Important: After runningconfig:cache, changes to your.envfile will not be reflected until you re-runphp artisan config:cache. Always re-run all three cache commands after any deployment.
Set storage permissions
Ensure the
storage and bootstrap/cache directories are writable by the web server user (typically www-data for Nginx/Apache with PHP-FPM):Run production migrations
Apply any pending database migrations using the
--force flag to skip the interactive production confirmation:Start the queue worker
PatoLab uses the database queue for invoice PDF generation, WhatsApp notifications, and other background jobs. Start a persistent daemon worker:For production it is strongly recommended to manage this process with Supervisor or systemd so it is restarted automatically if it exits. Below is a minimal Supervisor configuration example:
/etc/supervisor/conf.d/patolab-worker.conf
Configure Chromium for PDF generation
PatoLab uses Spatie Browsershot (backed by Chromium) to render PDF invoices and reports. Ensure Chromium is installed on the server, then set the executable path in your Adjust the path to match your Chromium installation (e.g.
.env:.env
/usr/bin/google-chrome-stable on Ubuntu with the Google Chrome package). The BROWSERSHOT_INCLUDE_PATH, BROWSERSHOT_NODE_BINARY, and BROWSERSHOT_NPM_BINARY variables in .env.example can also be set if Browsershot cannot locate Node.js automatically:.env
Database Restoration Warning
Server Requirements
The following server-level dependencies are required to run PatoLab in production:PHP
| Requirement | Minimum Version |
|---|---|
| PHP | 8.3+ |
Extension: gd | Required for image processing |
Extension: pdo_mysql | Required for MySQL database connections |
Extension: mbstring | Required by Laravel framework |
Extension: bcmath | Required by Laravel framework |
Extension: zip | Required for archive handling |
Extension: opcache | Strongly recommended for performance |
Runtime Dependencies
| Dependency | Notes |
|---|---|
| Node.js | Required at build time (asset compilation) and by Browsershot at runtime |
| npm | Required at build time for npm ci && npm run build |
| Chromium / Google Chrome | Required for PDF invoice and report generation via Spatie Browsershot |
