CINXE.COM
Laravel Homestead - Laravel 11.x - The PHP Framework For Web Artisans
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Laravel Homestead - Laravel 11.x - The PHP Framework For Web Artisans</title> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover"> <link rel="canonical" href="https://laravel.com/docs/11.x/homestead"> <!-- Primary Meta Tags --> <meta name="title" content="Laravel - The PHP Framework For Web Artisans"> <meta name="description" content="Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things."> <!-- Open Graph / Facebook --> <meta property="og:type" content="website"> <meta property="og:url" content="https://laravel.com/"> <meta property="og:title" content="Laravel - The PHP Framework For Web Artisans"> <meta property="og:description" content="Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things."> <meta property="og:image" content="https://laravel.com/img/og-image.jpg"> <!-- Twitter --> <meta property="twitter:card" content="summary_large_image"> <meta property="twitter:url" content="https://laravel.com/"> <meta property="twitter:title" content="Laravel - The PHP Framework For Web Artisans"> <meta property="twitter:description" content="Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things."> <meta property="twitter:image" content="https://laravel.com/img/og-image.jpg"> <!-- Favicon --> <link rel="apple-touch-icon" sizes="180x180" href="/img/favicon/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/img/favicon/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/img/favicon/favicon-16x16.png"> <link rel="manifest" href="/img/favicon/site.webmanifest"> <link rel="mask-icon" href="/img/favicon/safari-pinned-tab.svg" color="#ff2d20"> <link rel="shortcut icon" href="/img/favicon/favicon.ico"> <meta name="msapplication-TileColor" content="#ff2d20"> <meta name="msapplication-config" content="/img/favicon/browserconfig.xml"> <meta name="theme-color" content="#ffffff"> <meta name="color-scheme" content="light"> <link rel="preconnect" href="https://E3MIRNPJH5-dsn.algolia.net" crossorigin /> <link rel="stylesheet" href="https://use.typekit.net/ins2wgm.css"> <link rel="preload" as="style" href="https://laravel.com/build/assets/app-dc063eeb.css" /><link rel="modulepreload" href="https://laravel.com/build/assets/app-70a5a3a6.js" /><link rel="modulepreload" href="https://laravel.com/build/assets/docs-45166933.js" /><link rel="stylesheet" href="https://laravel.com/build/assets/app-dc063eeb.css" /><script type="module" src="https://laravel.com/build/assets/app-70a5a3a6.js"></script><script type="module" src="https://laravel.com/build/assets/docs-45166933.js"></script> <!-- Fathom - beautiful, simple website analytics --> <script src="https://cdn.usefathom.com/script.js" data-site="DVMEKBYF" defer></script> <!-- / Fathom --> <!-- Clearbit --> <script async src="https://tag.clearbitscripts.com/v1/pk_97d2bf69f817feb07be42fcda1460119/tags.js" referrerpolicy="strict-origin-when-cross-origin"></script> <script> const alwaysLightMode = false; </script> <script> function updateTheme() { if (!('theme' in localStorage)) { localStorage.theme = 'system'; } switch (localStorage.theme) { case 'system': if (window.matchMedia('(prefers-color-scheme: dark)').matches) { document.documentElement.classList.add('dark'); document.documentElement.setAttribute('data-theme', 'dark'); } else { document.documentElement.classList.remove('dark'); document.documentElement.setAttribute('data-theme', 'light'); } document.documentElement.setAttribute('color-theme', 'system'); break; case 'dark': document.documentElement.classList.add('dark'); document.documentElement.setAttribute('color-theme', 'dark'); document.documentElement.setAttribute('data-theme', 'dark'); break; case 'light': document.documentElement.classList.remove('dark'); document.documentElement.setAttribute('color-theme', 'light'); document.documentElement.setAttribute('data-theme', 'light'); break; } updateThemeAndSchemeColor(); } function updateThemeAndSchemeColor() { if (! alwaysLightMode) { if (document.documentElement.classList.contains('dark')) { document.querySelector('meta[name="color-scheme"]').setAttribute('content', 'dark'); document.querySelector('meta[name="theme-color"]').setAttribute('content', '#171923'); return; } document.querySelector('meta[name="color-scheme"]').setAttribute('content', 'light'); document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff'); } } updateTheme(); </script> </head> <body x-data="{ navIsOpen: false, }" class="w-full h-full font-sans antialiased text-gray-900 language-php" data-instant-intensity="0" > <a id="skip-to-content-link" href="#main-content" class="absolute bg-gray-100 px-4 py-2 top-3 left-3 text-gray-700 shadow-xl" > Skip to content </a> <div class="items-center justify-center bg-gradient-to-b from-red-500 to-red-600 p-2 text-center text-white text-sm h-9"> <template id="news-herd"> <div> <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-white" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" stroke-linecap="round" fill="none" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M3 4m0 1a1 1 0 0 1 1 -1h16a1 1 0 0 1 1 1v14a1 1 0 0 1 -1 1h-16a1 1 0 0 1 -1 -1z" /> <path d="M7 8v1" /> <path d="M17 8v1" /> <path d="M12.5 4c-.654 1.486 -1.26 3.443 -1.5 9h2.5c-.19 2.867 .094 5.024 .5 7" /> <path d="M7 15.5c3.667 2 6.333 2 10 0" /> </svg> </div> <div class="mt-px ml-1"> Get started with PHP and Laravel faster than ever using <a href="https://herd.laravel.com" class="underline">Laravel Herd</a>. </div> </template> <template id="news-laracon"> <div><svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div> <div class="mt-px ml-1"> Join us in Dallas, TX! Tickets are now available for <a href="https://laracon.us" class="underline">Laracon US</a>. </div> </template> <template id="news-laracon-in"> <div><svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div> <div class="mt-px ml-1"> Let's go to India! Tickets are now available for <a href="https://laracon.in" class="underline">Laracon IN</a>. </div> </template> <template id="news-laracon-eu"> <div><svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div> <div class="mt-px ml-1"> Let's go to Europe! Tickets are now available for <a href="https://laracon.eu" class="underline">Laracon EU</a>. </div> </template> <template id="news-laracon-au"> <div><svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div> <div class="mt-px ml-1"> Let's go down under! Tickets are now available for <a href="https://laracon.au" class="underline">Laracon AU</a>. </div> </template> <template id="news-forge"> <div><svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path></svg></div> <div class="mt-px ml-1"> Servers with PHP 8.3 are now available for provisioning via <a href="https://forge.laravel.com" class="underline">Laravel Forge</a>. </div> </template> <template id="news-vapor"> <div><svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"></path></svg></div> <div class="mt-px ml-1"> Deploy Laravel with the infinite scale of serverless using <a href="https://vapor.laravel.com" class="underline">Laravel Vapor</a>. </div> </template> <template id="news-cloud"> <div class="mt-px ml-1"> Join the waitlist for <a href="https://cloud.laravel.com" class="underline">Laravel Cloud</a><span class="hidden md:inline">, the future of shipping</span>. </div> </template> <template id="news-nightwatch"> <div class="mt-px ml-1"> Join the waitlist for <a href="https://nightwatch.laravel.com" class="underline">Laravel Nightwatch</a><span class="hidden md:inline">, first-class monitoring designed for Laravel</span>. </div> </template> <template id="news-pulse"> <div><svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z"></path></svg></div> <div class="mt-px ml-1"> How's your health? Check your application's vital signs using <a href="https://pulse.laravel.com" class="underline">Laravel Pulse</a>. </div> </template> <template id="news-reverb"> <div> <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-white" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M3.707 6.293l2.586 -2.586a1 1 0 0 1 1.414 0l5.586 5.586a1 1 0 0 1 0 1.414l-2.586 2.586a1 1 0 0 1 -1.414 0l-5.586 -5.586a1 1 0 0 1 0 -1.414z" /> <path d="M6 10l-3 3l3 3l3 -3" /> <path d="M10 6l3 -3l3 3l-3 3" /> <path d="M12 12l1.5 1.5" /> <path d="M14.5 17a2.5 2.5 0 0 0 2.5 -2.5" /> <path d="M15 21a6 6 0 0 0 6 -6" /> </svg> </div> <div class="mt-px ml-1"> Incoming transmission received. <a href="https://reverb.laravel.com" class="underline">Laravel Reverb</a> is now available! </div> </template> <template id="news-nova"> <div> <svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"> <path stroke-linecap="round" stroke-linejoin="round" d="M15.59 14.37a6 6 0 01-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 006.16-12.12A14.98 14.98 0 009.631 8.41m5.96 5.96a14.926 14.926 0 01-5.841 2.58m-.119-8.54a6 6 0 00-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 00-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 01-2.448-2.448 14.9 14.9 0 01.06-.312m-2.24 2.39a4.493 4.493 0 00-1.757 4.306 4.493 4.493 0 004.306-1.758M16.5 9a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0z"></path> </svg> </div> <div class="mt-px ml-1"> Take your administration backend to another dimension with <a href="https://nova.laravel.com" class="underline">Laravel Nova</a>. </div> </template> <template id="news-careers"> <div> <svg class="w-5 h-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"> <path stroke-linecap="round" stroke-linejoin="round" d="M20.25 14.15v4.25c0 1.094-.787 2.036-1.872 2.18-2.087.277-4.216.42-6.378.42s-4.291-.143-6.378-.42c-1.085-.144-1.872-1.086-1.872-2.18v-4.25m16.5 0a2.18 2.18 0 0 0 .75-1.661V8.706c0-1.081-.768-2.015-1.837-2.175a48.114 48.114 0 0 0-3.413-.387m4.5 8.006c-.194.165-.42.295-.673.38A23.978 23.978 0 0 1 12 15.75c-2.648 0-5.195-.429-7.577-1.22a2.016 2.016 0 0 1-.673-.38m0 0A2.18 2.18 0 0 1 3 12.489V8.706c0-1.081.768-2.015 1.837-2.175a48.111 48.111 0 0 1 3.413-.387m7.5 0V5.25A2.25 2.25 0 0 0 13.5 3h-3a2.25 2.25 0 0 0-2.25 2.25v.894m7.5 0a48.667 48.667 0 0 0-7.5 0M12 12.75h.008v.008H12v-.008Z" /> </svg> </div> <div class="mt-px ml-1"> Laravel is hiring! <a href="https://laravel.com/careers" class="underline">Help us build the future of Laravel</a>. </div> </template> </div> <script> const activeNewsTemplate = document.getElementById( 'news-'+JSON.parse('[\u0022cloud\u0022,\u0022nightwatch\u0022]')[Math.floor(Math.random() * 2)] ) activeNewsTemplate.replaceWith(activeNewsTemplate.content) </script> <div class="relative dark:bg-dark-700" id="docsScreen"> <div class="relative lg:flex lg:items-start"> <aside class="hidden fixed top-0 bottom-0 left-0 z-20 w-16 bg-gradient-to-b from-gray-100 to-white transition-all duration-300 lg:sticky lg:w-80 lg:shrink-0 lg:flex lg:flex-col lg:justify-end lg:items-end 2xl:max-w-lg 2xl:w-full dark:from-dark-800 dark:to-dark-700"> <div class="relative max-h-screen overflow-auto flex-1 flex flex-col xl:w-80"> <a href="/" class="flex items-center py-8 px-4 lg:px-8 xl:px-16"> <img class="w-8 h-8 shrink-0 transition-all duration-300 lg:w-12 lg:h-12" src="/img/logomark.min.svg" alt="Laravel" width="50" height="52" > <img src="/img/logotype.min.svg" alt="Laravel" class="hidden ml-4 lg:block" width="114" height="29" > </a> <div class="px-4 pb-10 lg:px-8 xl:px-16"> <nav id="indexed-nav" class="hidden lg:block lg:mt-4"> <div class="docs_sidebar"> <ul> <li> <h2>Prologue</h2> <ul> <li> <a href="/docs/11.x/releases">Release Notes</a> </li> <li> <a href="/docs/11.x/upgrade">Upgrade Guide</a> </li> <li> <a href="/docs/11.x/contributions">Contribution Guide</a> </li> </ul> </li> <li> <h2>Getting Started</h2> <ul> <li> <a href="/docs/11.x/installation">Installation</a> </li> <li> <a href="/docs/11.x/configuration">Configuration</a> </li> <li> <a href="/docs/11.x/structure">Directory Structure</a> </li> <li> <a href="/docs/11.x/frontend">Frontend</a> </li> <li> <a href="/docs/11.x/starter-kits">Starter Kits</a> </li> <li> <a href="/docs/11.x/deployment">Deployment</a> </li> </ul> </li> <li> <h2>Architecture Concepts</h2> <ul> <li> <a href="/docs/11.x/lifecycle">Request Lifecycle</a> </li> <li> <a href="/docs/11.x/container">Service Container</a> </li> <li> <a href="/docs/11.x/providers">Service Providers</a> </li> <li> <a href="/docs/11.x/facades">Facades</a> </li> </ul> </li> <li> <h2>The Basics</h2> <ul> <li> <a href="/docs/11.x/routing">Routing</a> </li> <li> <a href="/docs/11.x/middleware">Middleware</a> </li> <li> <a href="/docs/11.x/csrf">CSRF Protection</a> </li> <li> <a href="/docs/11.x/controllers">Controllers</a> </li> <li> <a href="/docs/11.x/requests">Requests</a> </li> <li> <a href="/docs/11.x/responses">Responses</a> </li> <li> <a href="/docs/11.x/views">Views</a> </li> <li> <a href="/docs/11.x/blade">Blade Templates</a> </li> <li> <a href="/docs/11.x/vite">Asset Bundling</a> </li> <li> <a href="/docs/11.x/urls">URL Generation</a> </li> <li> <a href="/docs/11.x/session">Session</a> </li> <li> <a href="/docs/11.x/validation">Validation</a> </li> <li> <a href="/docs/11.x/errors">Error Handling</a> </li> <li> <a href="/docs/11.x/logging">Logging</a> </li> </ul> </li> <li> <h2>Digging Deeper</h2> <ul> <li> <a href="/docs/11.x/artisan">Artisan Console</a> </li> <li> <a href="/docs/11.x/broadcasting">Broadcasting</a> </li> <li> <a href="/docs/11.x/cache">Cache</a> </li> <li> <a href="/docs/11.x/collections">Collections</a> </li> <li> <a href="/docs/11.x/concurrency">Concurrency</a> </li> <li> <a href="/docs/11.x/context">Context</a> </li> <li> <a href="/docs/11.x/contracts">Contracts</a> </li> <li> <a href="/docs/11.x/events">Events</a> </li> <li> <a href="/docs/11.x/filesystem">File Storage</a> </li> <li> <a href="/docs/11.x/helpers">Helpers</a> </li> <li> <a href="/docs/11.x/http-client">HTTP Client</a> </li> <li> <a href="/docs/11.x/localization">Localization</a> </li> <li> <a href="/docs/11.x/mail">Mail</a> </li> <li> <a href="/docs/11.x/notifications">Notifications</a> </li> <li> <a href="/docs/11.x/packages">Package Development</a> </li> <li> <a href="/docs/11.x/processes">Processes</a> </li> <li> <a href="/docs/11.x/queues">Queues</a> </li> <li> <a href="/docs/11.x/rate-limiting">Rate Limiting</a> </li> <li> <a href="/docs/11.x/strings">Strings</a> </li> <li> <a href="/docs/11.x/scheduling">Task Scheduling</a> </li> </ul> </li> <li> <h2>Security</h2> <ul> <li> <a href="/docs/11.x/authentication">Authentication</a> </li> <li> <a href="/docs/11.x/authorization">Authorization</a> </li> <li> <a href="/docs/11.x/verification">Email Verification</a> </li> <li> <a href="/docs/11.x/encryption">Encryption</a> </li> <li> <a href="/docs/11.x/hashing">Hashing</a> </li> <li> <a href="/docs/11.x/passwords">Password Reset</a> </li> </ul> </li> <li> <h2>Database</h2> <ul> <li> <a href="/docs/11.x/database">Getting Started</a> </li> <li> <a href="/docs/11.x/queries">Query Builder</a> </li> <li> <a href="/docs/11.x/pagination">Pagination</a> </li> <li> <a href="/docs/11.x/migrations">Migrations</a> </li> <li> <a href="/docs/11.x/seeding">Seeding</a> </li> <li> <a href="/docs/11.x/redis">Redis</a> </li> <li> <a href="/docs/11.x/mongodb">MongoDB</a> </li> </ul> </li> <li> <h2>Eloquent ORM</h2> <ul> <li> <a href="/docs/11.x/eloquent">Getting Started</a> </li> <li> <a href="/docs/11.x/eloquent-relationships">Relationships</a> </li> <li> <a href="/docs/11.x/eloquent-collections">Collections</a> </li> <li> <a href="/docs/11.x/eloquent-mutators">Mutators / Casts</a> </li> <li> <a href="/docs/11.x/eloquent-resources">API Resources</a> </li> <li> <a href="/docs/11.x/eloquent-serialization">Serialization</a> </li> <li> <a href="/docs/11.x/eloquent-factories">Factories</a> </li> </ul> </li> <li> <h2>Testing</h2> <ul> <li> <a href="/docs/11.x/testing">Getting Started</a> </li> <li> <a href="/docs/11.x/http-tests">HTTP Tests</a> </li> <li> <a href="/docs/11.x/console-tests">Console Tests</a> </li> <li> <a href="/docs/11.x/dusk">Browser Tests</a> </li> <li> <a href="/docs/11.x/database-testing">Database</a> </li> <li> <a href="/docs/11.x/mocking">Mocking</a> </li> </ul> </li> <li class="sub--on"> <h2>Packages</h2> <ul> <li> <a href="/docs/11.x/starter-kits#laravel-breeze">Breeze</a> </li> <li> <a href="/docs/11.x/billing">Cashier (Stripe)</a> </li> <li> <a href="/docs/11.x/cashier-paddle">Cashier (Paddle)</a> </li> <li> <a href="/docs/11.x/dusk">Dusk</a> </li> <li> <a href="/docs/11.x/envoy">Envoy</a> </li> <li> <a href="/docs/11.x/fortify">Fortify</a> </li> <li> <a href="/docs/11.x/folio">Folio</a> </li> <li class="active"> <a href="/docs/11.x/homestead">Homestead</a> </li> <li> <a href="/docs/11.x/horizon">Horizon</a> </li> <li> <a href="https://jetstream.laravel.com">Jetstream</a> </li> <li> <a href="/docs/11.x/mix">Mix</a> </li> <li> <a href="/docs/11.x/octane">Octane</a> </li> <li> <a href="/docs/11.x/passport">Passport</a> </li> <li> <a href="/docs/11.x/pennant">Pennant</a> </li> <li> <a href="/docs/11.x/pint">Pint</a> </li> <li> <a href="/docs/11.x/precognition">Precognition</a> </li> <li> <a href="/docs/11.x/prompts">Prompts</a> </li> <li> <a href="/docs/11.x/pulse">Pulse</a> </li> <li> <a href="/docs/11.x/reverb">Reverb</a> </li> <li> <a href="/docs/11.x/sail">Sail</a> </li> <li> <a href="/docs/11.x/sanctum">Sanctum</a> </li> <li> <a href="/docs/11.x/scout">Scout</a> </li> <li> <a href="/docs/11.x/socialite">Socialite</a> </li> <li> <a href="/docs/11.x/telescope">Telescope</a> </li> <li> <a href="/docs/11.x/valet">Valet</a> </li> </ul> </li> <li> <a href="/api/11.x">API Documentation</a> </li> </ul> </div> </nav> <template id="promote-forge"> <div class="mt-4 px-3 py-2 border-dashed border-gray-200 border rounded-lg text-xs leading-loose text-gray-700 lg:block dark:border-gray-400 dark:text-gray-200"> <span class="font-medium">Laravel Forge:</span> create and manage PHP 8 servers. Deploy your Laravel applications in seconds. <a class="underline text-red-600" href="https://forge.laravel.com">Sign up now!</a>. </div> </template> <template id="promote-vapor"> <div class="mt-4 px-3 py-2 border-dashed border-gray-200 border rounded-lg text-xs leading-loose text-gray-700 lg:block dark:border-gray-400 dark:text-gray-200"> <span class="font-medium">Laravel Vapor:</span> experience extreme scale on a dedicated serverless platform for Laravel. <a class="underline text-red-600" href="https://vapor.laravel.com">Sign up now!</a>. </div> </template> <template id="promote-nova"> <div class="mt-4 px-3 py-2 border-dashed border-gray-200 border rounded-lg text-xs leading-loose text-gray-700 lg:block dark:border-gray-400 dark:text-gray-200"> <span class="font-medium">Laravel Nova:</span> The next generation of Nova is <a class="underline text-red-600" href="https://nova.laravel.com">now available</a>. </div> </template> <template id="promote-pulse"> <div class="mt-4 px-3 py-2 border-dashed border-gray-200 border rounded-lg text-xs leading-loose text-gray-700 lg:block dark:border-gray-400 dark:text-gray-200"> <span class="font-medium">Laravel Pulse:</span> How's your health? Check your application's vital signs using <a href="https://pulse.laravel.com" class="underline text-red-600">Laravel Pulse</a>. </div> </template> <template id="promote-reverb"> <div class="mt-4 px-3 py-2 border-dashed border-gray-200 border rounded-lg text-xs leading-loose text-gray-700 lg:block dark:border-gray-400 dark:text-gray-200"> <span class="font-medium">Laravel Reverb:</span> You can easily build dynamic, real-time Laravel applications using WebSockets. <a href="https://reverb.laravel.com" class="underline text-red-600">Laravel Reverb</a> is now available! </div> </template> <script> const activePromotionTemplate = document.getElementById( 'promote-'+JSON.parse('[\u0022forge\u0022,\u0022vapor\u0022,\u0022nova\u0022,\u0022pulse\u0022,\u0022reverb\u0022]')[Math.floor(Math.random() * 5)] ) activePromotionTemplate.replaceWith(activePromotionTemplate.content) </script> </div> </div> </aside> <header class="lg:hidden" @keydown.window.escape="navIsOpen = false" @click.away="navIsOpen = false" > <div class="relative mx-auto w-full py-10 bg-white transition duration-200 dark:bg-dark-700"> <div class="mx-auto px-8 sm:px-16 flex items-center justify-between"> <a href="/" class="flex items-center"> <img class="" src="/img/logomark.min.svg" alt="Laravel" width="50" height="52"> <img class="hidden ml-5 sm:block" src="/img/logotype.min.svg" alt="Laravel" width="114" height="29"> </a> <div class="flex-1 flex items-center justify-end"> <button id="header__sun" onclick="toSystemMode()" title="Switch to system theme" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-sun" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <circle cx="12" cy="12" r="4"></circle> <path d="M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7"></path> </svg> </button> <button id="header__moon" onclick="toLightMode()" title="Switch to light mode" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg style="width:24px;height:24px" viewBox="0 0 24 24"> <path fill="currentColor" d="M17.75,4.09L15.22,6.03L16.13,9.09L13.5,7.28L10.87,9.09L11.78,6.03L9.25,4.09L12.44,4L13.5,1L14.56,4L17.75,4.09M21.25,11L19.61,12.25L20.2,14.23L18.5,13.06L16.8,14.23L17.39,12.25L15.75,11L17.81,10.95L18.5,9L19.19,10.95L21.25,11M18.97,15.95C19.8,15.87 20.69,17.05 20.16,17.8C19.84,18.25 19.5,18.67 19.08,19.07C15.17,23 8.84,23 4.94,19.07C1.03,15.17 1.03,8.83 4.94,4.93C5.34,4.53 5.76,4.17 6.21,3.85C6.96,3.32 8.14,4.21 8.06,5.04C7.79,7.9 8.75,10.87 10.95,13.06C13.14,15.26 16.1,16.22 18.97,15.95M17.33,17.97C14.5,17.81 11.7,16.64 9.53,14.5C7.36,12.31 6.2,9.5 6.04,6.68C3.23,9.82 3.34,14.64 6.35,17.66C9.37,20.67 14.19,20.78 17.33,17.97Z" /> </svg> </button> <button id="header__indeterminate" onclick="toDarkMode()" title="Switch to dark mode" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg style="width:24px;height:24px" viewBox="0 0 24 24"> <path fill="currentColor" d="M12 2A10 10 0 0 0 2 12A10 10 0 0 0 12 22A10 10 0 0 0 22 12A10 10 0 0 0 12 2M12 4A8 8 0 0 1 20 12A8 8 0 0 1 12 20V4Z" /> </svg> </button> <button class="ml-2 relative w-10 h-10 p-2 text-red-600 lg:hidden focus:outline-none focus:shadow-outline" aria-label="Menu" @click.prevent="navIsOpen = !navIsOpen"> <svg x-show="! navIsOpen" x-transition.opacity class="absolute inset-0 mt-2 ml-2 w-6 h-6" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg> <svg x-show="navIsOpen" x-transition.opacity x-cloak class="absolute inset-0 mt-2 ml-2 w-6 h-6" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg> </button> </div> </div> <span :class="{ 'shadow-sm': navIsOpen }" class="absolute inset-0 z-20 pointer-events-none"></span> </div> <div x-show="navIsOpen" x-transition:enter="duration-150" x-transition:leave="duration-100 ease-in" x-cloak > <nav x-show="navIsOpen" x-cloak class="absolute w-full transform origin-top shadow-sm z-10" x-transition:enter="duration-150 ease-out" x-transition:enter-start="opacity-0 -translate-y-8 scale-75" x-transition:enter-end="opacity-100 scale-100" x-transition:leave="duration-100 ease-in" x-transition:leave-start="opacity-100 scale-100" x-transition:leave-end="opacity-0 -translate-y-8 scale-75" > <div class="relative p-8 bg-white docs_sidebar dark:bg-dark-600"> <ul> <li> <h2>Prologue</h2> <ul> <li> <a href="/docs/11.x/releases">Release Notes</a> </li> <li> <a href="/docs/11.x/upgrade">Upgrade Guide</a> </li> <li> <a href="/docs/11.x/contributions">Contribution Guide</a> </li> </ul> </li> <li> <h2>Getting Started</h2> <ul> <li> <a href="/docs/11.x/installation">Installation</a> </li> <li> <a href="/docs/11.x/configuration">Configuration</a> </li> <li> <a href="/docs/11.x/structure">Directory Structure</a> </li> <li> <a href="/docs/11.x/frontend">Frontend</a> </li> <li> <a href="/docs/11.x/starter-kits">Starter Kits</a> </li> <li> <a href="/docs/11.x/deployment">Deployment</a> </li> </ul> </li> <li> <h2>Architecture Concepts</h2> <ul> <li> <a href="/docs/11.x/lifecycle">Request Lifecycle</a> </li> <li> <a href="/docs/11.x/container">Service Container</a> </li> <li> <a href="/docs/11.x/providers">Service Providers</a> </li> <li> <a href="/docs/11.x/facades">Facades</a> </li> </ul> </li> <li> <h2>The Basics</h2> <ul> <li> <a href="/docs/11.x/routing">Routing</a> </li> <li> <a href="/docs/11.x/middleware">Middleware</a> </li> <li> <a href="/docs/11.x/csrf">CSRF Protection</a> </li> <li> <a href="/docs/11.x/controllers">Controllers</a> </li> <li> <a href="/docs/11.x/requests">Requests</a> </li> <li> <a href="/docs/11.x/responses">Responses</a> </li> <li> <a href="/docs/11.x/views">Views</a> </li> <li> <a href="/docs/11.x/blade">Blade Templates</a> </li> <li> <a href="/docs/11.x/vite">Asset Bundling</a> </li> <li> <a href="/docs/11.x/urls">URL Generation</a> </li> <li> <a href="/docs/11.x/session">Session</a> </li> <li> <a href="/docs/11.x/validation">Validation</a> </li> <li> <a href="/docs/11.x/errors">Error Handling</a> </li> <li> <a href="/docs/11.x/logging">Logging</a> </li> </ul> </li> <li> <h2>Digging Deeper</h2> <ul> <li> <a href="/docs/11.x/artisan">Artisan Console</a> </li> <li> <a href="/docs/11.x/broadcasting">Broadcasting</a> </li> <li> <a href="/docs/11.x/cache">Cache</a> </li> <li> <a href="/docs/11.x/collections">Collections</a> </li> <li> <a href="/docs/11.x/concurrency">Concurrency</a> </li> <li> <a href="/docs/11.x/context">Context</a> </li> <li> <a href="/docs/11.x/contracts">Contracts</a> </li> <li> <a href="/docs/11.x/events">Events</a> </li> <li> <a href="/docs/11.x/filesystem">File Storage</a> </li> <li> <a href="/docs/11.x/helpers">Helpers</a> </li> <li> <a href="/docs/11.x/http-client">HTTP Client</a> </li> <li> <a href="/docs/11.x/localization">Localization</a> </li> <li> <a href="/docs/11.x/mail">Mail</a> </li> <li> <a href="/docs/11.x/notifications">Notifications</a> </li> <li> <a href="/docs/11.x/packages">Package Development</a> </li> <li> <a href="/docs/11.x/processes">Processes</a> </li> <li> <a href="/docs/11.x/queues">Queues</a> </li> <li> <a href="/docs/11.x/rate-limiting">Rate Limiting</a> </li> <li> <a href="/docs/11.x/strings">Strings</a> </li> <li> <a href="/docs/11.x/scheduling">Task Scheduling</a> </li> </ul> </li> <li> <h2>Security</h2> <ul> <li> <a href="/docs/11.x/authentication">Authentication</a> </li> <li> <a href="/docs/11.x/authorization">Authorization</a> </li> <li> <a href="/docs/11.x/verification">Email Verification</a> </li> <li> <a href="/docs/11.x/encryption">Encryption</a> </li> <li> <a href="/docs/11.x/hashing">Hashing</a> </li> <li> <a href="/docs/11.x/passwords">Password Reset</a> </li> </ul> </li> <li> <h2>Database</h2> <ul> <li> <a href="/docs/11.x/database">Getting Started</a> </li> <li> <a href="/docs/11.x/queries">Query Builder</a> </li> <li> <a href="/docs/11.x/pagination">Pagination</a> </li> <li> <a href="/docs/11.x/migrations">Migrations</a> </li> <li> <a href="/docs/11.x/seeding">Seeding</a> </li> <li> <a href="/docs/11.x/redis">Redis</a> </li> <li> <a href="/docs/11.x/mongodb">MongoDB</a> </li> </ul> </li> <li> <h2>Eloquent ORM</h2> <ul> <li> <a href="/docs/11.x/eloquent">Getting Started</a> </li> <li> <a href="/docs/11.x/eloquent-relationships">Relationships</a> </li> <li> <a href="/docs/11.x/eloquent-collections">Collections</a> </li> <li> <a href="/docs/11.x/eloquent-mutators">Mutators / Casts</a> </li> <li> <a href="/docs/11.x/eloquent-resources">API Resources</a> </li> <li> <a href="/docs/11.x/eloquent-serialization">Serialization</a> </li> <li> <a href="/docs/11.x/eloquent-factories">Factories</a> </li> </ul> </li> <li> <h2>Testing</h2> <ul> <li> <a href="/docs/11.x/testing">Getting Started</a> </li> <li> <a href="/docs/11.x/http-tests">HTTP Tests</a> </li> <li> <a href="/docs/11.x/console-tests">Console Tests</a> </li> <li> <a href="/docs/11.x/dusk">Browser Tests</a> </li> <li> <a href="/docs/11.x/database-testing">Database</a> </li> <li> <a href="/docs/11.x/mocking">Mocking</a> </li> </ul> </li> <li class="sub--on"> <h2>Packages</h2> <ul> <li> <a href="/docs/11.x/starter-kits#laravel-breeze">Breeze</a> </li> <li> <a href="/docs/11.x/billing">Cashier (Stripe)</a> </li> <li> <a href="/docs/11.x/cashier-paddle">Cashier (Paddle)</a> </li> <li> <a href="/docs/11.x/dusk">Dusk</a> </li> <li> <a href="/docs/11.x/envoy">Envoy</a> </li> <li> <a href="/docs/11.x/fortify">Fortify</a> </li> <li> <a href="/docs/11.x/folio">Folio</a> </li> <li class="active"> <a href="/docs/11.x/homestead">Homestead</a> </li> <li> <a href="/docs/11.x/horizon">Horizon</a> </li> <li> <a href="https://jetstream.laravel.com">Jetstream</a> </li> <li> <a href="/docs/11.x/mix">Mix</a> </li> <li> <a href="/docs/11.x/octane">Octane</a> </li> <li> <a href="/docs/11.x/passport">Passport</a> </li> <li> <a href="/docs/11.x/pennant">Pennant</a> </li> <li> <a href="/docs/11.x/pint">Pint</a> </li> <li> <a href="/docs/11.x/precognition">Precognition</a> </li> <li> <a href="/docs/11.x/prompts">Prompts</a> </li> <li> <a href="/docs/11.x/pulse">Pulse</a> </li> <li> <a href="/docs/11.x/reverb">Reverb</a> </li> <li> <a href="/docs/11.x/sail">Sail</a> </li> <li> <a href="/docs/11.x/sanctum">Sanctum</a> </li> <li> <a href="/docs/11.x/scout">Scout</a> </li> <li> <a href="/docs/11.x/socialite">Socialite</a> </li> <li> <a href="/docs/11.x/telescope">Telescope</a> </li> <li> <a href="/docs/11.x/valet">Valet</a> </li> </ul> </li> <li> <a href="/api/11.x">API Documentation</a> </li> </ul> </div> </nav> </div> </header> <section class="flex-1 dark:bg-dark-700"> <div class="max-w-screen-lg px-8 sm:px-16 lg:px-24"> <div class="flex flex-col items-end border-b border-gray-200 py-1 transition-colors dark:border-gray-700 lg:mt-8 lg:flex-row-reverse"> <div class="hidden lg:flex items-center justify-center ml-8"> <button id="header__sun" onclick="toSystemMode()" title="Switch to system theme" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-sun" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <circle cx="12" cy="12" r="4"></circle> <path d="M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7"></path> </svg> </button> <button id="header__moon" onclick="toLightMode()" title="Switch to light mode" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg style="width:24px;height:24px" viewBox="0 0 24 24"> <path fill="currentColor" d="M17.75,4.09L15.22,6.03L16.13,9.09L13.5,7.28L10.87,9.09L11.78,6.03L9.25,4.09L12.44,4L13.5,1L14.56,4L17.75,4.09M21.25,11L19.61,12.25L20.2,14.23L18.5,13.06L16.8,14.23L17.39,12.25L15.75,11L17.81,10.95L18.5,9L19.19,10.95L21.25,11M18.97,15.95C19.8,15.87 20.69,17.05 20.16,17.8C19.84,18.25 19.5,18.67 19.08,19.07C15.17,23 8.84,23 4.94,19.07C1.03,15.17 1.03,8.83 4.94,4.93C5.34,4.53 5.76,4.17 6.21,3.85C6.96,3.32 8.14,4.21 8.06,5.04C7.79,7.9 8.75,10.87 10.95,13.06C13.14,15.26 16.1,16.22 18.97,15.95M17.33,17.97C14.5,17.81 11.7,16.64 9.53,14.5C7.36,12.31 6.2,9.5 6.04,6.68C3.23,9.82 3.34,14.64 6.35,17.66C9.37,20.67 14.19,20.78 17.33,17.97Z" /> </svg> </button> <button id="header__indeterminate" onclick="toDarkMode()" title="Switch to dark mode" class="relative w-10 h-10 focus:outline-none focus:shadow-outline text-gray-500"> <svg style="width:24px;height:24px" viewBox="0 0 24 24"> <path fill="currentColor" d="M12 2A10 10 0 0 0 2 12A10 10 0 0 0 12 22A10 10 0 0 0 22 12A10 10 0 0 0 12 2M12 4A8 8 0 0 1 20 12A8 8 0 0 1 12 20V4Z" /> </svg> </button> </div> <div class="w-full lg:w-40 lg:pl-12"> <div> <label class="text-gray-600 text-xs tracking-widest uppercase dark:text-gray-500" for="version-switcher">Version</label> <div x-data class="relative w-full bg-white transition-all duration-500 focus-within:border-gray-600 dark:bg-gray-800"> <select id="version-switcher" aria-label="Laravel version" class="appearance-none flex-1 w-full px-0 py-1 placeholder-gray-900 tracking-wide bg-white border-transparent focus:outline-none dark:bg-dark-700 dark:text-gray-400 dark:placeholder-gray-500" @change="window.location = $event.target.value" > <option value="https://laravel.com/docs/master/homestead">Master</option> <option selected value="https://laravel.com/docs/11.x/homestead">11.x</option> <option value="https://laravel.com/docs/10.x/homestead">10.x</option> <option value="https://laravel.com/docs/9.x/homestead">9.x</option> <option value="https://laravel.com/docs/8.x/homestead">8.x</option> <option value="https://laravel.com/docs/7.x/homestead">7.x</option> <option value="https://laravel.com/docs/6.x/homestead">6.x</option> <option value="https://laravel.com/docs/5.8/homestead">5.8</option> <option value="https://laravel.com/docs/5.7/homestead">5.7</option> <option value="https://laravel.com/docs/5.6/homestead">5.6</option> <option value="https://laravel.com/docs/5.5/homestead">5.5</option> <option value="https://laravel.com/docs/5.4/homestead">5.4</option> <option value="https://laravel.com/docs/5.3/homestead">5.3</option> <option value="https://laravel.com/docs/5.2/homestead">5.2</option> <option value="https://laravel.com/docs/5.1/homestead">5.1</option> <option value="https://laravel.com/docs/5.0/homestead">5.0</option> <option value="https://laravel.com/docs/4.2/homestead">4.2</option> </select> <img class="absolute inset-y-0 right-0 mt-2.5 w-2.5 h-2.5 text-gray-900 pointer-events-none dark:hidden" src="/img/icons/drop_arrow.min.svg" alt="" width="10" height="10"> <img class="absolute inset-y-0 right-0 mt-2.5 w-2.5 h-2.5 text-gray-900 pointer-events-none hidden dark:block" src="/img/icons/drop_arrow.dark.min.svg" alt="" width="10" height="10"> </div> </div> </div> <div class="relative mt-8 flex items-center justify-end w-full h-10 lg:mt-0"> <div class="flex-1 flex items-center"> <button id="docsearch" class="text-gray-800 transition-colors dark:text-gray-400 w-full"></button> </div> </div> </div> <section class="mt-8 md:mt-16"> <section class="docs_main max-w-prose"> <div id="main-content"> <h1>Laravel Homestead</h1> <ul> <li> <a href="#introduction">Introduction</a> </li> <li> <a href="#installation-and-setup">Installation and Setup</a> <ul> <li> <a href="#first-steps">First Steps</a> </li> <li> <a href="#configuring-homestead">Configuring Homestead</a> </li> <li> <a href="#configuring-nginx-sites">Configuring Nginx Sites</a> </li> <li> <a href="#configuring-services">Configuring Services</a> </li> <li> <a href="#launching-the-vagrant-box">Launching the Vagrant Box</a> </li> <li> <a href="#per-project-installation">Per Project Installation</a> </li> <li> <a href="#installing-optional-features">Installing Optional Features</a> </li> <li> <a href="#aliases">Aliases</a> </li> </ul> </li> <li> <a href="#updating-homestead">Updating Homestead</a> </li> <li> <a href="#daily-usage">Daily Usage</a> <ul> <li> <a href="#connecting-via-ssh">Connecting via SSH</a> </li> <li> <a href="#adding-additional-sites">Adding Additional Sites</a> </li> <li> <a href="#environment-variables">Environment Variables</a> </li> <li> <a href="#ports">Ports</a> </li> <li> <a href="#php-versions">PHP Versions</a> </li> <li> <a href="#connecting-to-databases">Connecting to Databases</a> </li> <li> <a href="#database-backups">Database Backups</a> </li> <li> <a href="#configuring-cron-schedules">Configuring Cron Schedules</a> </li> <li> <a href="#configuring-mailpit">Configuring Mailpit</a> </li> <li> <a href="#configuring-minio">Configuring Minio</a> </li> <li> <a href="#laravel-dusk">Laravel Dusk</a> </li> <li> <a href="#sharing-your-environment">Sharing Your Environment</a> </li> </ul> </li> <li> <a href="#debugging-and-profiling">Debugging and Profiling</a> <ul> <li> <a href="#debugging-web-requests">Debugging Web Requests With Xdebug</a> </li> <li> <a href="#debugging-cli-applications">Debugging CLI Applications</a> </li> <li> <a href="#profiling-applications-with-blackfire">Profiling Applications With Blackfire</a> </li> </ul> </li> <li> <a href="#network-interfaces">Network Interfaces</a> </li> <li> <a href="#extending-homestead">Extending Homestead</a> </li> <li> <a href="#provider-specific-settings">Provider Specific Settings</a> <ul> <li> <a href="#provider-specific-virtualbox">VirtualBox</a> </li> </ul> </li> </ul> <h2 id="introduction"><a href="#introduction">Introduction</a></h2> <p>Laravel strives to make the entire PHP development experience delightful, including your local development environment. <a href="https://github.com/laravel/homestead">Laravel Homestead</a> is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, or any other server software on your local machine.</p> <p><a href="https://www.vagrantup.com">Vagrant</a> provides a simple, elegant way to manage and provision Virtual Machines. Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!</p> <p>Homestead runs on any Windows, macOS, or Linux system and includes Nginx, PHP, MySQL, PostgreSQL, Redis, Memcached, Node, and all of the other software you need to develop amazing Laravel applications.</p> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> If you are using Windows, you may need to enable hardware virtualization (VT-x). It can usually be enabled via your BIOS. If you are using Hyper-V on a UEFI system you may additionally need to disable Hyper-V in order to access VT-x.</p> </div> <h3 id="included-software"><a href="#included-software">Included Software</a></h3> <style> #software-list > ul { column-count: 2; -moz-column-count: 2; -webkit-column-count: 2; column-gap: 5em; -moz-column-gap: 5em; -webkit-column-gap: 5em; line-height: 1.9; } </style> <div id="software-list" markdown="1"> <ul> <li>Ubuntu 22.04</li> <li>Git</li> <li>PHP 8.3</li> <li>PHP 8.2</li> <li>PHP 8.1</li> <li>PHP 8.0</li> <li>PHP 7.4</li> <li>PHP 7.3</li> <li>PHP 7.2</li> <li>PHP 7.1</li> <li>PHP 7.0</li> <li>PHP 5.6</li> <li>Nginx</li> <li>MySQL 8.0</li> <li>lmm</li> <li>Sqlite3</li> <li>PostgreSQL 15</li> <li>Composer</li> <li>Docker</li> <li>Node (With Yarn, Bower, Grunt, and Gulp)</li> <li>Redis</li> <li>Memcached</li> <li>Beanstalkd</li> <li>Mailpit</li> <li>avahi</li> <li>ngrok</li> <li>Xdebug</li> <li>XHProf / Tideways / XHGui</li> <li>wp-cli</li> </ul> </div> <h3 id="optional-software"><a href="#optional-software">Optional Software</a></h3> <style> #software-list > ul { column-count: 2; -moz-column-count: 2; -webkit-column-count: 2; column-gap: 5em; -moz-column-gap: 5em; -webkit-column-gap: 5em; line-height: 1.9; } </style> <div id="software-list" markdown="1"> <ul> <li>Apache</li> <li>Blackfire</li> <li>Cassandra</li> <li>Chronograf</li> <li>CouchDB</li> <li>Crystal & Lucky Framework</li> <li>Elasticsearch</li> <li>EventStoreDB</li> <li>Flyway</li> <li>Gearman</li> <li>Go</li> <li>Grafana</li> <li>InfluxDB</li> <li>Logstash</li> <li>MariaDB</li> <li>Meilisearch</li> <li>MinIO</li> <li>MongoDB</li> <li>Neo4j</li> <li>Oh My Zsh</li> <li>Open Resty</li> <li>PM2</li> <li>Python</li> <li>R</li> <li>RabbitMQ</li> <li>Rust</li> <li>RVM (Ruby Version Manager)</li> <li>Solr</li> <li>TimescaleDB</li> <li>Trader <small>(PHP extension)</small> </li> <li>Webdriver & Laravel Dusk Utilities</li> </ul> </div> <h2 id="installation-and-setup"><a href="#installation-and-setup">Installation and Setup</a></h2> <h3 id="first-steps"><a href="#first-steps">First Steps</a></h3> <p>Before launching your Homestead environment, you must install <a href="https://developer.hashicorp.com/vagrant/downloads">Vagrant</a> as well as one of the following supported providers:</p> <ul> <li> <a href="https://www.virtualbox.org/wiki/Download_Old_Builds_6_1">VirtualBox 6.1.x</a> </li> <li> <a href="https://www.parallels.com/products/desktop/">Parallels</a> </li> </ul> <p>All of these software packages provide easy-to-use visual installers for all popular operating systems.</p> <p>To use the Parallels provider, you will need to install <a href="https://github.com/Parallels/vagrant-parallels">Parallels Vagrant plug-in</a>. It is free of charge.</p> <h4 id="installing-homestead"><a href="#installing-homestead">Installing Homestead</a></h4> <p>You may install Homestead by cloning the Homestead repository onto your host machine. Consider cloning the repository into a <code>Homestead</code> folder within your "home" directory, as the Homestead virtual machine will serve as the host to all of your Laravel applications. Throughout this documentation, we will refer to this directory as your "Homestead directory":</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">git </span><span style="color: #BFC7D5;">clone</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">https://github.com/laravel/homestead.git</span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">~</span><span style="color: #BFC7D5;">/Homestead</span></div></code></pre> </div> <p>After cloning the Laravel Homestead repository, you should checkout the <code>release</code> branch. This branch always contains the latest stable release of Homestead:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">cd</span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">~</span><span style="color: #BFC7D5;">/Homestead</span></div><div class='line'> </div><div class='line'><span style="color: #BFC7D5;">git </span><span style="color: #BFC7D5;">checkout</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">release</span></div></code></pre> </div> <p>Next, execute the <code>bash init.sh</code> command from the Homestead directory to create the <code>Homestead.yaml</code> configuration file. The <code>Homestead.yaml</code> file is where you will configure all of the settings for your Homestead installation. This file will be placed in the Homestead directory:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #697098;">#</span><span style="color: #697098;"> macOS / Linux...</span></div><div class='line'><span style="color: #BFC7D5;">bash </span><span style="color: #BFC7D5;">init.sh</span></div><div class='line'> </div><div class='line'><span style="color: #697098;">#</span><span style="color: #697098;"> Windows...</span></div><div class='line'><span style="color: #BFC7D5;">init.bat</span></div></code></pre> </div> <h3 id="configuring-homestead"><a href="#configuring-homestead">Configuring Homestead</a></h3> <h4 id="setting-your-provider"><a href="#setting-your-provider">Setting Your Provider</a></h4> <p>The <code>provider</code> key in your <code>Homestead.yaml</code> file indicates which Vagrant provider should be used: <code>virtualbox</code> or <code>parallels</code>:</p> <pre><code data-theme="olaolu-palenight" data-lang="php" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">provider: </span><span style="color: #82AAFF;">virtualbox</span></div></code></pre> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> If you are using Apple Silicon the Parallels provider is required.</p> </div> <h4 id="configuring-shared-folders"><a href="#configuring-shared-folders">Configuring Shared Folders</a></h4> <p>The <code>folders</code> property of the <code>Homestead.yaml</code> file lists all of the folders you wish to share with your Homestead environment. As files within these folders are changed, they will be kept in sync between your local machine and the Homestead virtual environment. You may configure as many shared folders as necessary:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">folders</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">~/code/project1</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project1</span></div></code></pre> </div> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> Windows users should not use the <code>~/</code> path syntax and instead should use the full path to their project, such as <code>C:\Users\user\Code\project1</code>.</p> </div> <p>You should always map individual applications to their own folder mapping instead of mapping a single large directory that contains all of your applications. When you map a folder, the virtual machine must keep track of all disk IO for <em>every</em> file in the folder. You may experience reduced performance if you have a large number of files in a folder:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">folders</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">~/code/project1</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project1</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">~/code/project2</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project2</span></div></code></pre> </div> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> You should never mount <code>.</code> (the current directory) when using Homestead. This causes Vagrant to not map the current folder to <code>/vagrant</code> and will break optional features and cause unexpected results while provisioning.</p> </div> <p>To enable <a href="https://developer.hashicorp.com/vagrant/docs/synced-folders/nfs">NFS</a>, you may add a <code>type</code> option to your folder mapping:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">folders</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">~/code/project1</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project1</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">type</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">nfs</span><span style="color: #D9F5DD;">"</span></div></code></pre> </div> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> When using NFS on Windows, you should consider installing the <a href="https://github.com/winnfsd/vagrant-winnfsd">vagrant-winnfsd</a> plug-in. This plug-in will maintain the correct user / group permissions for files and directories within the Homestead virtual machine.</p> </div> <p>You may also pass any options supported by Vagrant's <a href="https://developer.hashicorp.com/vagrant/docs/synced-folders/basic_usage">Synced Folders</a> by listing them under the <code>options</code> key:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">folders</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">~/code/project1</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project1</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">type</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">rsync</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">options</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">rsync__args</span><span style="color: #BFC7D5;">: [</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">--verbose</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;">, </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">--archive</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;">, </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">--delete</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;">, </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">-zz</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;">]</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">rsync__exclude</span><span style="color: #BFC7D5;">: [</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">node_modules</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;">]</span></div></code></pre> </div> <h3 id="configuring-nginx-sites"><a href="#configuring-nginx-sites">Configuring Nginx Sites</a></h3> <p>Not familiar with Nginx? No problem. Your <code>Homestead.yaml</code> file's <code>sites</code> property allows you to easily map a "domain" to a folder on your Homestead environment. A sample site configuration is included in the <code>Homestead.yaml</code> file. Again, you may add as many sites to your Homestead environment as necessary. Homestead can serve as a convenient, virtualized environment for every Laravel application you are working on:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">sites</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">homestead.test</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project1/public</span></div></code></pre> </div> <p>If you change the <code>sites</code> property after provisioning the Homestead virtual machine, you should execute the <code>vagrant reload --provision</code> command in your terminal to update the Nginx configuration on the virtual machine.</p> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> Homestead scripts are built to be as idempotent as possible. However, if you are experiencing issues while provisioning you should destroy and rebuild the machine by executing the <code>vagrant destroy && vagrant up</code> command.</p> </div> <h4 id="hostname-resolution"><a href="#hostname-resolution">Hostname Resolution</a></h4> <p>Homestead publishes hostnames using <code>mDNS</code> for automatic host resolution. If you set <code>hostname: homestead</code> in your <code>Homestead.yaml</code> file, the host will be available at <code>homestead.local</code>. macOS, iOS, and Linux desktop distributions include <code>mDNS</code> support by default. If you are using Windows, you must install <a href="https://support.apple.com/kb/DL999?viewlocale=en_US&locale=en_US">Bonjour Print Services for Windows</a>.</p> <p>Using automatic hostnames works best for <a href="#per-project-installation">per project installations</a> of Homestead. If you host multiple sites on a single Homestead instance, you may add the "domains" for your web sites to the <code>hosts</code> file on your machine. The <code>hosts</code> file will redirect requests for your Homestead sites into your Homestead virtual machine. On macOS and Linux, this file is located at <code>/etc/hosts</code>. On Windows, it is located at <code>C:\Windows\System32\drivers\etc\hosts</code>. The lines you add to this file will look like the following:</p> <pre><code data-theme="olaolu-palenight" data-lang="php" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #F78C6C;">192.168.56.56</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">homestead</span><span style="color: #89DDFF;">.</span><span style="color: #82AAFF;">test</span></div></code></pre> <p>Make sure the IP address listed is the one set in your <code>Homestead.yaml</code> file. Once you have added the domain to your <code>hosts</code> file and launched the Vagrant box you will be able to access the site via your web browser:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">http://homestead.test</span></div></code></pre> </div> <h3 id="configuring-services"><a href="#configuring-services">Configuring Services</a></h3> <p>Homestead starts several services by default; however, you may customize which services are enabled or disabled during provisioning. For example, you may enable PostgreSQL and disable MySQL by modifying the <code>services</code> option within your <code>Homestead.yaml</code> file:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">services</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">enabled</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">postgresql</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">disabled</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">mysql</span><span style="color: #D9F5DD;">"</span></div></code></pre> </div> <p>The specified services will be started or stopped based on their order in the <code>enabled</code> and <code>disabled</code> directives.</p> <h3 id="launching-the-vagrant-box"><a href="#launching-the-vagrant-box">Launching the Vagrant Box</a></h3> <p>Once you have edited the <code>Homestead.yaml</code> to your liking, run the <code>vagrant up</code> command from your Homestead directory. Vagrant will boot the virtual machine and automatically configure your shared folders and Nginx sites.</p> <p>To destroy the machine, you may use the <code>vagrant destroy</code> command.</p> <h3 id="per-project-installation"><a href="#per-project-installation">Per Project Installation</a></h3> <p>Instead of installing Homestead globally and sharing the same Homestead virtual machine across all of your projects, you may instead configure a Homestead instance for each project you manage. Installing Homestead per project may be beneficial if you wish to ship a <code>Vagrantfile</code> with your project, allowing others working on the project to <code>vagrant up</code> immediately after cloning the project's repository.</p> <p>You may install Homestead into your project using the Composer package manager:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">composer </span><span style="color: #BFC7D5;">require</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">laravel/homestead</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">--dev</span></div></code></pre> </div> <p>Once Homestead has been installed, invoke Homestead's <code>make</code> command to generate the <code>Vagrantfile</code> and <code>Homestead.yaml</code> file for your project. These files will be placed in the root of your project. The <code>make</code> command will automatically configure the <code>sites</code> and <code>folders</code> directives in the <code>Homestead.yaml</code> file:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #697098;">#</span><span style="color: #697098;"> macOS / Linux...</span></div><div class='line'><span style="color: #BFC7D5;">php </span><span style="color: #BFC7D5;">vendor/bin/homestead</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">make</span></div><div class='line'> </div><div class='line'><span style="color: #697098;">#</span><span style="color: #697098;"> Windows...</span></div><div class='line'><span style="color: #BFC7D5;">vendor</span><span style="color: #F78C6C;">\\</span><span style="color: #BFC7D5;">bin</span><span style="color: #F78C6C;">\\</span><span style="color: #BFC7D5;">homestead </span><span style="color: #BFC7D5;">make</span></div></code></pre> </div> <p>Next, run the <code>vagrant up</code> command in your terminal and access your project at <code>http://homestead.test</code> in your browser. Remember, you will still need to add an <code>/etc/hosts</code> file entry for <code>homestead.test</code> or the domain of your choice if you are not using automatic <a href="#hostname-resolution">hostname resolution</a>.</p> <h3 id="installing-optional-features"><a href="#installing-optional-features">Installing Optional Features</a></h3> <p>Optional software is installed using the <code>features</code> option within your <code>Homestead.yaml</code> file. Most features can be enabled or disabled with a boolean value, while some features allow multiple configuration options:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">features</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">blackfire</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">server_id</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">server_id</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">server_token</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">server_value</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">client_id</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">client_id</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">client_token</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">client_value</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">cassandra</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">chronograf</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">couchdb</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">crystal</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">dragonflydb</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">elasticsearch</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">version</span><span style="color: #BFC7D5;">: </span><span style="color: #F78C6C;">7.9.0</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">eventstore</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">version</span><span style="color: #BFC7D5;">: </span><span style="color: #F78C6C;">21.2.0</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">flyway</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">gearman</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">golang</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">grafana</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">influxdb</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">logstash</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">mariadb</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">meilisearch</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">minio</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">mongodb</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">neo4j</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">ohmyzsh</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">openresty</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">pm2</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">python</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">r-base</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">rabbitmq</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">rustc</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">rvm</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">solr</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">timescaledb</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">trader</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">webdriver</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div></code></pre> </div> <h4 id="elasticsearch"><a href="#elasticsearch">Elasticsearch</a></h4> <p>You may specify a supported version of Elasticsearch, which must be an exact version number (major.minor.patch). The default installation will create a cluster named 'homestead'. You should never give Elasticsearch more than half of the operating system's memory, so make sure your Homestead virtual machine has at least twice the Elasticsearch allocation.</p> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-purple-600"> <div class="opacity-75"><svg width="28" height="40" viewBox="0 0 28 40" xmlns="http://www.w3.org/2000/svg"><title>lightbulb</title><path d="M12 28h4v-8h-4v8zM8 40h12v-8H8v8zm13.98-14.52c-1.001.705-1.661 1.545-1.98 2.52H8c-.416-.959-1.076-1.799-1.98-2.52A13.99 13.99 0 0 1 0 14C0 6.272 6.272 0 14 0s14 6.272 14 14a13.99 13.99 0 0 1-6.02 11.48z" fill="#FFF" fill-rule="nonzero"/></svg></div> </div> <p class="mb-0 lg:ml-6 callout"> Check out the <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current">Elasticsearch documentation</a> to learn how to customize your configuration.</p> </div> <h4 id="mariadb"><a href="#mariadb">MariaDB</a></h4> <p>Enabling MariaDB will remove MySQL and install MariaDB. MariaDB typically serves as a drop-in replacement for MySQL, so you should still use the <code>mysql</code> database driver in your application's database configuration.</p> <h4 id="mongodb"><a href="#mongodb">MongoDB</a></h4> <p>The default MongoDB installation will set the database username to <code>homestead</code> and the corresponding password to <code>secret</code>.</p> <h4 id="neo4j"><a href="#neo4j">Neo4j</a></h4> <p>The default Neo4j installation will set the database username to <code>homestead</code> and the corresponding password to <code>secret</code>. To access the Neo4j browser, visit <code>http://homestead.test:7474</code> via your web browser. The ports <code>7687</code> (Bolt), <code>7474</code> (HTTP), and <code>7473</code> (HTTPS) are ready to serve requests from the Neo4j client.</p> <h3 id="aliases"><a href="#aliases">Aliases</a></h3> <p>You may add Bash aliases to your Homestead virtual machine by modifying the <code>aliases</code> file within your Homestead directory:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #C792EA;">alias</span><span style="color: #BFC7D5;"> </span><span style="color: #FFCB6B;">c</span><span style="color: #C792EA;">=</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">clear</span><span style="color: #D9F5DD;">'</span></div><div class='line'><span style="color: #BFC7D5;">alias ..=</span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">cd ..</span><span style="color: #D9F5DD;">'</span></div></code></pre> </div> <p>After you have updated the <code>aliases</code> file, you should re-provision the Homestead virtual machine using the <code>vagrant reload --provision</code> command. This will ensure that your new aliases are available on the machine.</p> <h2 id="updating-homestead"><a href="#updating-homestead">Updating Homestead</a></h2> <p>Before you begin updating Homestead you should ensure you have removed your current virtual machine by running the following command in your Homestead directory:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">vagrant </span><span style="color: #BFC7D5;">destroy</span></div></code></pre> </div> <p>Next, you need to update the Homestead source code. If you cloned the repository, you can execute the following commands at the location you originally cloned the repository:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">git </span><span style="color: #BFC7D5;">fetch</span></div><div class='line'> </div><div class='line'><span style="color: #BFC7D5;">git </span><span style="color: #BFC7D5;">pull</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">origin</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">release</span></div></code></pre> </div> <p>These commands pull the latest Homestead code from the GitHub repository, fetch the latest tags, and then check out the latest tagged release. You can find the latest stable release version on Homestead's <a href="https://github.com/laravel/homestead/releases">GitHub releases page</a>.</p> <p>If you have installed Homestead via your project's <code>composer.json</code> file, you should ensure your <code>composer.json</code> file contains <code>"laravel/homestead": "^12"</code> and update your dependencies:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">composer </span><span style="color: #BFC7D5;">update</span></div></code></pre> </div> <p>Next, you should update the Vagrant box using the <code>vagrant box update</code> command:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">vagrant </span><span style="color: #BFC7D5;">box</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">update</span></div></code></pre> </div> <p>After updating the Vagrant box, you should run the <code>bash init.sh</code> command from the Homestead directory in order to update Homestead's additional configuration files. You will be asked whether you wish to overwrite your existing <code>Homestead.yaml</code>, <code>after.sh</code>, and <code>aliases</code> files:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #697098;">#</span><span style="color: #697098;"> macOS / Linux...</span></div><div class='line'><span style="color: #BFC7D5;">bash </span><span style="color: #BFC7D5;">init.sh</span></div><div class='line'> </div><div class='line'><span style="color: #697098;">#</span><span style="color: #697098;"> Windows...</span></div><div class='line'><span style="color: #BFC7D5;">init.bat</span></div></code></pre> </div> <p>Finally, you will need to regenerate your Homestead virtual machine to utilize the latest Vagrant installation:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">vagrant </span><span style="color: #BFC7D5;">up</span></div></code></pre> </div> <h2 id="daily-usage"><a href="#daily-usage">Daily Usage</a></h2> <h3 id="connecting-via-ssh"><a href="#connecting-via-ssh">Connecting via SSH</a></h3> <p>You can SSH into your virtual machine by executing the <code>vagrant ssh</code> terminal command from your Homestead directory.</p> <h3 id="adding-additional-sites"><a href="#adding-additional-sites">Adding Additional Sites</a></h3> <p>Once your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your other Laravel projects. You can run as many Laravel projects as you wish on a single Homestead environment. To add an additional site, add the site to your <code>Homestead.yaml</code> file.</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">sites</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">homestead.test</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project1/public</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">another.test</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project2/public</span></div></code></pre> </div> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> You should ensure that you have configured a <a href="#configuring-shared-folders">folder mapping</a> for the project's directory before adding the site.</p> </div> <p>If Vagrant is not automatically managing your "hosts" file, you may need to add the new site to that file as well. On macOS and Linux, this file is located at <code>/etc/hosts</code>. On Windows, it is located at <code>C:\Windows\System32\drivers\etc\hosts</code>:</p> <pre><code data-theme="olaolu-palenight" data-lang="php" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #F78C6C;">192.168.56.56</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">homestead</span><span style="color: #89DDFF;">.</span><span style="color: #82AAFF;">test</span></div><div class='line'><span style="color: #F78C6C;">192.168.56.56</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">another</span><span style="color: #89DDFF;">.</span><span style="color: #82AAFF;">test</span></div></code></pre> <p>Once the site has been added, execute the <code>vagrant reload --provision</code> terminal command from your Homestead directory.</p> <h4 id="site-types"><a href="#site-types">Site Types</a></h4> <p>Homestead supports several "types" of sites which allow you to easily run projects that are not based on Laravel. For example, we may easily add a Statamic application to Homestead using the <code>statamic</code> site type:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">sites</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">statamic.test</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/my-symfony-project/web</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">type</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">statamic</span><span style="color: #D9F5DD;">"</span></div></code></pre> </div> <p>The available site types are: <code>apache</code>, <code>apache-proxy</code>, <code>apigility</code>, <code>expressive</code>, <code>laravel</code> (the default), <code>proxy</code> (for nginx), <code>silverstripe</code>, <code>statamic</code>, <code>symfony2</code>, <code>symfony4</code>, and <code>zf</code>.</p> <h4 id="site-parameters"><a href="#site-parameters">Site Parameters</a></h4> <p>You may add additional Nginx <code>fastcgi_param</code> values to your site via the <code>params</code> site directive:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">sites</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">homestead.test</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project1/public</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">params</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">key</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">FOO</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">value</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">BAR</span></div></code></pre> </div> <h3 id="environment-variables"><a href="#environment-variables">Environment Variables</a></h3> <p>You can define global environment variables by adding them to your <code>Homestead.yaml</code> file:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">variables</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">key</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">APP_ENV</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">value</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">local</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">key</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">FOO</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">value</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">bar</span></div></code></pre> </div> <p>After updating the <code>Homestead.yaml</code> file, be sure to re-provision the machine by executing the <code>vagrant reload --provision</code> command. This will update the PHP-FPM configuration for all of the installed PHP versions and also update the environment for the <code>vagrant</code> user.</p> <h3 id="ports"><a href="#ports">Ports</a></h3> <p>By default, the following ports are forwarded to your Homestead environment:</p> <div class="content-list" markdown="1"> <ul> <li> <strong>HTTP:</strong> 8000 → Forwards To 80</li> <li> <strong>HTTPS:</strong> 44300 → Forwards To 443</li> </ul> </div> <h4 id="forwarding-additional-ports"><a href="#forwarding-additional-ports">Forwarding Additional Ports</a></h4> <p>If you wish, you may forward additional ports to the Vagrant box by defining a <code>ports</code> configuration entry within your <code>Homestead.yaml</code> file. After updating the <code>Homestead.yaml</code> file, be sure to re-provision the machine by executing the <code>vagrant reload --provision</code> command:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">ports</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">send</span><span style="color: #BFC7D5;">: </span><span style="color: #F78C6C;">50000</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #F78C6C;">5000</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">send</span><span style="color: #BFC7D5;">: </span><span style="color: #F78C6C;">7777</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #F78C6C;">777</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">protocol</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">udp</span></div></code></pre> </div> <p>Below is a list of additional Homestead service ports that you may wish to map from your host machine to your Vagrant box:</p> <div class="content-list" markdown="1"> <ul> <li> <strong>SSH:</strong> 2222 → To 22</li> <li> <strong>ngrok UI:</strong> 4040 → To 4040</li> <li> <strong>MySQL:</strong> 33060 → To 3306</li> <li> <strong>PostgreSQL:</strong> 54320 → To 5432</li> <li> <strong>MongoDB:</strong> 27017 → To 27017</li> <li> <strong>Mailpit:</strong> 8025 → To 8025</li> <li> <strong>Minio:</strong> 9600 → To 9600</li> </ul> </div> <h3 id="php-versions"><a href="#php-versions">PHP Versions</a></h3> <p>Homestead supports running multiple versions of PHP on the same virtual machine. You may specify which version of PHP to use for a given site within your <code>Homestead.yaml</code> file. The available PHP versions are: "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", and "8.3", (the default):</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">sites</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">homestead.test</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project1/public</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">php</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">7.1</span><span style="color: #D9F5DD;">"</span></div></code></pre> </div> <p><a href="#connecting-via-ssh">Within your Homestead virtual machine</a>, you may use any of the supported PHP versions via the CLI:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">php5.6 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div><div class='line'><span style="color: #BFC7D5;">php7.0 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div><div class='line'><span style="color: #BFC7D5;">php7.1 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div><div class='line'><span style="color: #BFC7D5;">php7.2 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div><div class='line'><span style="color: #BFC7D5;">php7.3 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div><div class='line'><span style="color: #BFC7D5;">php7.4 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div><div class='line'><span style="color: #BFC7D5;">php8.0 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div><div class='line'><span style="color: #BFC7D5;">php8.1 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div><div class='line'><span style="color: #BFC7D5;">php8.2 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div><div class='line'><span style="color: #BFC7D5;">php8.3 </span><span style="color: #BFC7D5;">artisan</span><span style="color: #BFC7D5;"> </span><span style="color: #BFC7D5;">list</span></div></code></pre> </div> <p>You may change the default version of PHP used by the CLI by issuing the following commands from within your Homestead virtual machine:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">php56</span></div><div class='line'><span style="color: #BFC7D5;">php70</span></div><div class='line'><span style="color: #BFC7D5;">php71</span></div><div class='line'><span style="color: #BFC7D5;">php72</span></div><div class='line'><span style="color: #BFC7D5;">php73</span></div><div class='line'><span style="color: #BFC7D5;">php74</span></div><div class='line'><span style="color: #BFC7D5;">php80</span></div><div class='line'><span style="color: #BFC7D5;">php81</span></div><div class='line'><span style="color: #BFC7D5;">php82</span></div><div class='line'><span style="color: #BFC7D5;">php83</span></div></code></pre> </div> <h3 id="connecting-to-databases"><a href="#connecting-to-databases">Connecting to Databases</a></h3> <p>A <code>homestead</code> database is configured for both MySQL and PostgreSQL out of the box. To connect to your MySQL or PostgreSQL database from your host machine's database client, you should connect to <code>127.0.0.1</code> on port <code>33060</code> (MySQL) or <code>54320</code> (PostgreSQL). The username and password for both databases is <code>homestead</code> / <code>secret</code>.</p> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> You should only use these non-standard ports when connecting to the databases from your host machine. You will use the default 3306 and 5432 ports in your Laravel application's <code>database</code> configuration file since Laravel is running <em>within</em> the virtual machine.</p> </div> <h3 id="database-backups"><a href="#database-backups">Database Backups</a></h3> <p>Homestead can automatically backup your database when your Homestead virtual machine is destroyed. To utilize this feature, you must be using Vagrant 2.1.0 or greater. Or, if you are using an older version of Vagrant, you must install the <code>vagrant-triggers</code> plug-in. To enable automatic database backups, add the following line to your <code>Homestead.yaml</code> file:</p> <pre><code data-theme="olaolu-palenight" data-lang="php" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">backup: </span><span style="color: #82AAFF;">true</span></div></code></pre> <p>Once configured, Homestead will export your databases to <code>.backup/mysql_backup</code> and <code>.backup/postgres_backup</code> directories when the <code>vagrant destroy</code> command is executed. These directories can be found in the folder where you installed Homestead or in the root of your project if you are using the <a href="#per-project-installation">per project installation</a> method.</p> <h3 id="configuring-cron-schedules"><a href="#configuring-cron-schedules">Configuring Cron Schedules</a></h3> <p>Laravel provides a convenient way to <a href="/docs/11.x/scheduling">schedule cron jobs</a> by scheduling a single <code>schedule:run</code> Artisan command to run every minute. The <code>schedule:run</code> command will examine the job schedule defined in your <code>routes/console.php</code> file to determine which scheduled tasks to run.</p> <p>If you would like the <code>schedule:run</code> command to be run for a Homestead site, you may set the <code>schedule</code> option to <code>true</code> when defining the site:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">sites</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">map</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">homestead.test</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">to</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">/home/vagrant/project1/public</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">schedule</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div></code></pre> </div> <p>The cron job for the site will be defined in the <code>/etc/cron.d</code> directory of the Homestead virtual machine.</p> <h3 id="configuring-mailpit"><a href="#configuring-mailpit">Configuring Mailpit</a></h3> <p><a href="https://github.com/axllent/mailpit">Mailpit</a> allows you to intercept your outgoing email and examine it without actually sending the mail to its recipients. To get started, update your application's <code>.env</code> file to use the following mail settings:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="ini" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #C792EA;">MAIL_MAILER</span><span style="color: #BFC7D5;">=smtp</span></div><div class='line'><span style="color: #C792EA;">MAIL_HOST</span><span style="color: #BFC7D5;">=localhost</span></div><div class='line'><span style="color: #C792EA;">MAIL_PORT</span><span style="color: #BFC7D5;">=1025</span></div><div class='line'><span style="color: #C792EA;">MAIL_USERNAME</span><span style="color: #BFC7D5;">=null</span></div><div class='line'><span style="color: #C792EA;">MAIL_PASSWORD</span><span style="color: #BFC7D5;">=null</span></div><div class='line'><span style="color: #C792EA;">MAIL_ENCRYPTION</span><span style="color: #BFC7D5;">=null</span></div></code></pre> </div> <p>Once Mailpit has been configured, you may access the Mailpit dashboard at <code>http://localhost:8025</code>.</p> <h3 id="configuring-minio"><a href="#configuring-minio">Configuring Minio</a></h3> <p><a href="https://github.com/minio/minio">Minio</a> is an open source object storage server with an Amazon S3 compatible API. To install Minio, update your <code>Homestead.yaml</code> file with the following configuration option in the <a href="#installing-optional-features">features</a> section:</p> <pre><code data-theme="olaolu-palenight" data-lang="php" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">minio: </span><span style="color: #82AAFF;">true</span></div></code></pre> <p>By default, Minio is available on port 9600. You may access the Minio control panel by visiting <code>http://localhost:9600</code>. The default access key is <code>homestead</code>, while the default secret key is <code>secretkey</code>. When accessing Minio, you should always use region <code>us-east-1</code>.</p> <p>In order to use Minio, ensure your <code>.env</code> file has the following options:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="ini" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #C792EA;">AWS_USE_PATH_STYLE_ENDPOINT</span><span style="color: #BFC7D5;">=true</span></div><div class='line'><span style="color: #C792EA;">AWS_ENDPOINT</span><span style="color: #BFC7D5;">=http://localhost:9600</span></div><div class='line'><span style="color: #C792EA;">AWS_ACCESS_KEY_ID</span><span style="color: #BFC7D5;">=homestead</span></div><div class='line'><span style="color: #C792EA;">AWS_SECRET_ACCESS_KEY</span><span style="color: #BFC7D5;">=secretkey</span></div><div class='line'><span style="color: #C792EA;">AWS_DEFAULT_REGION</span><span style="color: #BFC7D5;">=us-east-1</span></div></code></pre> </div> <p>To provision Minio powered "S3" buckets, add a <code>buckets</code> directive to your <code>Homestead.yaml</code> file. After defining your buckets, you should execute the <code>vagrant reload --provision</code> command in your terminal:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">buckets</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">name</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">your-bucket</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">policy</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">public</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">name</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">your-private-bucket</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">policy</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">none</span></div></code></pre> </div> <p>Supported <code>policy</code> values include: <code>none</code>, <code>download</code>, <code>upload</code>, and <code>public</code>.</p> <h3 id="laravel-dusk"><a href="#laravel-dusk">Laravel Dusk</a></h3> <p>In order to run <a href="/docs/11.x/dusk">Laravel Dusk</a> tests within Homestead, you should enable the <a href="#installing-optional-features"><code>webdriver</code> feature</a> in your Homestead configuration:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">features</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">webdriver</span><span style="color: #BFC7D5;">: </span><span style="color: #FF5874;">true</span></div></code></pre> </div> <p>After enabling the <code>webdriver</code> feature, you should execute the <code>vagrant reload --provision</code> command in your terminal.</p> <h3 id="sharing-your-environment"><a href="#sharing-your-environment">Sharing Your Environment</a></h3> <p>Sometimes you may wish to share what you're currently working on with coworkers or a client. Vagrant has built-in support for this via the <code>vagrant share</code> command; however, this will not work if you have multiple sites configured in your <code>Homestead.yaml</code> file.</p> <p>To solve this problem, Homestead includes its own <code>share</code> command. To get started, <a href="#connecting-via-ssh">SSH into your Homestead virtual machine</a> via <code>vagrant ssh</code> and execute the <code>share homestead.test</code> command. This command will share the <code>homestead.test</code> site from your <code>Homestead.yaml</code> configuration file. You may substitute any of your other configured sites for <code>homestead.test</code>:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">share </span><span style="color: #BFC7D5;">homestead.test</span></div></code></pre> </div> <p>After running the command, you will see an Ngrok screen appear which contains the activity log and the publicly accessible URLs for the shared site. If you would like to specify a custom region, subdomain, or other Ngrok runtime option, you may add them to your <code>share</code> command:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">share </span><span style="color: #BFC7D5;">homestead.test</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">-region=eu</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">-subdomain=laravel</span></div></code></pre> </div> <p>If you need to share content over HTTPS rather than HTTP, using the <code>sshare</code> command instead of <code>share</code> will enable you to do so.</p> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> Remember, Vagrant is inherently insecure and you are exposing your virtual machine to the Internet when running the <code>share</code> command.</p> </div> <h2 id="debugging-and-profiling"><a href="#debugging-and-profiling">Debugging and Profiling</a></h2> <h3 id="debugging-web-requests"><a href="#debugging-web-requests">Debugging Web Requests With Xdebug</a></h3> <p>Homestead includes support for step debugging using <a href="https://xdebug.org">Xdebug</a>. For example, you can access a page in your browser and PHP will connect to your IDE to allow inspection and modification of the running code.</p> <p>By default, Xdebug is already running and ready to accept connections. If you need to enable Xdebug on the CLI, execute the <code>sudo phpenmod xdebug</code> command within your Homestead virtual machine. Next, follow your IDE's instructions to enable debugging. Finally, configure your browser to trigger Xdebug with an extension or <a href="https://www.jetbrains.com/phpstorm/marklets/">bookmarklet</a>.</p> <div class="mb-10 max-w-2xl mx-auto px-4 py-8 shadow-lg lg:flex lg:items-center callout"> <div class="w-20 h-20 mb-6 flex items-center justify-center shrink-0 lg:mb-0 bg-red-600"> <div class="opacity-75"><svg width="6" height="35" viewBox="0 0 6 35" xmlns="http://www.w3.org/2000/svg"><title>exclamation</title><path d="M0 29h6v6H0v-6zM0 0h6v24H0V0z" fill="#FFF" fill-rule="nonzero"/></svg> </div> </div> <p class="mb-0 lg:ml-6 callout"> Xdebug causes PHP to run significantly slower. To disable Xdebug, run <code>sudo phpdismod xdebug</code> within your Homestead virtual machine and restart the FPM service.</p> </div> <h4 id="autostarting-xdebug"><a href="#autostarting-xdebug">Autostarting Xdebug</a></h4> <p>When debugging functional tests that make requests to the web server, it is easier to autostart debugging rather than modifying tests to pass through a custom header or cookie to trigger debugging. To force Xdebug to start automatically, modify the <code>/etc/php/7.x/fpm/conf.d/20-xdebug.ini</code> file inside your Homestead virtual machine and add the following configuration:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="ini" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #697098;">;</span><span style="color: #697098;"> If Homestead.yaml contains a different subnet for the IP address, this address may be different...</span></div><div class='line'><span style="color: #C792EA;">xdebug.client_host</span><span style="color: #BFC7D5;"> = 192.168.10.1</span></div><div class='line'><span style="color: #C792EA;">xdebug.mode</span><span style="color: #BFC7D5;"> = debug</span></div><div class='line'><span style="color: #C792EA;">xdebug.start_with_request</span><span style="color: #BFC7D5;"> = yes</span></div></code></pre> </div> <h3 id="debugging-cli-applications"><a href="#debugging-cli-applications">Debugging CLI Applications</a></h3> <p>To debug a PHP CLI application, use the <code>xphp</code> shell alias inside your Homestead virtual machine:</p> <pre><code data-theme="olaolu-palenight" data-lang="php" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #82AAFF;">xphp</span><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">/</span><span style="color: #82AAFF;">path</span><span style="color: #89DDFF;">/</span><span style="color: #82AAFF;">to</span><span style="color: #89DDFF;">/</span><span style="color: #82AAFF;">script</span></div></code></pre> <h3 id="profiling-applications-with-blackfire"><a href="#profiling-applications-with-blackfire">Profiling Applications With Blackfire</a></h3> <p><a href="https://blackfire.io/docs/introduction">Blackfire</a> is a service for profiling web requests and CLI applications. It offers an interactive user interface which displays profile data in call-graphs and timelines. It is built for use in development, staging, and production, with no overhead for end users. In addition, Blackfire provides performance, quality, and security checks on code and <code>php.ini</code> configuration settings.</p> <p>The <a href="https://blackfire.io/docs/player/index">Blackfire Player</a> is an open-source Web Crawling, Web Testing, and Web Scraping application which can work jointly with Blackfire in order to script profiling scenarios.</p> <p>To enable Blackfire, use the "features" setting in your Homestead configuration file:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">features</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">blackfire</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">server_id</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">server_id</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">server_token</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">server_value</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">client_id</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">client_id</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">client_token</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">client_value</span><span style="color: #D9F5DD;">"</span></div></code></pre> </div> <p>Blackfire server credentials and client credentials <a href="https://blackfire.io/signup">require a Blackfire account</a>. Blackfire offers various options to profile an application, including a CLI tool and browser extension. Please <a href="https://blackfire.io/docs/php/integrations/laravel/index">review the Blackfire documentation for more details</a>.</p> <h2 id="network-interfaces"><a href="#network-interfaces">Network Interfaces</a></h2> <p>The <code>networks</code> property of the <code>Homestead.yaml</code> file configures network interfaces for your Homestead virtual machine. You may configure as many interfaces as necessary:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">networks</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">type</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">private_network</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">ip</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">192.168.10.20</span><span style="color: #D9F5DD;">"</span></div></code></pre> </div> <p>To enable a <a href="https://developer.hashicorp.com/vagrant/docs/networking/public_network">bridged</a> interface, configure a <code>bridge</code> setting for the network and change the network type to <code>public_network</code>:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">networks</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">type</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">public_network</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">ip</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">192.168.10.20</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">bridge</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">en1: Wi-Fi (AirPort)</span><span style="color: #D9F5DD;">"</span></div></code></pre> </div> <p>To enable <a href="https://developer.hashicorp.com/vagrant/docs/networking/public_network#dhcp">DHCP</a>, just remove the <code>ip</code> option from your configuration:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">networks</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">type</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">public_network</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">bridge</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">en1: Wi-Fi (AirPort)</span><span style="color: #D9F5DD;">"</span></div></code></pre> </div> <p>To update what device the network is using, you may add a <code>dev</code> option to the network's configuration. The default <code>dev</code> value is <code>eth0</code>:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">networks</span><span style="color: #BFC7D5;">:</span></div><div class='line'><span style="color: #BFC7D5;"> - </span><span style="color: #89DDFF;">type</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">public_network</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">ip</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">192.168.10.20</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">bridge</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">en1: Wi-Fi (AirPort)</span><span style="color: #D9F5DD;">"</span></div><div class='line'><span style="color: #BFC7D5;"> </span><span style="color: #89DDFF;">dev</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">enp2s0</span><span style="color: #D9F5DD;">"</span></div></code></pre> </div> <h2 id="extending-homestead"><a href="#extending-homestead">Extending Homestead</a></h2> <p>You may extend Homestead using the <code>after.sh</code> script in the root of your Homestead directory. Within this file, you may add any shell commands that are necessary to properly configure and customize your virtual machine.</p> <p>When customizing Homestead, Ubuntu may ask you if you would like to keep a package's original configuration or overwrite it with a new configuration file. To avoid this, you should use the following command when installing packages in order to avoid overwriting any configuration previously written by Homestead:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="shell" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #BFC7D5;">sudo </span><span style="color: #BFC7D5;">apt-get</span><span style="color: #BFC7D5;"> </span><span style="color: #82AAFF;">-y</span><span style="color: #BFC7D5;"> </span><span style="color: #F78C6C;">\</span></div><div class='line'><span style="color: #BFC7D5;"> -o </span><span style="color: #BFC7D5;">Dpkg::Options::=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">--force-confdef</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #F78C6C;">\</span></div><div class='line'><span style="color: #BFC7D5;"> -o </span><span style="color: #BFC7D5;">Dpkg::Options::=</span><span style="color: #D9F5DD;">"</span><span style="color: #C3E88D;">--force-confold</span><span style="color: #D9F5DD;">"</span><span style="color: #BFC7D5;"> </span><span style="color: #F78C6C;">\</span></div><div class='line'><span style="color: #BFC7D5;"> install </span><span style="color: #BFC7D5;">package-name</span></div></code></pre> </div> <h3 id="user-customizations"><a href="#user-customizations">User Customizations</a></h3> <p>When using Homestead with your team, you may want to tweak Homestead to better fit your personal development style. To accomplish this, you may create a <code>user-customizations.sh</code> file in the root of your Homestead directory (the same directory containing your <code>Homestead.yaml</code> file). Within this file, you may make any customization you would like; however, the <code>user-customizations.sh</code> should not be version controlled.</p> <h2 id="provider-specific-settings"><a href="#provider-specific-settings">Provider Specific Settings</a></h2> <h3 id="provider-specific-virtualbox"><a href="#provider-specific-virtualbox">VirtualBox</a></h3> <h4 id="natdnshostresolver"><a href="#natdnshostresolver"><code>natdnshostresolver</code></a></h4> <p>By default, Homestead configures the <code>natdnshostresolver</code> setting to <code>on</code>. This allows Homestead to use your host operating system's DNS settings. If you would like to override this behavior, add the following configuration options to your <code>Homestead.yaml</code> file:</p> <div class="code-container"> <pre><code data-theme="olaolu-palenight" data-lang="yaml" class='torchlight' style='background-color: #292D3E; --theme-selection-background: #7580B850;'><!-- Syntax highlighted by torchlight.dev --><div class='line'><span style="color: #89DDFF;">provider</span><span style="color: #BFC7D5;">: </span><span style="color: #BFC7D5;">virtualbox</span></div><div class='line'><span style="color: #89DDFF;">natdnshostresolver</span><span style="color: #BFC7D5;">: </span><span style="color: #D9F5DD;">'</span><span style="color: #C3E88D;">off</span><span style="color: #D9F5DD;">'</span></div></code></pre> </div> <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?serve=CKYILK3E&placement=laravelcom" id="_carbonads_js"></script> </div> </section> </section> </div> </section> </div> </div> <footer class="relative pt-12 dark:bg-dark-700"> <div class="max-w-screen-2xl mx-auto w-full px-8"> <div> <a href="/" class="inline-flex"> <img class="w-16 h-16" src="/img/logomark.min.svg" alt="Laravel" width="64" height="64" loading="lazy"> </a> </div> <div class="mt-6 grid grid-cols-12 md:gap-x-8 gap-y-12 sm:mt-12"> <div class="col-span-12 lg:col-span-4"> <p class="max-w-sm text-xs text-gray-700 sm:text-sm dark:text-gray-500"> Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in most web projects.</p> <ul class="mt-6 flex items-center space-x-3"> <li> <a href="https://x.com/laravelphp"> <img class="hidden dark:inline-block w-6 h-6" src="/img/social/x.dark.min.svg" alt="X" width="24" height="20" loading="lazy"> <img class="inline-block dark:hidden w-6 h-6" src="/img/social/x.min.svg" alt="X" width="24" height="20" loading="lazy"> </a> </li> <li> <a href="https://github.com/laravel"> <img class="hidden dark:inline-block w-6 h-6" src="/img/social/github.dark.min.svg" alt="GitHub" width="24" height="24" loading="lazy"> <img class="inline-block dark:hidden w-6 h-6" src="/img/social/github.min.svg" alt="GitHub" width="24" height="24" loading="lazy"> </a> </li> <li> <a href="https://discord.gg/laravel"> <img class="hidden dark:inline-block w-6 h-6" src="/img/social/discord.dark.min.svg" alt="Discord" width="21" height="24" loading="lazy"> <img class="inline-block dark:hidden w-6 h-6" src="/img/social/discord.min.svg" alt="Discord" width="21" height="24" loading="lazy"> </a> </li> <li> <a href="https://www.youtube.com/laravelphp"> <img class="hidden dark:inline-block w-6 h-6" src="/img/social/youtube.dark.min.svg" alt="YouTube" width="169" height="150" loading="lazy"> <img class="inline-block dark:hidden w-6 h-6" src="/img/social/youtube.min.svg" alt="YouTube" width="169" height="150" loading="lazy"> </a> </li> </ul> </div> <div class="text-xs col-span-6 md:col-span-3 lg:col-span-2"> <span class="uppercase dark:text-gray-200">Highlights</span> <div class="mt-5"> <ul class="space-y-3 text-gray-700 dark:text-gray-500"> <li> <a href="/docs/11.x/releases" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Release Notes</a> </li> <li> <a href="/docs/11.x/installation" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Getting Started</a> </li> <li> <a href="/docs/11.x/routing" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Routing</a> </li> <li> <a href="/docs/11.x/blade" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Blade Templates</a> </li> <li> <a href="/docs/11.x/authentication" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Authentication</a> </li> <li> <a href="/docs/11.x/authorization" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Authorization</a> </li> <li> <a href="/docs/11.x/artisan" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Artisan Console</a> </li> <li> <a href="/docs/11.x/database" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Database</a> </li> <li> <a href="/docs/11.x/eloquent" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Eloquent ORM</a> </li> <li> <a href="/docs/11.x/testing" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Testing</a> </li> </ul> </div> </div> <div class="text-xs col-span-6 md:col-span-3 lg:col-span-2"> <span class="uppercase dark:text-gray-200">Resources</span> <div class="mt-5"> <ul class="space-y-3 text-gray-700 dark:text-gray-500"> <li> <a href="https://bootcamp.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Laravel Bootcamp</a> </li> <li> <a href="https://laracasts.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Laracasts</a> </li> <li> <a href="https://laravel-news.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Laravel News</a> </li> <li> <a href="https://laracon.us" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Laracon</a> </li> <li> <a href="https://laracon.au" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Laracon AU</a> </li> <li> <a href="https://laracon.eu/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Laracon EU</a> </li> <li> <a href="https://laracon.in/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Laracon India</a> </li> <li> <a href="https://larabelles.com/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Larabelles</a> </li> <li> <a href="https://laravel.com/careers" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Careers</a> </li> <li> <a href="https://larajobs.com/?partner=5" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Jobs</a> </li> <li> <a href="https://laracasts.com/discuss" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Forums</a> </li> <li> <a href="/trademark" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Trademark</a> </li> </ul> </div> </div> <div class="text-xs col-span-6 md:col-span-3 lg:col-span-2"> <span class="uppercase dark:text-gray-200">Partners</span> <div class="mt-5"> <ul class="space-y-3 text-gray-700 dark:text-gray-500"> <li> <a href="https://vehikl.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Vehikl</a> </li> <li> <a href="https://webreinvent.com/?utm_source=laravel&utm_medium=laravel.com&utm_campaign=footer-link" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">WebReinvent</a> </li> <li> <a href="https://tighten.co" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Tighten</a> </li> <li> <a href="https://www.bacancytechnology.com/hire-laravel-developer?utm_source=laravel&utm_medium=partners.laravel&utm_campaign=sponsors" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Bacancy</a> </li> <li> <a href="https://64robots.com/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">64 Robots</a> </li> <li> <a href="https://activelogic.com/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Active Logic</a> </li> <li> <a href="https://www.blackairplane.com/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Black Airplane</a> </li> <li> <a href="https://www.byte5.net/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Byte 5</a> </li> <li> <a href="https://www.curotec.com/services/technologies/laravel/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Curotec</a> </li> <li> <a href="https://www.cyber-duck.co.uk/how-we-work/technology/laravel?utm_source=Laravel%20Partner&utm_medium=Sponsorship" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Cyber-Duck</a> </li> <li> <a href="https://devsquad.com/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">DevSquad</a> </li> <li> <a href="https://jump24.co.uk/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Jump24</a> </li> <li> <a href="https://kirschbaumdevelopment.com/" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Kirschbaum</a> </li> </ul> </div> </div> <div class="text-xs col-span-6 md:col-span-3 lg:col-span-2"> <span class="uppercase dark:text-gray-200">Ecosystem</span> <div class="mt-5"> <ul class="space-y-3 text-gray-700 dark:text-gray-500"> <li> <a href="/docs/11.x/starter-kits#laravel-breeze" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Breeze</a> </li> <li> <a href="/docs/11.x/billing" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Cashier</a> </li> <li> <a href="/docs/11.x/dusk" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Dusk</a> </li> <li> <a href="/docs/11.x/broadcasting" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Echo</a> </li> <li> <a href="https://envoyer.io" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Envoyer</a> </li> <li> <a href="https://forge.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Forge</a> </li> <li> <a href="https://herd.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Herd</a> </li> <li> <a href="/docs/11.x/horizon" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Horizon</a> </li> <li> <a href="https://inertiajs.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Inertia</a> </li> <li> <a href="https://jetstream.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Jetstream</a> </li> <li> <a href="https://livewire.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Livewire</a> </li> <li> <a href="https://nova.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Nova</a> </li> <li> <a href="/docs/11.x/octane" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Octane</a> </li> <li> <a href="/docs/11.x/pennant" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Pennant</a> </li> <li> <a href="/docs/11.x/pint" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Pint</a> </li> <li> <a href="/docs/11.x/prompts" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Prompts</a> </li> <li> <a href="https://pulse.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Pulse</a> </li> <li> <a href="https://reverb.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Reverb</a> </li> <li> <a href="/docs/11.x/sail" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Sail</a> </li> <li> <a href="/docs/11.x/sanctum" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Sanctum</a> </li> <li> <a href="/docs/11.x/scout" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Scout</a> </li> <li> <a href="/docs/11.x/socialite" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Socialite</a> </li> <li> <a href="https://spark.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Spark</a> </li> <li> <a href="/docs/11.x/telescope" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Telescope</a> </li> <li> <a href="https://vapor.laravel.com" class="transition-colors hover:text-gray-600 dark:hover:text-gray-400">Vapor</a> </li> </ul> </div> </div> </div> <div class="mt-10 border-t pt-6 pb-16 border-gray-200 dark:border-dark-500"> <p class="text-xs text-gray-700 dark:text-gray-400"> Laravel is a Trademark of Laravel Holdings Inc.<br /> Copyright © 2011-2024 Laravel Holdings Inc. </p> <p class="mt-6 text-xs text-gray-700 dark:text-gray-400"> Code highlighting provided by <a href="https://torchlight.dev">Torchlight</a> </p> </div> </div> </footer> <script> var algolia_app_id = 'E3MIRNPJH5'; var algolia_search_key = '1fa3a8fec06eb1858d6ca137211225c0'; var version = '11.x'; </script> <script> var _gaq=[['_setAccount','UA-23865777-1'],['_trackPageview']]; (function(d,t){ var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; s.parentNode.insertBefore(g,s) }(document,'script')); </script> <!-- HubSpot --> <script type="text/javascript" id="hs-script-loader" async defer src="//js-na1.hs-scripts.com/45240648.js"></script> <div class="fixed"> <input type="text"> </div> </body> </html>