Skip to content
CODE THE PIXEL
Laravel

Step-by-Step Guide: Setting Up Laravel with Laragon

Asyraf Wahi Anuar 3 min read Beginner

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:

Plain text
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:

Plain text
composer create-project laravel/laravel my-project

composer 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.

Leave a comment

Markdown works: `code`, ``` blocks, **bold**, links.

First comments are reviewed before they appear.

Tools & Software

Upgrade PHP and Apache in Laragon 6: A Step-by-Step Tutorial

Upgrading PHP and Apache in Laragon can enhance your development environment significantly, providing access to the latest features and improvements. This step-by-step tutorial will guide you through the process, ensuring a smooth transition while preserving your existing projects

4 min read

Misc

Web scraping using PHP Simple HTML DOM Parser

This tutorial will explain how to use PHP Simple HTML DOM Parser to extract specific content from a website and publish it into another website. Web scraping is the process of extracting data or content from a website. The extracted data or content can be published on other websites or saved into a...

4 min read

Misc

PHP: Estimate Reading Time

This tutorial will show how to create a function to estimate the time for reading some text on your web or application. Many websites have shown the estimated reading time for the users at the same time may be helpful for the users to know how long they need to finish the reading.

1 min read