Installing Laragon

Claus Munch General

Setting up your development environment on Windows, doesn't need to be a difficult task. Tools like Laragon, and other WAMP stacks, makes the task of setting up a multi-site development environment up, quick and easy.

In this case, I focus on Laragon as the tool, as I use this on my local development computer. Later, I will descripe a way to setup a complete environment, matching you (or at least my) production environment, rooting out some of the version specific issues.

So, let's get to it. First we need to get a hold of the latest Laragon installer. At the time of this writing, this is version 4.0.4 (Laragon Full). First, go to the Download section and then select to download the Laragon Wamp. There are others, but this is the one we are interrested in right now. Download Laragon

When downloaded, start the install as usual. Install - Step 1

Choose you install path. This is not the path of your websites, but the binaries for the WAMP. Install - Step 2

Next, we choose if Laragon should Auto Start with Windows. If we want the projects to be added automatically to the hosts file (so you eg. can use mywebsite.test - more on that later). And lastly if we want the CMDer and notepad++ added to the right click meny. I recommend using the default settings. Install - Step 3

Finally, press install and let that run through. Install - Step 4 Install - Step 5 Install - Step 6

Now we need to configure Laragon. Open up the GUI and press the gears icon in the right side. Config - Step 1

That will pop up this menu. For now, lets focus on two things - ""Document Root"" and ""Hostname"". The ""Document Root"" is where we keep our website code directories. In this instance, I choose C:\Code. Tihs alså works, with pointing to a eg. Dropbox folder, containing your web projects. A thing to note, is that every folder in that directory, will get a hostname. Which brings us ti the ""Hostname"" field. The syntax {name}.test, results in every subfolder of the ""Document Root"", will get a foldername.test hostname added to the hosts file (if ""Auto virtual host"" is checked). So, in our example, a folder called in C:\Code called ""mywebsite"", would result in a mywebsite.test hostname to be added to the hosts file and thus (after a reload of the webserver) would work and point to the folder C:\Code\mywebsite. Config - Step 2

On the ""Services & Ports"" tab, we can enable eg. Redis or Nginx. We won't need any of those for this example, but nice to keep in mind at a later time. When we are done, we dismiss the window with the [x] in the right corner. Config - Step 3

A litte extra thing, we are able to choose the version of PHP we are using. This can have a significant impact on the code we write and compatability of our production site. So choose the same version as on the webhost, as this can save us from quite some headace later on. Config - Step 4

Now it's time, to make our first project! On the main window of Laragon, click the ""Menu"" text and from the pop-up menu, find the way to Menu->Quick app->Laravel and press that. First project - Step 1

Now we should name our new project. Name it ""mywebsite"". First project - Step 2

A cmd shell will pop-up and create a new database named ""mywebsite"", our project directory ""C:\Code\mywebsite"", clone the Laravel project and run a ""composer install"" to install dependencies to Laravel. First project - Step 3

Wait for the installation to run through. When it's done, it will print out the URL of our new project. In this case http://mywebsite.test/ We may have to reload the web service now. That can be done by pressing the ""Reload"" button on the Laragon main window. First project - Step 4

We are now able to access our new website from the browser. First project - Step 5

laravel laragon php
Share this post