{"id":466,"date":"2025-08-27T22:34:15","date_gmt":"2025-08-27T22:34:15","guid":{"rendered":"https:\/\/1v0.net\/blog\/?p=466"},"modified":"2025-09-05T11:34:16","modified_gmt":"2025-09-05T11:34:16","slug":"laravel-deployment-checklist-for-2025","status":"publish","type":"post","link":"https:\/\/1v0.net\/blog\/laravel-deployment-checklist-for-2025\/","title":{"rendered":"Laravel Deployment Checklist for 2025"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Laravel Deployment Checklist for 2025<\/strong><\/h2>\n\n\n\n<p>Deploying a Laravel 12 application is more than just copying files to a server. A proper deployment process ensures performance, security, and maintainability in production. This checklist will help you avoid common pitfalls and ship your Laravel apps with confidence in 2025.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1 \u2014 Environment Configuration<\/strong><\/h2>\n\n\n<!-- DomainException(0): Unknown language: \"dotenv\" --># .env (production)\nAPP_ENV=production\nAPP_DEBUG=false\nAPP_URL=https:\/\/yourdomain.com\n\nLOG_CHANNEL=stack\n\nDB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=your_database\nDB_USERNAME=your_user\nDB_PASSWORD=your_password\n\n\n<p>Always disable <code>APP_DEBUG<\/code> in production to avoid exposing sensitive stack traces (see <a href=\"\/blog\/how-to-prevent-csrf-xss-and-sql-injection-in-laravel-apps\">How to Prevent CSRF, XSS, and SQL Injection in Laravel Apps<\/a> for more security tips).<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2 \u2014 Cache Config, Routes &amp; Views<\/strong><\/h2>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Optimize config, routes, and views<\/span>\nphp artisan config:cache\nphp artisan route:cache\nphp artisan view:cache<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This ensures Laravel loads configuration, routes, and views directly from cached files, reducing filesystem lookups. Learn more in <a href=\"\/blog\/10-proven-ways-to-optimize-laravel-for-high-traffic\">10 Proven Ways to Optimize Laravel for High Traffic<\/a>.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3 \u2014 Queue &amp; Scheduler Setup<\/strong><\/h2>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Supervisor config for queue workers (example)<\/span>\n&#91;program:laravel-worker]\nprocess_name=%(program_name)s_%(process_num)02d\n<span class=\"hljs-built_in\">command<\/span>=php \/var\/www\/current\/artisan queue:work --sleep=3 --tries=3 --max-time=3600\nautostart=<span class=\"hljs-literal\">true<\/span>\nautorestart=<span class=\"hljs-literal\">true<\/span>\nnumprocs=3\nredirect_stderr=<span class=\"hljs-literal\">true<\/span>\nstdout_logfile=\/var\/www\/current\/storage\/logs\/worker.log<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Queue workers should always be monitored by a process manager like Supervisor. This ensures failed jobs can be retried and workers restart if they crash. For more advanced queue monitoring, see <a href=\"\/blog\/how-to-use-laravel-horizon-for-queue-monitoring\">How to Use Laravel Horizon for Queue Monitoring<\/a>.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4 \u2014 File Storage &amp; Symbolic Links<\/strong><\/h2>\n\n\n\n<p>Make sure your <code>storage<\/code> and <code>bootstrap\/cache<\/code> folders are writable. Then link <code>storage\/app\/public<\/code> to <code>public\/storage<\/code>.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\">php artisan storage:link\nsudo chown -R www-data:www-data \/var\/www\/current\/storage \/var\/www\/current\/bootstrap\/cache\nsudo chmod -R 775 \/var\/www\/current\/storage \/var\/www\/current\/bootstrap\/cache<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This ensures user uploads (like images or documents) are accessible through the web server. For a deep dive into secure file handling, check <a href=\"\/blog\/how-to-prevent-csrf-xss-and-sql-injection-in-laravel-apps\">How to Prevent CSRF, XSS, and SQL Injection in Laravel Apps<\/a> and <a href=\"\/blog\/how-to-build-a-secure-file-upload-api-in-laravel\">How to Build a Secure File Upload API in Laravel<\/a>.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>5 \u2014 Database Migration &amp; Seeding<\/strong><\/h2>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash\"><span class=\"hljs-comment\"># Run migrations in production (force required)<\/span>\nphp artisan migrate --force\n\n<span class=\"hljs-comment\"># Optionally seed initial data<\/span>\nphp artisan db:seed --force<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Always run migrations with <code>--force<\/code> in production to apply schema changes without prompts. If you\u2019re working with multi-tenant setups, also see <a href=\"\/blog\/building-a-multi-tenant-app-in-laravel-with-separate-databases\">Building a Multi-Tenant App in Laravel with Separate Databases<\/a> for tenant-specific migrations.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>6 \u2014 Add Security Headers &amp; HTTPS<\/strong><\/h2>\n\n\n\n<p>Use Nginx to enforce HTTPS and add HTTP security headers.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Nginx\" data-shcb-language-slug=\"nginx\"><span><code class=\"hljs language-nginx\"><span class=\"hljs-section\">server<\/span> {\n    <span class=\"hljs-attribute\">listen<\/span> <span class=\"hljs-number\">443<\/span> ssl http2;\n    <span class=\"hljs-attribute\">server_name<\/span> your-domain.com;\n\n    <span class=\"hljs-attribute\">ssl_certificate<\/span>     \/etc\/letsencrypt\/live\/your-domain.com\/fullchain.pem;\n    <span class=\"hljs-attribute\">ssl_certificate_key<\/span> \/etc\/letsencrypt\/live\/your-domain.com\/privkey.pem;\n\n    <span class=\"hljs-attribute\">add_header<\/span> X-Frame-Options <span class=\"hljs-string\">\"SAMEORIGIN\"<\/span>;\n    <span class=\"hljs-attribute\">add_header<\/span> X-Content-Type-Options <span class=\"hljs-string\">\"nosniff\"<\/span>;\n    <span class=\"hljs-attribute\">add_header<\/span> Referrer-Policy <span class=\"hljs-string\">\"strict-origin-when-cross-origin\"<\/span>;\n    <span class=\"hljs-attribute\">add_header<\/span> Content-Security-Policy <span class=\"hljs-string\">\"default-src 'self'\"<\/span>;\n\n    <span class=\"hljs-attribute\">root<\/span> \/var\/www\/current\/public;\n    <span class=\"hljs-attribute\">index<\/span> index.php index.html;\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Nginx<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">nginx<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Certificates can be managed with Let\u2019s Encrypt for free. If you\u2019re using AWS or DigitalOcean, see <a href=\"\/blog\/how-to-deploy-a-laravel-12-app-on-digitalocean\">How to Deploy a Laravel 12 App on DigitalOcean<\/a> or <a href=\"\/blog\/deploying-laravel-on-aws-complete-guide-2025\">Deploying Laravel on AWS: Complete Guide (2025)<\/a> for infrastructure-specific instructions.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>7 \u2014 Deployment Sanity Check UI<\/strong><\/h2>\n\n\n\n<p>Add a simple admin-only endpoint to confirm Nginx headers, HTTPS, and storage access are all functioning correctly.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\">\/\/ routes\/web.php<\/span>\n<span class=\"hljs-keyword\">use<\/span> <span class=\"hljs-title\">Illuminate<\/span>\\\\<span class=\"hljs-title\">Support<\/span>\\\\<span class=\"hljs-title\">Facades<\/span>\\\\<span class=\"hljs-title\">Route<\/span>;\n\nRoute::middleware(&#91;<span class=\"hljs-string\">'auth'<\/span>,<span class=\"hljs-string\">'can:viewAdmin'<\/span>])-&gt;get(<span class=\"hljs-string\">'\/admin\/deployment-check'<\/span>, <span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-params\">()<\/span> <\/span>{\n    <span class=\"hljs-keyword\">return<\/span> view(<span class=\"hljs-string\">'admin.deployment-check'<\/span>, &#91;\n        <span class=\"hljs-string\">'phpVersion'<\/span> =&gt; phpversion(),\n        <span class=\"hljs-string\">'laravelEnv'<\/span> =&gt; app()-&gt;environment(),\n        <span class=\"hljs-string\">'isSecure'<\/span>   =&gt; request()-&gt;isSecure(),\n        <span class=\"hljs-string\">'clientIp'<\/span>   =&gt; request()-&gt;ip(),\n        <span class=\"hljs-string\">'cachePathWritable'<\/span> =&gt; is_writable(storage_path(<span class=\"hljs-string\">'framework\/cache'<\/span>)),\n    ]);\n});<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This creates a page that shows the PHP version, Laravel environment, whether HTTPS is active, the detected client IP (to confirm <code>real_ip<\/code> works), and whether cache directories are writable. Only admins should have access to this page.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml\"><span class=\"hljs-comment\">&lt;!-- resources\/views\/admin\/deployment-check.blade.php --&gt;<\/span>\n@extends('layouts.app')\n@section('content')\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"container\"<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"mb-4\"<\/span>&gt;<\/span>Deployment Health Check<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ul<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"list-group\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">li<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"list-group-item\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">strong<\/span>&gt;<\/span>PHP Version:<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">strong<\/span>&gt;<\/span> {{ $phpVersion }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">li<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">li<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"list-group-item\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">strong<\/span>&gt;<\/span>Environment:<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">strong<\/span>&gt;<\/span> {{ $laravelEnv }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">li<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">li<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"list-group-item\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">strong<\/span>&gt;<\/span>HTTPS Enabled:<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">strong<\/span>&gt;<\/span> {{ $isSecure ? 'Yes' : 'No' }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">li<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">li<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"list-group-item\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">strong<\/span>&gt;<\/span>Client IP:<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">strong<\/span>&gt;<\/span> {{ $clientIp }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">li<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">li<\/span> <span class=\"hljs-attr\">class<\/span>=<span class=\"hljs-string\">\"list-group-item\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">strong<\/span>&gt;<\/span>Cache Writable:<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">strong<\/span>&gt;<\/span> {{ $cachePathWritable ? 'Yes' : 'No' }}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">li<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">ul<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n@endsection<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This dashboard view provides instant feedback on whether your Laravel app is healthy and properly configured in production.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>By combining Nginx with Laravel 12, you get a fast and reliable production setup. Key steps include configuring the server block, enabling caching, ensuring HTTPS, tuning PHP-FPM, and monitoring your application. For more advanced scenarios, you can explore containerized setups or automated deployment tools.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">What\u2019s Next<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"\/blog\/laravel-deployment-checklist-for-2025\">Laravel Deployment Checklist for 2025<\/a> \u2014 a complete pre-launch checklist to avoid common mistakes.<\/li>\n\n\n\n<li><a href=\"\/blog\/optimizing-laravel-for-aws-deployment-step-by-step\">Optimizing Laravel for AWS Deployment (Step-by-Step)<\/a> \u2014 learn how to scale Laravel with AWS and integrate load balancers.<\/li>\n\n\n\n<li><a href=\"\/blog\/automating-laravel-deployments-with-deployer\">Automating Laravel Deployments with Deployer<\/a> \u2014 take your deployments to the next level with zero-downtime automation.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Laravel Deployment Checklist for 2025 Deploying a Laravel 12 application is more than just copying files to a server. A proper deployment process ensures performance, security, and maintainability in production. This checklist will help you avoid common pitfalls and ship your Laravel apps with confidence in 2025. 1 \u2014 Environment Configuration Always disable APP_DEBUG in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":470,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[71,82,44],"class_list":["post-466","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-devops","tag-nginx","tag-performance"],"_links":{"self":[{"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/posts\/466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/comments?post=466"}],"version-history":[{"count":1,"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/posts\/466\/revisions"}],"predecessor-version":[{"id":469,"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/posts\/466\/revisions\/469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/media\/470"}],"wp:attachment":[{"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/media?parent=466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/categories?post=466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/1v0.net\/blog\/wp-json\/wp\/v2\/tags?post=466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}