• Docs
  • Changelog
Sign in
Get started
    • Home
    • Your first deploy
    • Free instances
    • Platform features by plan
    • Use with coding agents
    • FAQ
    • Templates
      • Migrate from…
        • Heroku
        • Railway
    • Compute plans
    • SandboxesBeta
      • Service types
        • Which to use?
        • Static sites
        • Web services
        • Private services
        • Background workers
        • Cron jobs
        • Workflows
        • Multi-service architectures
      • Data storage
        • Render Postgres
        • Render Key Value (Redis®-compatible)
        • Persistent disks
    • How deploys work
    • Supported languages
    • Git providers (GitHub, etc.)
    • Build pipeline
    • Deploy hooks
    • Monorepo support
    • Troubleshooting deploys
      • Previewing changes
        • Single-service previews
        • Preview environments (multi-service)
      • Docker deploys
        • Overview
        • Deploy a registered image
        • Using secrets
      • Runtime
        • Native runtimes
        • Environment variables & secrets
        • Default environment variables
    • Intro to sandboxes
    • Limits
      • How to…
        • Create & configure sandboxes
        • Execute commands
        • Manage files
        • Manage snapshots
      • Use with…
        • Claude Managed Agents
        • Cursor Cloud Agents
        • OpenAI Agents API
      • SDK/CLI reference
        • TypeScript SDK
        • Python SDK
        • CLI commands
    • Intro to workflows
    • Tutorial
    • Limits & pricing
      • How to…
        • Define tasks
        • Define flowsNew
        • Trigger runs
        • Develop locally
      • SDK reference
        • TypeScript SDK
        • Python SDK
      • Example workflows
        • TypeScript examples
        • Python examples
    • Overview
    • Create & connect
    • Database credentials
    • Extensions
    • Version upgrades
    • Logical replication
    • Legacy instance types
      • Database recovery
        • Recovery & backups
        • High availability
      • Database performance
        • Read replicas
        • Connection pooling
        • Admin apps
        • Repacking tables
        • Troubleshooting performance
    • Regions
    • Inbound IP rules
    • Edge caching
    • WebSockets
    • TLS certificates
      • Custom domains
        • Overview
        • Cloudflare
        • Namecheap
        • Other DNS providers
      • Internal traffic
        • Private network
        • Private links
      • Outbound traffic
        • Default IP ranges
        • Dedicated IP addresses
        • Outbound bandwidth
        • Handling network changes
      • Static site config
        • Custom response headers
        • Redirects & rewrites
    • The Render Dashboard
    • SSH / Shell access
    • Projects & environments
      • Service actions
        • Scaling
        • Rollbacks
        • Maintenance mode
        • One-off jobs
      • Infrastructure as code
        • Blueprints overview
        • render.yaml reference
        • Terraform provider
    • In-dashboard metrics
    • Health checks
    • Uptime best practices
      • Logging
        • In-dashboard logs
        • Log streams (syslog/HTTPS)
      • OpenTelemetry (OTel) metrics
        • Provider setup
        • Metrics reference
      • Notifications
        • Webhooks
        • Email / Slack
    • MCP Server
      • Render CLI
        • Overview
        • Command reference
      • REST API
        • Overview
        • API reference
      • Third-party connections
        • OIDC support
        • Datadog
    • Workspaces, members, & roles
    • Login settings
    • Audit logs
      • Organizations
        • Overview
        • SAML SSO
    • DDoS protection
    • Platform maintenance
      • Compliance
        • Overview
        • HIPAA (US health data)
        • HIPAA best practices
        • Shared responsibility model
        • Pentest policy
    • Heroku vs Render
    • Vercel vs Render

Deploy a PHP Web App with Laravel and Docker

Laravel is one of the most popular web frameworks for PHP and for good reason. It comes bundled with most common web app needs, including authentication, authorization, localization, and support for multiple database backends including PostgreSQL.

In this guide, we're going to deploy a simple Laravel 11 web app using Render's native PostgreSQL and Docker support.

Let's get started!

  1. Create a new PostgreSQL database on Render and copy the internal DB URL to use below.

  2. Fork render-examples/php-laravel-docker and create a new Web Service on Render, giving Render permission to access your forked repo.

  3. Select Docker for the runtime, and add the following environment variables under the Advanced section:

    KeyValue
    DATABASE_URLThe internal database URL for the database you created above.
    DB_CONNECTIONpgsql
    APP_KEYCopy the output of php artisan key:generate --show

That's it! Your Laravel web app will be live on your Render URL as soon as the build finishes. You can test it out by registering and logging in.

Modifying an Existing Laravel App for Render

The commit history of our sample repo is useful in understanding the modifications needed for an existing Laravel app.

  1. Force HTTPS on all assets served by Laravel to avoid mixed content warnings in the browser. Render already manages and terminates TLS certificates for you, but Laravel's asset helper needs to be configured to serve everything over TLS.

    You can do this in one of two ways:

    A. Set the ASSET_URL environment variable, OR

    B. Follow the changes in Force HTTPS for Laravel. In the end, the contents of app/Providers/AppServiceProvider.php would look something like this:

  2. Configure your repo to deploy Laravel using Docker and NGINX. We're building on the nginx-php-fpm Docker image as shown here, and adding php-fpm configuration for NGINX to tie everything together.

    Make sure to add the .dockerignore file to your repo to avoid adding unnecessary or confidential information to your Docker image.

  3. Finally, add a deploy script that will be run when your PHP app starts up.

You should now be able to deploy your existing Laravel app on Render.

Deploy a PHP Web App with Laravel and Docker
  • Modifying an Existing Laravel App for Render
All Systems Operational
© Render Inc. All rights reserved.