2 minutes to production

Deploy Laravel on Temps

Deploy Laravel applications with a managed PostgreSQL database, Nginx + PHP-FPM, and queue workers. Artisan commands and migrations run automatically.

Automatic HTTPSDeploy on git pushFree tier available

What you get with Laravel on Temps

Everything your Laravel app needs in production, configured automatically.

Managed PostgreSQL database
Nginx + PHP-FPM production stack
Queue workers and scheduler
Artisan migrations on deploy
Laravel Horizon support
Health check monitoring

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.

PHP 8.2 or newer (8.3 recommended for 2026 deployments)
composer.json and artisan at the repository root
A .env.example committed to the repository (Temps uses this as the env var template)
APP_KEY generated with php artisan key:generate --show and stored as a secret env var
Database connection configured for PostgreSQL (pgsql driver)
Queue connection set to redis or database (not sync) for production

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.

VariableDescription
APP_KEYEncryption key — generate with key:generate --show
APP_ENVSet to production — changes error handling and caching
APP_URLFull public URL including https://
DB_CONNECTIONDatabase driver — use pgsql for Temps-managed PostgreSQL
DB_HOST / DB_PORT / DB_DATABASE / DB_USERNAME / DB_PASSWORDAuto-injected by Temps when PostgreSQL is attached
QUEUE_CONNECTIONUse redis (recommended) or database — never sync
REDIS_URLAuto-injected by Temps when Redis is attached
PHP_VERSIONSpecify 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.

Terminal

# 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.

1

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.

Generate a fresh key locally and set it as an environment variable: # Generate a key locally php artisan key:generate --show # Output: base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= Set APP_KEY in your Temps environment: APP_KEY=base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx= Never commit .env to git — set APP_KEY as a secret env var in the Temps dashboard. Temps injects it into your container at runtime. Every Laravel environment (local, staging, production) should have its own unique key.
2

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.

Add a worker process to your Procfile alongside the web process: 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 Temps runs the worker process as a separate container. Without it, dispatched jobs sit in the queue indefinitely. Set QUEUE_CONNECTION=redis (recommended) or database in your environment — never use sync in production or failed jobs will block request threads.
3

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.

Set APP_URL to your exact production URL including the protocol: APP_URL=https://yourapp.temps.sh Also force HTTPS by setting the trusted proxies in bootstrap/app.php. Temps terminates TLS at the load balancer and forwards traffic as HTTP internally, so Laravel must trust the X-Forwarded-Proto header: // bootstrap/app.php ->withMiddleware(function (Middleware $middleware) { $middleware->trustProxies(at: '*'); }) Without this, url() and secure_url() generate incorrect links even after APP_URL is correct.
4

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.

Run storage:link as part of your deployment release phase: # Procfile release: php artisan migrate --force && php artisan storage:link The storage:link command creates a symbolic link from public/storage to storage/app/public. This command must run on every fresh deployment because container filesystems are ephemeral — symlinks from previous deploys do not persist. Temps runs the release command after the build and before routing traffic, so the symlink is ready before any user request lands.

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

1

Connect your repo

Link your GitHub, GitLab, or Bitbucket repository. Temps detects artisan and composer.json automatically.

2

Add services

Provision PostgreSQL and Redis with one click each. DB credentials and REDIS_URL are injected into your Laravel environment automatically.

3

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.