Step-by-Step Guide: Setting Up Laravel with Laragon
Key takeaways
- All-in-One Setup: Download and install Laragon Full, which comes with PHP, MySQL, and Composer pre-installed, eliminating the need for manual configurations.
- Built-in Terminal: Open Laragon's integrated terminal and navigate to your web root folder, typically C:\laragon\www
- Quick Installation: Run the command composer create-project laravel/laravel your-project-name to download and install the Laravel framework.
- Auto-Generated URLs: Start the Laragon web server and instantly access your new application in the browser using a clean local URL like [http://your-project-name.test](http://your-project-name.test).
Tech stack
- Laravel
- PHP
Laragon is highly recommended for beginners because it automatically handles server configuration, creates local .test domains for your projects, and comes with Composer pre-installed.
Step 1: Download and Install Laragon
1. Go to the official [Laragon download page](https://laragon.org/download/).
2. Download Laragon Full. This version is recommended because it comes with everything you need out of the box (PHP, Apache/Nginx, MySQL, Node.js, and Composer).
3. Run the installer. You can leave all the default settings checked during the installation process (especially the option to auto-create virtual hosts).
4. Once installed, open Laragon and click the Start All button to boot up your local server and database.
Step 2: Open Laragon's Built-in Terminal
Since Laragon already includes Composer, you do not need to install it separately on your computer.
1. On the Laragon dashboard, click the Terminal button.
2. This will open a command-line interface that is automatically configured to use Laragon's internal PHP and Composer versions.
Step 3: Navigate to the Web Root Directory
By default, the terminal might open in the Laragon installation folder. You need to move to the www folder, which is where all your projects will live.
Type the following command and press Enter:
cd C:\laragon\www(If you installed Laragon on a different drive, adjust the path accordingly).
Step 4: Install Laravel via Composer
Now, you will use Composer to fetch Laravel and set up a new project. Run the following command:
composer create-project laravel/laravel my-projectcomposer create-project: Tells Composer to build a new project from an existing package.
laravel/laravel: The official package name for the Laravel framework.
my-project: The name of the folder you want to create for your app. You can change this to anything you like (e.g., blog, store, portfolio).
Composer will now download Laravel and all its required dependencies. This process may take a minute or two.
Step 5: View Your Application in the Browser
One of Laragon's best features is its auto-virtual host generator. Whenever you create a new folder inside C:\laragon\www, Laragon automatically generates a clean local URL for it in the format [http://folder-name.test](http://folder-name.test).
1. Once the Composer installation finishes, look at the Laragon dashboard. It may prompt you to allow it to make changes to your hosts file (click Yes).
2. Open your web browser.
3. Type in [http://my-project.test](http://my-project.test) (matching whatever name you gave your project folder).
You should now see the official Laravel welcome screen. Your development environment is ready to go!
Did this tutorial help?
1 readers found this helpful
Comments
No comments yet. Questions about this tutorial are welcome here: the answer helps the next reader too.