# Laravel

Deploy Laravel on Render with this Docker PHP template. Get your app live in minutes with PostgreSQL database support.

- Repository: https://github.com/render-examples/php-laravel-docker
- Stack: docker, php, postgresql
- Tags: backend
- URL: https://render.com/templates/laravel

## Why deploy Laravel on Render?

Laravel is a PHP web application framework that provides an expressive syntax and built-in tools for common tasks like routing, authentication, and database management. It solves the problem of repetitive boilerplate code and inconsistent project structure by offering a standardized, feature-rich foundation for building web applications quickly.

This template provides a production-ready Laravel 11 setup with a Dockerized PHP environment, but you'll need to manually create the PostgreSQL database and wire up the DATABASE_URL, APP_KEY, and DB_CONNECTION environment variables yourself. Render's managed Postgres handles backups, connection pooling, and maintenance, while the Docker-based web service gives you full control over your PHP runtime configuration. You skip the typical server provisioning and container orchestration headaches, though the multi-step setup means this isn't quite a one-click deploy—budget about 10 minutes to connect the pieces.

## What you can build

You'll have a Laravel 11 application running in a Docker container with a connected PostgreSQL database. The app comes with working user registration and authentication, so you can immediately start building on top of it or use it as a reference for containerizing your own Laravel projects.

## Key features

- *Docker PHP deployment*: Pre-configured Dockerfile for deploying Laravel applications in a containerized PHP environment.
- *PostgreSQL integration*: Ready-to-use database configuration with PostgreSQL via DATABASE_URL environment variable.
- *Render platform ready*: Includes all necessary configuration for one-click deployment to Render web services.
- *Laravel 11 boilerplate*: Ships with Laravel 11 including working authentication system for user registration and login.

## Use cases

- Indie developer deploys Laravel SaaS prototype without managing server infrastructure
- Agency developer containerizes client Laravel project for consistent team environments
- Backend engineer migrates Laravel app from shared hosting to scalable cloud
- Startup founder launches MVP with PostgreSQL database and user authentication ready

## Prerequisites

- *Laravel Application Key*: A unique encryption key used by Laravel to secure user sessions and other encrypted data, generated by running 'php artisan key:generate --show' locally.

## Next steps

1. Open your Render web service URL in a browser — You should see the Laravel welcome page or default homepage load successfully
2. Click Register and create a test user account with an email and password — You should be redirected to the dashboard, confirming the PostgreSQL database connection is working
3. Log out and log back in with your test credentials — You should successfully authenticate and return to the dashboard, verifying session handling is configured correctly

## Resources

- [Laravel official site](https://laravel.com)
