{"id":18310345,"url":"https://github.com/torann/homestead","last_synced_at":"2025-10-12T05:09:48.165Z","repository":{"id":66354611,"uuid":"183629564","full_name":"Torann/homestead","owner":"Torann","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-13T15:29:40.000Z","size":356,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T11:50:31.464Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Torann.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-26T13:02:32.000Z","updated_at":"2021-05-13T14:20:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"50f13ca3-2542-4c86-b0d7-f7c3a9b04668","html_url":"https://github.com/Torann/homestead","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/Torann/homestead","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Fhomestead","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Fhomestead/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Fhomestead/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Fhomestead/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Torann","download_url":"https://codeload.github.com/Torann/homestead/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Torann%2Fhomestead/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010341,"owners_count":26084738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T16:14:09.953Z","updated_at":"2025-10-12T05:09:48.144Z","avatar_url":"https://github.com/Torann.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Homestead\n\n[![Build Status](https://travis-ci.org/Torann/homestead.svg)](https://travis-ci.org/Torann/homestead)\n\n- [Introduction](#introduction)\n    - [Included Software](#included-software)\n    - [Windows and Hyper-v](#windows-and-hyper-v)\n- [Installation \u0026 Setup](#installation--setup)\n    - [First Steps](#first-steps)\n    - [Configuring Homestead](#configuring-homestead)\n    - [Launching The Vagrant Box](#launching-the-vagrant-box)\n    - [Installing Optional Features](#installing-optional-features)\n    - [Aliases](#aliases)\n- [Daily Usage](#daily-usage)\n    - [Accessing Homestead Globally](#accessing-homestead-globally)\n    - [Connecting Via SSH](#connecting-via-ssh)\n    - [Connecting To Databases](#connecting-to-databases)\n    - [Database Backups](#database-backups)\n    - [Database Snapshots](#database-snapshots)\n    - [Adding Additional Sites](#adding-additional-sites)\n    - [Environment Variables](#environment-variables)\n    - [Configuring Cron Schedules](#configuring-cron-schedules)\n    - [Configuring Mailhog](#configuring-mailhog)\n    - [Configuring Minio](#configuring-minio)\n    - [Ports](#ports)\n    - [Sharing Your Environment](#sharing-your-environment)\n    - [Multiple PHP Versions](#multiple-php-versions)\n    - [Web Servers](#web-servers)\n    - [Mail](#mail)\n- [Debugging \u0026 Profiling](#debugging--profiling)\n    - [Debugging Web Requests With Xdebug](#debugging-web-requests)\n    - [Debugging CLI Applications](#debugging-cli-applications)\n- [Network Interfaces](#network-interfaces)\n- [Extending Homestead](#extending-homestead)\n- [Updating Homestead](#updating-homestead)\n- [Provider Specific Settings](#provider-specific-settings)\n    - [VirtualBox](#virtualbox)\n        - [Syncing Bug](#syncing-bug)\n        - [Symbolic Links](#symbolic-links)\n\n## Introduction\n\nHomestead is a pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!\n\nHomestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP 8.0, MySQL, PostgreSQL, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.\n\n### Included Software\n\nFor a full list see [https://github.com/torann/settler](https://github.com/torann/settler).\n\n### Windows and Hyper-v\n\nIf 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.\n\n#### Windows 10\n\n**1.** Open command prompt as Administrator\n\n**2.** Run `bcdedit` to check hypervisor status:\n\n**3.** Check hypervisor launch type:\n\n![Boot Configuration Data](docs/bcd-console.png)\n\n**4.** If is set to **auto** then disable it:\n\n    bcdedit /set hypervisorlaunchtype off\n\n**5.** Reboot host machine and launch VirtualBox again\n\n## Installation \u0026 Setup\n\n### First Steps\n\nBefore launching your Homestead environment, you must install [VirtualBox](https://www.virtualbox.org/wiki/Downloads) as well as [Vagrant](https://www.vagrantup.com/downloads.html). All of these software packages provide easy-to-use visual installers for all popular operating systems.\n\nBecause of [Vagrant limitations](https://www.vagrantup.com/docs/hyperv/limitations.html), The Hyper-V provider ignores all networking settings.\n\n#### Installing Homestead\n\nYou may install Homestead by cloning the repository onto your host machine. Consider cloning the repository into a `Homestead` folder within your \"home\" directory, as the Homestead box will serve as the host to all of your Laravel projects:\n\n    git clone https://github.com/torann/homestead.git ~/Homestead\n\nYou should check out a tagged version of Homestead since the `master` branch may not always be stable. You can find the latest stable version on the [GitHub Release Page](https://github.com/torann/homestead/releases):\n\n    cd ~/Homestead\n\n    // Optional - clone the desired release...\n    git checkout 1.0.1\n\nOnce you have cloned the Homestead repository, run the `bash init.sh` command from the Homestead directory to create the `Homestead.yaml` configuration file. The `Homestead.yaml` file will be placed in the Homestead directory:\n\n    // Mac / Linux...\n    bash init.sh\n\n    // Windows...\n    init.bat\n\n#### Installing The Homestead Vagrant Box\n\nOnce VirtualBox and Vagrant have been installed, you should add the `torann/homestead` box to your Vagrant installation using the following command in your terminal. It will take a few minutes to download the box, depending on your Internet connection speed:\n\n    vagrant box add torann/homestead\n\nIf this command fails, make sure your Vagrant installation is up to date.\n\n### Configuring Homestead\n\n#### Configuring Shared Folders\n\nThe `folders` property of the `Homestead.yaml` 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 environment. You may configure as many shared folders as necessary:\n\n```\nfolders:\n    - map: ~/code/project1\n      to: /home/vagrant/project1\n```\n\n\u003e Windows users should not use the `~/` path syntax and instead should use the full path to their project, such as `C:\\Users\\user\\Code\\project1`.\n\nYou should always map individual projects to their own folder mapping instead of mapping your entire `~/code` folder. When you map a folder the virtual machine must keep track of all disk IO for *every* file in the folder. This leads to performance issues if you have a large number of files in a folder.\n\n```\nfolders:\n    - map: ~/code/project1\n      to: /home/vagrant/project1\n\n    - map: ~/code/project2\n      to: /home/vagrant/project2\n```\n\n\u003e You should never mount `.` (the current directory) when using Homestead. This causes Vagrant to not map the current folder to `/vagrant` and will break optional features and cause unexpected results while provisioning.\n\nTo enable [NFS](https://www.vagrantup.com/docs/synced-folders/nfs.html), you only need to add a simple flag to your synced folder configuration:\n\n    folders:\n        - map: ~/code\n          to: /home/vagrant/code\n          type: \"nfs\"\n\n\u003e When using NFS on Windows, you should consider installing the [vagrant-winnfsd](https://github.com/winnfsd/vagrant-winnfsd) plug-in. This plug-in will maintain the correct user / group permissions for files and directories within the Homestead box.\n\nYou may also pass any options supported by Vagrant's [Synced Folders](https://www.vagrantup.com/docs/synced-folders/basic_usage.html) by listing them under the `options` key:\n\n    folders:\n        - map: ~/code\n          to: /home/vagrant/code\n          type: \"rsync\"\n          options:\n              rsync__args: [\"--verbose\", \"--archive\", \"--delete\", \"-zz\"]\n              rsync__exclude: [\"node_modules\"]\n\n#### Configuring Nginx Sites\n\nNot familiar with Nginx? No problem. The `sites` property allows you to easily map a \"domain\" to a folder on your Homestead environment. A sample site configuration is included in the `Homestead.yaml` 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 project you are working on:\n\n    sites:\n        - map: homestead.local\n          to: /home/vagrant/code/my-project/public\n\nIf you change the `sites` property after provisioning the Homestead box, you should re-run `vagrant reload --provision`  to update the Nginx configuration on the virtual machine.\n\n\u003e **NOTE** 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 via `vagrant destroy \u0026\u0026 vagrant up`.\n\n\n#### Enable / Disable Services\n\nHomestead 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:\n\n    services:\n        - enabled:\n            - \"postgresql@12-main\"\n        - disabled:\n            - \"mysql\"\n\nThe specified services will be started or stopped based on their order in the `enabled` and `disabled` directives.\n\n#### Hostname Resolution\n\nHomestead publishes hostnames over `mDNS` for automatic host resolution. If you set `hostname: homestead` in your `Homestead.yaml` file, the host will be available at `homestead.local`. MacOS, iOS, and Linux desktop distributions include `mDNS` support by default. Windows requires installing [Bonjour Print Services for Windows](https://support.apple.com/kb/DL999?viewlocale=en_US\u0026locale=en_US).\n\nUsing automatic hostnames works best for \"per project\" installations of Homestead. If you host multiple sites on a single Homestead instance, you may add the \"domains\" for your web sites to the `hosts` file on your machine. The `hosts` file will redirect requests for your Homestead sites into your Homestead machine. On Mac and Linux, this file is located at `/etc/hosts`. On Windows, it is located at `C:\\Windows\\System32\\drivers\\etc\\hosts`. The lines you add to this file will look like the following:\n\n    192.168.10.10  homestead.local\n\nMake sure the IP address listed is the one set in your `Homestead.yaml` file. Once you have added the domain to your `hosts` file and launched the Vagrant box you will be able to access the site via your web browser:\n\n    http://homestead.local\n\n### Launching The Vagrant Box\n\nOnce you have edited the `Homestead.yaml` to your liking, run the `vagrant up` command from your Homestead directory. Vagrant will boot the virtual machine and automatically configure your shared folders and Nginx sites.\n\nTo destroy the machine, you may use the `vagrant destroy --force` command.\n\n### Installing Optional Features\n\nOptional software is installed using the \"features\" setting in your Homestead configuration file. Most features can be enabled or disabled with a boolean value, while some features allow multiple configuration options:\n\n```\nfeatures:\n    - blackfire:\n        server_id: \"server_id\"\n        server_token: \"server_value\"\n        client_id: \"client_id\"\n        client_token: \"client_value\"\n    - chronograf: true\n    - couchdb: true\n    - crystal: true\n    - docker: true\n    - elasticsearch:\n        version: 7.9.0\n    - gearman: true\n    - golang: true\n    - grafana: true\n    - influxdb: true\n    - mariadb: true\n    - meilisearch: true\n    - minio: true\n    - mongodb: true\n    - neo4j: true\n    - ohmyzsh: true\n    - openresty: true\n    - pm2: true\n    - python: true\n    - rabbitmq: true\n    - solr: true\n```\n\n#### MariaDB\n\nEnabling MariaDB will remove MySQL and install MariaDB. MariaDB serves as a drop-in replacement for MySQL, so you should still use the `mysql` database driver in your application's database configuration.\n\n#### MongoDB\n\nThe default MongoDB installation will set the database username to `homestead` and the corresponding password to `secret`.\n\n#### Elasticsearch\n\nYou may specify a supported version of Elasticsearch, which may be a major version or 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 machine has at least twice the Elasticsearch allocation.\n\n\u003e Check out the [Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current) to learn how to customize your configuration.\n\n#### Neo4j\n\nThe default Neo4j installation will set the database username to `homestead` and corresponding password to `secret`. To access the Neo4j browser, visit `http://homestead.test:7474` via your web browser. The ports `7687` (Bolt), `7474` (HTTP), and `7473` (HTTPS) are ready to serve requests from the Neo4j client.\n\n### Aliases\n\nYou may add Bash aliases to your Homestead machine by modifying the `aliases` file within your Homestead directory:\n\n```\nalias c='clear'\nalias ..='cd ..'\n```\n\nAfter you have updated the `aliases` file, you should re-provision the Homestead machine using the `vagrant reload --provision` command. This will ensure that your new aliases are available on the machine.\n\n\u003e **Tip** when updating Homestead it's a good idea to check for any changes made to the base alias file\n\n## Daily Usage\n\n### Accessing Homestead Globally\n\nSometimes you may want to `vagrant up` your Homestead machine from anywhere on your filesystem. You can do this on Mac / Linux systems by adding a Bash function to your Bash profile. On Windows, you may accomplish this by adding a \"batch\" file to your `PATH`. These scripts will allow you to run any Vagrant command from anywhere on your system and will automatically point that command to your Homestead installation:\n\n#### Mac / Linux\n\n    function homestead() {\n        ( cd ~/Homestead \u0026\u0026 vagrant $* )\n    }\n\nMake sure to tweak the `~/Homestead` path in the function to the location of your actual Homestead installation. Once the function is installed, you may run commands like `homestead up` or `homestead ssh` from anywhere on your system.\n\n#### Windows\n\nCreate a `homestead.bat` batch file anywhere on your machine with the following contents:\n\n    @echo off\n\n    set cwd=%cd%\n    set homesteadVagrant=C:\\Homestead\n\n    cd /d %homesteadVagrant% \u0026\u0026 vagrant %*\n    cd /d %cwd%\n\n    set cwd=\n    set homesteadVagrant=\n\nMake sure to tweak the example `C:\\Homestead` path in the script to the actual location of your Homestead installation. After creating the file, add the file location to your `PATH`. You may then run commands like `homestead up` or `homestead ssh` from anywhere on your system.\n\n### Connecting Via SSH\n\nYou can SSH into your virtual machine by issuing the `vagrant ssh` terminal command from your Homestead directory.\n\nBut, since you will probably need to SSH into your Homestead machine frequently, consider adding the \"function\" described above to your host machine to quickly SSH into the Homestead box.\n\n### Connecting To Databases\n\nA `homestead` database is configured for both MySQL and PostgreSQL out of the box. For even more convenience, Laravel's `.env` file configures the framework to use this database out of the box.\n\nTo connect to your MySQL or PostgreSQL database from your host machine's database client, you should connect to `127.0.0.1` and port `33060` (MySQL) or `54320` (PostgreSQL). The username and password for both databases is `homestead` / `secret`.\n\n\u003e 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 database configuration file since Laravel is running _within_ the virtual machine.\n\n### Database Backups\n\nHomestead can automatically backup your database when your Vagrant box 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 `vagrant-triggers` plug-in. To enable automatic database backups, add the following line to your `Homestead.yaml` file:\n\n    backup: true\n\nOnce configured, Homestead will export your databases to `mysql_backup` and `postgres_backup` directories when the `vagrant destroy` command is executed. These directories can be found in the folder where you cloned Homestead.\n\n### WebSockets\n\nTo enable WebSockets for a site simply add the following line to the site map for each site needing WebSockets:\n\n    sites:\n        - map: homestead.local\n          to: /home/vagrant/code/public\n          websockets: 'true'\n\n\u003e In the above example WebSockets are enabled for `homestead.local`\n\n### Database Snapshots\n\nHomestead supports freezing the state of MySQL and MariaDB databases and branching between them using [Logical MySQL Manager](https://github.com/Lullabot/lmm). For example, imagine working on a site with a multi-gigabyte database. You can import the database and take a snapshot. After doing some work and creating some test content locally, you may quickly restore back to the original state.\n\nUnder the hood, LMM uses LVM's thin snapshot functionality with copy-on-write support. In practice, this means that changing a single row in a table will only cause the changes you made to be written to disk, saving significant time and disk space during restores.\n\nSince `lmm` interacts with LVM, it must be run as `root`. To see all available commands, run `sudo lmm` inside your Vagrant box. A common workflow looks like the following:\n\n1. Import a database into the default `master` lmm branch.\n1. Save a snapshot of the unchanged database using `sudo lmm branch prod-YYYY-MM-DD`.\n1. Modify the database.\n1. Run `sudo lmm merge prod-YYYY-MM-DD` to undo all changes.\n1. Run `sudo lmm delete \u003cbranch\u003e` to delete unneeded branches.\n\n### Adding Additional Sites\n\nOnce your Homestead environment is provisioned and running, you may want to add additional Nginx sites for your Laravel applications. You can run as many Laravel installations as you wish on a single Homestead environment. To add an additional site, add the site to your `Homestead.yaml` file:\n\n    sites:\n        - map: homestead.local\n          to: /home/vagrant/code/my-project/public\n        - map: another.local\n          to: /home/vagrant/code/another/public\n\nIf Vagrant is not automatically managing your \"hosts\" file, you may need to add the new site to that file as well:\n\n    192.168.10.10  homestead.local\n    192.168.10.10  another.local\n\nOnce the site has been added, run the `vagrant reload --provision` command from your Homestead directory.\n\n#### Site Types\n\nHomestead 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 single page application to Homestead using the `spa` site type:\n\n    sites:\n        - map: rails.local\n          to: /home/vagrant/code/spa\n          type: \"spa\"\n\nThe available site types are: `laravel` (the default), `proxy`, and `spa`.\n\n#### Site Parameters\n\nYou may add additional Nginx `fastcgi_param` values to your site via the `params` site directive. For example, we'll add a `FOO` parameter with a value of `BAR`:\n\n    sites:\n        - map: homestead.local\n          to: /home/vagrant/code/my-project/public\n          params:\n              - key: FOO\n                value: BAR\n\n### Environment Variables\n\nYou can set global environment variables by adding them to your `Homestead.yaml` file:\n\n    variables:\n        - key: APP_ENV\n          value: local\n        - key: FOO\n          value: bar\n\nAfter updating the `Homestead.yaml`, be sure to re-provision the machine by running `vagrant reload --provision`. This will update the PHP-FPM configuration for all of the installed PHP versions and also update the environment for the `vagrant` user.\n\n### Configuring Cron Schedules\n\nLaravel provides a convenient way to [schedule Cron jobs](/docs/{{version}}/scheduling) by scheduling a single `schedule:run` Artisan command to be run every minute. The `schedule:run` command will examine the job schedule defined in your `App\\Console\\Kernel` class to determine which jobs should be run.\n\nIf you would like the `schedule:run` command to be run for a Homestead site, you may set the `schedule` option to `true` when defining the site:\n\n    sites:\n        - map: homestead.local\n          to: /home/vagrant/code/my-project/public\n          schedule: true\n\nThe Cron job for the site will be defined in the `/etc/cron.d` folder of the virtual machine.\n\n### Configuring Mailhog\n\nMailhog allows you to easily catch your outgoing email and examine it without actually sending the mail to its recipients. To get started, update your `.env` file to use the following mail settings:\n\n    MAIL_DRIVER=smtp\n    MAIL_HOST=localhost\n    MAIL_PORT=1025\n    MAIL_USERNAME=null\n    MAIL_PASSWORD=null\n    MAIL_ENCRYPTION=null\n\nOnce Mailhog has been configured, you may access the Mailhog dashboard at `http://localhost:8025`.\n\n### Configuring Minio\n\nMinio is an open source object storage server with an Amazon S3 compatible API. To install Minio, update your `Homestead.yaml` file with the following configuration option:\n\n    minio: true\n\nBy default, Minio is available on port 9600. You may access the Minio control panel by visiting `http://homestead:9600/`. The default access key is `homestead`, while the default secret key is `secretkey`. When accessing Minio, you should always use region `us-east-1`.\n\nIn order to use Minio you will need to adjust the S3 disk configuration in your `config/filesystems.php` configuration file. You will need to add the `use_path_style_endpoint` option to the disk configuration, as well as change the `url` key to `endpoint`:\n\n    's3' =\u003e [\n        'driver' =\u003e 's3',\n        'key' =\u003e env('AWS_ACCESS_KEY_ID'),\n        'secret' =\u003e env('AWS_SECRET_ACCESS_KEY'),\n        'region' =\u003e env('AWS_DEFAULT_REGION'),\n        'bucket' =\u003e env('AWS_BUCKET'),\n        'endpoint' =\u003e env('AWS_URL'),\n        'use_path_style_endpoint' =\u003e true\n    ]\n\nFinally, ensure your `.env` file has the following options:\n\n    AWS_ACCESS_KEY_ID=homestead\n    AWS_SECRET_ACCESS_KEY=secretkey\n    AWS_DEFAULT_REGION=us-east-1\n    AWS_URL=http://homestead:9600\n\nTo provision buckets, add a `buckets` directive to your Homestead configuration file:\n\n    buckets:\n        - name: your-bucket\n          policy: public\n        - name: your-private-bucket\n          policy: none\n\nSupported `policy` values include: `none`, `download`, `upload`, and `public`.\n\n### Ports\n\nBy default, the following ports are forwarded to your Homestead environment:\n\n- **SSH:** 2222 \u0026rarr; Forwards To 22\n- **ngrok UI:** 4040 \u0026rarr; Forwards To 4040\n- **HTTP:** 8000 \u0026rarr; Forwards To 80\n- **HTTPS:** 44300 \u0026rarr; Forwards To 443\n- **MySQL:** 33060 \u0026rarr; Forwards To 3306\n- **PostgreSQL:** 54320 \u0026rarr; Forwards To 5432\n- **MongoDB:** 27017 \u0026rarr; Forwards To 27017\n- **Mailhog:** 8025 \u0026rarr; Forwards To 8025\n- **Minio:** 9600 \u0026rarr; Forwards To 9600\n- **Websockets:** 8022 \u0026rarr; Forwards To 8022\n\n#### Forwarding Additional Ports\n\nIf you wish, you may forward additional ports to the Vagrant box, as well as specify their protocol:\n\n    ports:\n        - send: 50000\n          to: 5000\n        - send: 7777\n          to: 777\n          protocol: udp\n\n### Sharing Your Environment\n\nSometimes you may wish to share what you're currently working on with coworkers or a  client. Vagrant has a built-in way to support this via `vagrant share`; however, this will not work if you have multiple sites configured in your `Homestead.yaml` file.\n\nTo solve this problem, Homestead includes its own `share` command. To get started, SSH into your Homestead machine via `vagrant ssh` and run `share homestead.local`. This will share the `homestead.local` site from your `Homestead.yaml` configuration file. You may substitute any of your other configured sites for `homestead.local`:\n\n    share homestead.local\n\nAfter 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 `share` command:\n\n    share homestead.local -region=eu -subdomain=laravel\n\n\u003e Remember, Vagrant is inherently insecure and you are exposing your virtual machine to the Internet when running the `share` command.\n\n### Multiple PHP Versions\n\nHomestead supports multiple versions of PHP on the same virtual machine. You may specify which version of PHP to use for a given site within your `Homestead.yaml` file. The available PHP versions are: \"7.4\" and \"8.0\" (the default):\n\n```\nsites:\n    - map: homestead.test\n      to: /home/vagrant/project1/public\n      php: \"7.4\"\n```\n\nIn addition, you may use any of the supported PHP versions via the CLI:\n\n```\nphp7.4 artisan list\nphp8.0 artisan list\n```\n\nYou may also update the default CLI version by issuing the following commands from within your Homestead virtual machine:\n\n```\nphp74\nphp80\n```\n\n### Mail\n\nHomestead includes the Postfix mail transfer agent, which is listening on port `1025` by default. So, you may instruct your application to use the `smtp` mail driver on `localhost` port `1025`. Then, all sent mail will be handled by Postfix and caught by Mailhog. To view your sent emails, open [http://localhost:8025](http://localhost:8025) in your web browser.\n\n## Debugging \u0026 Profiling\n\n### Debugging Web Requests With Xdebug\n\nHomestead includes support for step debugging using [Xdebug](https://xdebug.org). For example, you can load a web page from a browser, and PHP will connect to your IDE to allow inspection and modification of the running code.\n\nTo enable debugging, run the following commands inside your Vagrant box:\n\n```\nsudo phpenmod xdebug\n\n# Update this command to match your PHP version...\nsudo systemctl restart php8.0-fpm \n```\n\nNext, follow your IDE's instructions to enable debugging. Finally, configure your browser to trigger Xdebug with an extension or [bookmarklet](https://www.jetbrains.com/phpstorm/marklets/).\n\n\u003e Xdebug causes PHP to run significantly slower. To disable Xdebug, run `sudo phpdismod xdebug` within your Vagrant box and restart the FPM service.\n\n### Debugging CLI Applications\n\nTo debug a PHP CLI application, use the `xphp` shell alias inside your Vagrant box:\n\n```\nxphp path/to/script\n```\n\n#### Autostarting Xdebug\n\nWhen 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 `/etc/php/7.#/fpm/conf.d/20-xdebug.ini` inside your Vagrant box and add the following configuration:\n\n```\n; If Homestead.yml contains a different subnet for the IP address, this address may be different...\nxdebug.remote_host = 192.168.10.1\nxdebug.remote_autostart = 1\n```\n\n### Profiling PHP Performance Using XHGui\n\n[XHGui](https://www.github.com/perftools/xhgui) is a user interface for exploring the performance of your PHP applications. To enable XHGui, add `xhgui: 'true'` to your site configuration:\n\n```\nsites:\n    -\n        map: your-site.local\n        to: /home/vagrant/code/web\n        xhgui: 'true'\n```\n\nIf the site already exists, make sure to run `vagrant provision` after updating your configuration.\n\nTo profile a web request, add `xhgui=on` as a query parameter to a request. XHGui will automatically attach a cookie to the response so that subsequent requests do not need the query string value. You may view your application profile results by browsing to `http://your-site.local/xhgui`.\n\nTo profile a CLI request using XHGui, prefix the command with `XHGUI=on`:\n\n```\nXHGUI=on path/to/script\n```\n\nCLI profile results may be viewed in the same way as web profile results.\n\nNote that the act of profiling slows down script execution, and absolute times may be as much as twice as real-world requests. Therefore, always compare percentage improvements and not absolute numbers. Also, be aware the execution time includes any time spent paused in a debugger.\n\nSince performance profiles take up significant disk space, they are deleted automatically after a few days.\n\n## Network Interfaces\n\nThe `networks` property of the `Homestead.yaml` configures network interfaces for your Homestead environment. You may configure as many interfaces as necessary:\n\n```\nnetworks:\n    - type: \"private_network\"\n      ip: \"192.168.10.20\"\n```\n\nTo enable a [bridged](https://www.vagrantup.com/docs/networking/public_network.html) interface, configure a `bridge` setting and change the network type to `public_network`:\n\n```\nnetworks:\n    - type: \"public_network\"\n      ip: \"192.168.10.20\"\n      bridge: \"en1: Wi-Fi (AirPort)\"\n```\n\nTo enable [DHCP](https://www.vagrantup.com/docs/networking/public_network.html), just remove the `ip` option from your configuration:\n\n```\nnetworks:\n    - type: \"public_network\"\n      bridge: \"en1: Wi-Fi (AirPort)\"\n```\n\n## Extending Homestead\n\nYou may extend Homestead using the `after.sh` 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.\n\nWhen 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 to avoid overwriting any configuration previously written by Homestead:\n\n```\nsudo apt-get -y \\\n    -o Dpkg::Options::=\"--force-confdef\" \\\n    -o Dpkg::Options::=\"--force-confold\" \\\n    install your-package\n```\n\n## Updating Homestead\n\nYou can update Homestead in a few simple steps. First, you should update the Vagrant box using the `vagrant box update` command:\n\n```\nvagrant box update\n```\n\nNext, you need to update the Homestead source code. If you cloned the repository you can run the following commands at the location you originally cloned the repository:\n\n```\ngit fetch\n\ngit checkout 2.0.0\n```\n\nThese commands pull the latest Homestead code from the GitHub repository, fetches the latest tags, and then checks out the latest tagged release. You can find the latest stable release version on the [GitHub releases page](https://github.com/torann/homestead/releases).\n\n## Provider Specific Settings\n\n### VirtualBox\n\n#### `natdnshostresolver`\n\nBy default, Homestead configures the `natdnshostresolver` setting to `on`. This allows Homestead to use your host operating system's DNS settings. If you would like to override this behavior, add the following lines to your `Homestead.yaml` file:\n\n```\nprovider: virtualbox\nnatdnshostresolver: off\n```\n\n#### Syncing Bug\n\nVirtualbox 6 seems to have a known syncing issue on some host machines, to fix this you should add `type: smb` to any shared folders, this will use Samba instead of vboxsf mounting. Until Virtualbox fixes this issue we will have to use SMB. If using this solution you will also need to use the [Symbolic Links](#symbolic-links) settings below.\n\n**Note:** MacOS users that have never used folder type smb may need to do the following: **Open System Preferences** -\u003e **Sharing** -\u003e **Click Enable File Sharing** -\u003e **Click \"Share files and folders using SMB\"**. From there you need to add your account / password to the \"Windows File Sharing\". This should enable your MacOS account to be used.\n\nThis is not at all a solution I'm happy with, but it's the only one I can currently offer.\n\n#### Symbolic Links\n\nVirtualbox does not allow symlinks on shared folders for security reasons. To enable symlinks the following setting needs to be added to the `Homestead.yaml` configuration file:\n\n```\nshared_folder_symlink: true\n```\n\n\u003e Additionally, on windows vagrant up needs to be executed in a shell with admin rights. No workarounds necessary.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorann%2Fhomestead","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftorann%2Fhomestead","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftorann%2Fhomestead/lists"}