Deploy Laravel on Temps
Deploy Laravel applications with a managed PostgreSQL database, Nginx + PHP-FPM, and queue workers. Artisan commands and migrations run automatically.
What you get with Laravel on Temps
Everything your Laravel app needs in production, configured automatically.
Prerequisites
Before deploying Laravel to Temps, confirm your project meets these requirements. New Laravel projects created with composer create-project satisfy all of them out of the box.
Confirm your Composer dependencies install cleanly for production:
# Install production dependencies (no dev packages) composer install --no-dev --optimize-autoloader # Generate a fresh APP_KEY (copy the output — don't commit it) php artisan key:generate --show
Quick start
A Temps-ready Laravel project needs a Procfile that defines three process types: the web server, a queue worker, and release commands for migrations and storage setup. Temps runs the release phase before routing any traffic to the new deployment.
Project structure
Temps looks for artisan and composer.json at the repository root to detect Laravel.
my-laravel-app/ ├── artisan ├── composer.json ├── composer.lock ├── Procfile ├── .env.example ├── app/ ├── bootstrap/ ├── config/ ├── database/ │ └── migrations/ ├── public/ ├── resources/ ├── routes/ └── storage/
Procfile
The Procfile defines every process Temps should run. The web process serves HTTP traffic through Nginx + PHP-FPM. The worker process drains the queue. The release command runs once per deploy before traffic switches — use it for migrations and the storage symlink.
web: php-fpm -D && nginx -g "daemon off;" worker: php artisan queue:work --sleep=3 --tries=3 --max-time=3600 release: php artisan migrate --force && php artisan storage:link
bootstrap/app.php — trust the load balancer
Temps terminates HTTPS at the load balancer and forwards traffic as HTTP internally. Without configuring trusted proxies, Laravel generates http:// URLs even on a domain with a valid certificate. Add this to bootstrap/app.php:
// bootstrap/app.php
return Application::configure(basePath: dirname(__DIR__))
->withRouting(...)
->withMiddleware(function (Middleware $middleware) {
// Trust all proxies — Temps uses a private network load balancer
$middleware->trustProxies(at: '*');
})
->create();Required environment variables
Set these in the Temps dashboard under your project's Environment tab. Temps also reads from your .env.example to pre-populate the env var form when you create a new project.
| Variable | Description |
|---|---|
| APP_KEY | Encryption key — generate with key:generate --show |
| APP_ENV | Set to production — changes error handling and caching |
| APP_URL | Full public URL including https:// |
| DB_CONNECTION | Database driver — use pgsql for Temps-managed PostgreSQL |
| DB_HOST / DB_PORT / DB_DATABASE / DB_USERNAME / DB_PASSWORD | Auto-injected by Temps when PostgreSQL is attached |
| QUEUE_CONNECTION | Use redis (recommended) or database — never sync |
| REDIS_URL | Auto-injected by Temps when Redis is attached |
| PHP_VERSION | Specify the PHP runtime version |
Deploy from the CLI
The Temps CLI deploys your Laravel app directly from your terminal without requiring the dashboard. The first deploy provisions PostgreSQL and Redis, attaches them to your project, runs migrations, creates the storage symlink, and brings your app online with HTTPS in under two minutes.
# 1. Authenticate with your Temps account
$ bunx @temps-sdk/cli login
# 2. Create a new project (one-time setup)
$ bunx @temps-sdk/cli projects create -n "my-laravel-app"
# 3. Attach managed PostgreSQL and Redis
$ bunx @temps-sdk/cli services add postgresql my-laravel-app
$ bunx @temps-sdk/cli services add redis my-laravel-app
# 4. Deploy to production (re-run on every update)
$ bunx @temps-sdk/cli deploy my-laravel-app -e production -y
Temps runs your release Procfile command automatically after each build, before traffic is switched to the new deployment. Read the full Laravel deployment guide for zero-downtime deploys, horizon configuration, and custom Nginx rules.
Common errors and how to fix them
These four issues cause the vast majority of failed Laravel deployments. Each one is easy to miss locally but immediately visible in production.
APP_KEY not set — cryptographic failure on every request
No application encryption key has been specified. Laravel throws this immediately on boot, before handling any HTTP request, which means your app returns a 500 for every visitor.
Queue jobs silently dropped — worker process not started
Emails, notifications, and background tasks appear to dispatch without error but never execute. Jobs accumulate in the database with no workers consuming them.
APP_URL wrong — pagination, mail links, and redirects break
Email verification links point to localhost. Pagination links use http:// instead of https://. OAuth callbacks redirect to the wrong host.
Storage symlink missing — uploaded files return 404
Files stored via Storage::disk('public') are saved successfully but return a 404 when accessed. The public/storage directory does not exist or is a broken symlink.
Managed services for Laravel
Provision PostgreSQL and Redis with one command each. Connection strings are injected automatically — no copy-pasting credentials between the dashboard and your .env.
PostgreSQL
Production database with automatic backups
Redis
Caching, sessions, and queue backend
Deploy in 2 minutes
Connect your repo
Link your GitHub, GitLab, or Bitbucket repository. Temps detects artisan and composer.json automatically.
Add services
Provision PostgreSQL and Redis with one click each. DB credentials and REDIS_URL are injected into your Laravel environment automatically.
Push to deploy
Push to your branch and Temps installs dependencies, runs migrations, creates the storage symlink, and serves with HTTPS.
Everything included
No separate subscriptions for analytics, monitoring, or error tracking.
Automatic HTTPS
Free SSL certificates for every domain. Provisioned and renewed automatically.
Preview Deployments
Every pull request gets its own URL. Review changes before they go live.
Built-in Analytics
Privacy-first analytics included. No third-party scripts or cookie banners.
Error Tracking
Sentry-compatible error tracking with stack traces, context, and alerts.
Session Replay
Watch how users interact with your app. Debug issues visually.
Uptime Monitoring
24/7 health checks with Slack, Discord, and email alerts.
Ready to deploy Laravel?
Follow the step-by-step tutorial or deploy from the CLI in 2 minutes. Free tier available — no credit card required.