- 1 year ago
Laravel Homestead Windows
Laravel Homestead is a development environment for Laravel applications that uses Vagrant and VirtualBox to create a consistent and isolated environment. It provides a pre-configured virtual machine that includes all the tools you need to develop Laravel applications.
Here are the steps to set up Laravel Homestead on Windows:
Prerequisites:
- Install Git: Download and install Git for Windows from the official website.
- Install VirtualBox: Download and install VirtualBox from the official website.
- Install Vagrant: Download and install Vagrant from the official website.
Install Homestead:
Open a terminal or command prompt.
Run the following command to install Homestead:
bashcomposer global require laravel/homestead
After the installation is complete, run:
bashhomestead init
Edit Homestead.yaml:
- Navigate to the directory where Homestead was installed (usually in the user's home directory).
- Open the
Homestead.yaml
file using a text editor. - Configure your Homestead settings such as
folders
,sites
, anddatabases
.
Generate SSH Key:
Run the following command to generate an SSH key pair for the virtual machine:
bashssh-keygen -t rsa -C "your-email@example.com"
The public key will be used to access the virtual machine.
Start Homestead:
Run the following command to start the Homestead virtual machine:
bashvagrant up
Access Homestead Box:
To access the virtual machine's command line, run:
bashvagrant ssh
Edit Hosts File:
- Open the
hosts
file on your Windows machine (located atC:\Windows\System32\drivers\etc\hosts
). - Add an entry for each site you've defined in the
Homestead.yaml
file.
- Open the
Access Web Applications:
- Open your web browser and access the URLs you defined in the
Homestead.yaml
file.
- Open your web browser and access the URLs you defined in the
Now you have Laravel Homestead set up on your Windows machine. You can use this environment to develop and test Laravel applications with ease. Remember that Homestead requires some resources, so make sure your system meets the hardware requirements to run the virtual machine smoothly.
For more information and detailed setup instructions, you can refer to the official Laravel Homestead documentation: https://laravel.com/docs/8.x/homestead