Home > Laravel > How to Install Laravel 8 Framework on Windows, macOS and Linux?

How to Install Laravel 8 Framework on Windows, macOS and Linux?

If you are a beginner in the web development field and want to grow up with the Laravel framework? Then you should definitely pick this most popular scalable framework. So, In this article, we will learn how you can install the Laravel framework with the latest version and create your first web application project in it.

What is a Laravel

Laravel is a framework based on PHP and you can build a web application with it. It gives you an expressive structure to start your project with a web application. It has an MVC (Model, View, Controller) structure, and you can design your application amazingly to give you a better user experience.

No matter, you have experience in this web framework or not. If you are new to this Laravel framework then there’s are wide collections of the tutorial, they will help you to gain knowledge in this framework.

If you have experienced in PHP then the Laravel framework grows with you and boosts your expertise level to another next level. It will give you another experience to work in this web framework and you feel lucky that you picked this very progressive and scalable web framework.

Let’s start with install the laravel framework and create the first project in it.

Install Laravel Web Framework

To install laravel on the machine, we need a Composer. Composer is an application package manager and it is only for PHP programming language. It helps to manage dependencies libraries of PHP applications. First, we will install this then we will install laravel.

You have to follow these steps to install Composer and Laravel framework on your machine with Xampp:

Download and Install Composer

Click on this link https://getcomposer.org/Composer-Setup.exe and you will get a executable file (.exe) of compposer.

After successfully downloaded then you have to install it on your windows machine. While installing it will ask you some settings so choose as per your requirement but there will be one step ask for PHP installation path, so you must select your PHP path in the Xampp folder.

You can also install the Composer by curl command. Go to the home directory and run the following commands in the terminal.
$ cd ~
$ curl -sS https://getcomposer.org/installer -o composer-setup.php

It will download the installer from the official website. Then now you can install composer globally on your machine by this command.
$ sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer

OK. After installation, you need to check that is it installed on my machine correctly or not? Then you have to open your command prompt then run the below command. If it will show you the Composer logo inside the command prompt and some other information then it means, you have correctly installed it.

See the below image for reference.

composser success

Install Laravel Framework with Composer

Create the directory where you want to install the laravel and enter in the directory then run the following command in the command prompt.

The above command will install all required files and dependencies for the startup project. We used the --prefer-dist flag to install the latest distribution from the server.

You can also install the specific version of laravel by telling in the command. See the below command

It will take some time to download all the files. It depends on your internet speed. So, after a successful installation, you will see a success message, and now it is ready to start your project.

Execute the below command in the same directory to run the laravel application project.

The above command will start your project and it will give you a localhost default port address and you can see the project in the browser by that link. The link will be like http://localhost:8000. You can change it later by some setting.

You can change the default port by following command.
php artisan serve --port=8888

Install Laravel Framework with Laravel Installer

You can also install the Laravel Installer as a global dependency of the compoaser. Run the below command one by one.

So, open this URL http://localhost:8000 in the browser and you will see welcome screen like below:

Laravel Welcome Screen

Now, you can start your own coding design.

Hope you understand how you can install laravel web framework on your machine.
If you have any questions, ask me in the comment section, I’ll respond to you as soon as possible.

Photo of author

About Aman Mehra

Hey there! I'm Aman Mehra, a full-stack developer with over six years of hands-on experience in the industry. I've dedicated myself to mastering the ins and outs of PHP, WordPress, ReactJS, NodeJS, and AWS, so you can trust me to handle your web development needs with expertise and finesse. In 2021, I decided to share my knowledge and insights with the world by starting this blog. It's been an incredible journey so far, and I've had the opportunity to learn and grow alongside my readers. Whether you're a seasoned developer or just dipping your toes into the world of web development, I'm here to provide valuable content and solutions to help you succeed. So, stick around, explore the blog, and feel free to reach out if you have any questions or suggestions. Together, let's navigate the exciting world of web development!

Leave a Comment