This guide walks you through deploying Contacts DB to a production server — whether that is a bare VPS, a shared hosting environment, or a managed platform like Laravel Forge or Ploi. It covers environment configuration, database migration, asset compilation, queue workers, the task scheduler, and web server setup. Follow each step in order for a clean, repeatable deployment.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/0m1n3m/contacts-db/llms.txt
Use this file to discover all available pages before exploring further.
Pre-deployment checklist
Configure the environment file
Copy At minimum, set:
.env.example to .env on the server and set the core variables:Configure the database
Contacts DB ships with SQLite as the default for local development. In production, switch to MySQL or PostgreSQL:Create the database and the user before running migrations.
Configure the mail driver
The default Supported mailers include
MAIL_MAILER=log writes mail to log files. Replace it with a real transport for production:smtp, mailgun, ses, postmark, and sendmail.Configure the queue connection
The default
QUEUE_CONNECTION=database works out of the box once migrations have run. For higher throughput you can switch to Redis:Cache configuration, routes, and views
Caching these significantly reduces per-request overhead:Re-run these commands after every deployment that changes configuration, routes, or Blade templates.
Run database migrations
Apply all pending migrations with the
--force flag (required in production to bypass the confirmation prompt):Seed the admin user
Create the initial admin account using the seeder:Run this only once on a fresh database. Subsequent deployments should not re-run seeders unless you specifically need to reset seed data.
Environment variables summary
A minimal production.env looks like this:
MAIL_*, REDIS_*, and AWS_* variables to match your infrastructure.
Queue worker
Contacts DB uses Laravel queues for sending notifications and processing background jobs. You must run at least one queue worker process continuously in production.Supervisor configuration
Supervisor is the recommended way to keep the queue worker running and restart it automatically on failure. Create a configuration file at/etc/supervisor/conf.d/contacts-db-worker.conf:
Task scheduler
Contacts DB schedules background jobs (such as due-soon reminders) using Laravel’s built-in scheduler. Add a single crontab entry that runs every minute:Web server (Nginx)
Point Nginx at thepublic/ directory. Below is a minimal configuration for a standard HTTP server block. Add an SSL block via Certbot or your certificate provider for HTTPS:
php8.3-fpm.sock with the socket path for the PHP-FPM version installed on your server. After editing, test and reload Nginx:
The
composer run dev script (defined in composer.json) starts a multi-process development environment using concurrently — running php artisan serve, queue:listen, pail, and Vite’s dev server together. Never use composer run dev in production. Use a proper web server (Nginx + PHP-FPM), a Supervisor-managed queue worker, and the compiled Vite assets from npm run build.