Deploy Laravel to Coolify with one command. Dashboard, CLI, and Dockerfile generation included.
Like Laravel Horizon for queues, but for your entire infrastructure.
Self-hosting with Coolify is great, but managing deployments from the Coolify UI gets tedious. This package gives you:
- A beautiful dashboard inside your Laravel app - deploy, restart, view logs, manage env vars
- Artisan commands for everything - CI/CD pipelines, local development, scripting
- Production-ready Dockerfiles generated automatically - no Docker knowledge required
- Full API access to Coolify - build custom tooling, automations, whatever you need
composer require stumason/laravel-coolify
php artisan coolify:installAdd to .env:
COOLIFY_URL=https://your-coolify.com
COOLIFY_TOKEN=your-api-tokenThen provision your infrastructure:
php artisan coolify:provisionThis creates app + PostgreSQL + Dragonfly on Coolify and deploys. The provision command automatically adds COOLIFY_PROJECT_UUID to your .env file, enabling all other commands to work without manual configuration.
Access at /coolify (configurable) - works like Horizon's dashboard.
| Feature | Description |
|---|---|
| Live Status | Real-time application health with animated indicators |
| One-Click Deploy | Deploy latest, force rebuild, or deploy specific commits |
| Deployment History | View all deployments with inline expandable build logs |
| Database Management | Start/stop/restart PostgreSQL, MySQL, Redis, Dragonfly |
| Environment Variables | Secure CRUD for env vars with masked values |
| Build Logs | Stream deployment logs in real-time |
| GitHub Integration | Links to commits, branches, repository |
| Coolify Deep Links | Jump directly to resources in Coolify UI |
The dashboard shows everything at a glance:
- Application status with health checks
- Current branch, commit, and last deploy time
- Database and cache status with connection strings
- Recent deployments with inline build logs
- Quick actions for deploy, restart, stop
Install laravel-kick on your deployed app for enhanced introspection:
# On your deployed app
composer require stumason/laravel-kickAdd to the app's Coolify environment:
KICK_ENABLED=true
KICK_TOKEN=your-secure-token
A new Kick tab appears with:
- Health checks (database, cache, storage, redis)
- System stats (CPU, memory, disk, uptime)
- Log viewer with filtering and search
- Queue status and failed jobs
- Artisan command execution
| Command | Description |
|---|---|
coolify:install |
Publish config, generate Dockerfile |
coolify:provision |
Create infrastructure on Coolify |
coolify:deploy |
Trigger deployment |
coolify:status |
Show application status |
coolify:logs |
View application logs |
coolify:restart |
Restart application |
coolify:rollback |
Rollback to previous deployment |
# .github/workflows/deploy.yml
- name: Deploy to Coolify
run: php artisan coolify:deploy --force
env:
COOLIFY_URL: ${{ secrets.COOLIFY_URL }}
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}The install command generates production-optimized Docker configuration:
php artisan coolify:installCreates:
Dockerfile- Multi-stage build with OPcache, proper permissionsdocker/nginx.conf- Optimized for Laraveldocker/supervisord.conf- Process management (Horizon, Reverb, Scheduler auto-detected)docker/php.ini- Production PHP settings
Auto-detects and configures:
- Laravel Horizon (queue workers)
- Laravel Reverb (WebSockets)
- Laravel Scheduler
use Stumason\Coolify\Coolify;
// Deploy
Coolify::deploy();
Coolify::deploy('custom-uuid');
// Status
$status = Coolify::status();
$logs = Coolify::logs();
// Repositories for full control
Coolify::applications()->get($uuid);
Coolify::applications()->deploy($uuid, force: true);
Coolify::applications()->restart($uuid);
Coolify::applications()->envs($uuid);
Coolify::databases()->all();
Coolify::databases()->start($uuid);
Coolify::deployments()->forApplication($uuid);
Coolify::deployments()->cancel($uuid);
Coolify::servers()->all();
Coolify::services()->all();After running coolify:provision, your .env will contain:
COOLIFY_URL=https://your-coolify.com
COOLIFY_TOKEN=your-api-token
COOLIFY_PROJECT_UUID=your-project-uuid # Added automatically by provisionThe dashboard automatically fetches your application and resources from the configured project's environment. No need to manually configure application UUIDs.
// config/coolify.php
return [
'url' => env('COOLIFY_URL'),
'token' => env('COOLIFY_TOKEN'),
'project_uuid' => env('COOLIFY_PROJECT_UUID'), // Set by coolify:provision
'path' => env('COOLIFY_PATH', 'coolify'),
'docker' => [
'php_version' => '8.4',
'use_base_image' => true, // Fast builds with pre-built images
],
];By default, the dashboard is only accessible in local environment. For production:
// app/Providers/AppServiceProvider.php
use Stumason\Coolify\Coolify;
public function boot(): void
{
Coolify::auth(function ($request) {
return $request->user()?->isAdmin();
});
}- PHP 8.2+
- Laravel 11 or 12
- Coolify 4.x instance with API access
composer test # Run tests
composer test:coverage # With coverage
composer lint # Static analysisContributions welcome! Please read CONTRIBUTING.md first.
MIT - see LICENSE
