Laravel Installation Example
Tags: laravel, laravelbasic, tutorial, beginners
Published: 2022-04-20 07:02:44

Originally posted @ https://codeanddeploy.com visit and download the sample code: https://codeanddeploy.com/blog/laravel/laravel-installation-example

In this post, I will show you a Laravel installation using Windows. Usually, these steps can be applied to any machine. Take note that before we can install Laravel we need to have a Composer installed on your system.

 

Just follow the steps below to learn how to install Laravel onto your system.

 

## Step 1: Composer Installation
Before installing Laravel we need to install the first composer if not yet installed on your system. Just click the link below to install it.

 

[https://getcomposer.org/download/](https://getcomposer.org/download/)

## Step 2: Verify Composer if Installed
Once the composer installs let's check to verify if our composer is successfully installed in our system.

![laravel-installation](https://ecn-storage.s3.us-west-2.amazonaws.com/articles/laravel-installation-example-CgZLg3BzY4x980.webp?ctm=1636251004)

Once we run the composer command and display the composer's details then our composer is ready and let's install our Laravel project.

 

## Step3: Directory Laravel Installation
Usually, if you are using Xampp install on your Windows we use htdocs directory to install our Laravel project. So let's open your htdocs folder to your XAMPP directory. In my example, I name my xampp folder to PHP8 because I already have multiple versions of PHP in my system.

 

Open your command prompt then point to your xampp directory then run this command:

```
cd htdocs
```
![laravel-installation](https://ecn-storage.s3.us-west-2.amazonaws.com/articles/laravel-installation-example-gLhsni5JVlx980.webp?ctm=1636251423)

Once you are inside the htdocs directory let's install a Laravel project.

 

Run the following command:


```
composer create-project laravel/laravel laravel-blogs
```

As you can see in my command the name of our Laravel project is laravel-blogs you can change it with your project name.

![laravel-installation](https://ecn-storage.s3.us-west-2.amazonaws.com/articles/laravel-installation-example-0bHi5Xoiofx980.webp?ctm=1636251664)


Now, we installed successfully our Laravel project.

 

## Step 4: Run Artisal after Laravel installation
Let's access our Laravel installed folder called laravel-blogs so that we will test to run our artisan command.

 

Run the following commands:

```
cd laravel-blogs
```
Next, run the artisan command:

```
php artisan serve
```

## Step 5: Laravel Installed Project Running
Once we hit the command above our Laravel project is now running. See the below screenshot.

![laravel-installation](https://ecn-storage.s3.us-west-2.amazonaws.com/articles/laravel-installation-example-PnXbrfmW3Qx980.webp?ctm=1636251934)

## Step 6: Run on Browser
Now, let's copy the URL [http://127.0.0.1:8000/](http://127.0.0.1:8000) to your browser. And this is the result now:


![laravel-installation](https://ecn-storage.s3.us-west-2.amazonaws.com/articles/laravel-installation-example-UOosE9IRcSx980.webp?ctm=1636252038)

As you can see we successfully installed Laravel with Laravel 8 version. 

I hope this tutorial can help you. Kindly visit here https://codeanddeploy.com/blog/laravel/laravel-installation-example if you want to download this code.

Happy coding :)