Brian's Blog Homepage
model of a man on the moon with an identical copy on a phone

Laragon makes local development on Windows incredibly simple, automatically creating local domains like myproject.test with HTTPS already configured. But sometimes you need your local site to pretend that it is a real production domain.

This article explains how to make Laragon locally respond to a real domain name, including creating a trusted SSL certificate, without making any changes to the live website.

If you are not familiar with Laragon, start with my previous article: Laragon: The High-Performance AMP Server for Windows .

Usually I write to transfer information from my brain to your brain via your eyes. This post is dual purpose. It will also serve as a reminder to myself how to do something I forgot you could even do. Hopefully putting it here will remind me in the future or as happened last week google search will take me back to my own words.

Why would you want to do this?

For everyday development, Laragon is brilliant.

Create a folder:

C:\laragon\www\myproject

and you automatically get:

https://myproject.test

with a trusted local HTTPS certificate.

For most development, that is all you need.

But occasionally you need your local site to pretend that it is a real production domain.

Maybe you are testing an extension that behaves differently depending on the domain name. Maybe you need to record training videos using a real-looking URL. Maybe you need to demonstrate a site without touching the live installation.

That was my situation. I needed to produce training videos for a specific site, but I did not want to change the live site and I did not want to create a copy that used a different domain.

The solution was to make my local Laragon installation answer to the real domain name.

The goal

Instead of:

https://mysite.test

I wanted:

https://teeman.net

but only on my own computer.

This is not moving the site. It is not creating a staging environment. It is simply telling my computer:

When I ask for this domain, send me to my local machine instead.

Step 1: Create the Laragon virtual host

The first step is to create a virtual host for the domain you want to simulate.

Laragon stores its Apache virtual hosts in:

C:\laragon\etc\apache2\sites-enabled\

The easiest way is to copy one of the existing virtual host files and rename it.

auto.teeman.net.conf

Open the file in a text editor and change the first two lines:

define ROOT "C:/laragon/www/teeman"

define SITE "teeman.net"

This tells Laragon and Apache:

  • where the site files are located
  • which domain this virtual host should respond to

Apache now knows what to do when a request arrives for that hostname.

Restart Apache after making the change.

Step 2: Override DNS locally

The next step is to tell Windows that this domain should point to your own computer.

Edit:

C:\Windows\System32\drivers\etc\hosts

Add:

127.0.0.1 teeman.net

Now your computer will resolve:

teeman.net

to:

127.0.0.1

instead of looking it up on the internet.

You can check this with:

ping teeman.net

You should see:

Pinging teeman.net [127.0.0.1]

At this point:

http://teeman.net

should load your local site.

Step 3: The HTTPS problem

If you try:

https://teeman.net

you will get a certificate warning.

The reason is that Laragon's default HTTPS certificate is normally something like:

Common Name (CN): laragon
Organization (O): Laragon
Organizational Unit (OU): Server

This certificate is perfectly fine for Laragon's normal .test domains.

However, it does not prove that the site is:

teeman.net

Certificates have to match the hostname being accessed.

Step 4: Create a certificate for your local domain

For this we use mkcert.

Download it from:

https://github.com/FiloSottile/mkcert/releases

For Windows, download the appropriate executable.

In my case it was:

mkcert-v1.4.4-windows-arm64.exe

I renamed it to:

mkcert.exe

and placed it somewhere on my system path (for example Laragon's usr\bin folder).

Install the local certificate authority:

mkcert -install

Now create a certificate for your simulated domain:

mkcert teeman.net

This creates:

teeman.net.pem teeman.net-key.pem

Move these two files to:

C:\laragon\etc\ssl\

Step 5: Configure Apache to use the certificate

Update the virtual host file we created in step 1 so Apache uses the new certificate:

SSLCertificateFile      C:/laragon/etc/ssl/teeman.net.pem
SSLCertificateKeyFile   C:/laragon/etc/ssl/teeman.net-key.pem

Restart Apache.

Now:

https://teeman.net

will work locally with a trusted certificate.

A very important limitation

This only works on your computer.

The real domain still exists on the internet. Other people will not see your local copy.

A server, API, webhook, or external service will still resolve:

teeman.net

to the real public website.

Your hosts file is only changing DNS resolution for your own machine.

Think of it as being disconnected from the internet and having your own private version of DNS.

This means:

  • ✅ Your browser can open the local site
  • ✅ You can record training videos showing the real domain
  • ✅ You can test domain-specific behaviour
  • ✅ You can develop without touching the live site

But:

  • ❌ Public APIs cannot call your local site
  • ❌ External services cannot see it
  • ❌ Other people cannot access it
  • ❌ Anything relying on public DNS will still use the real domain

For local development, demonstrations, and training material, though, it is incredibly useful.

J o o m l a !

Brian Teeman

Brian Teeman wearing glasses and clean shaven

Who is Brian?

As a co-founder of Joomla! and OpenSourceMatters Inc I've never been known to be lacking an opinion or being too afraid to express it.

Despite what some people might think I'm a shy and modest man who doesn't like to blow his own trumpet or boast about achievements.

Where is Brian?

custom converse sneakers in the joomla colour scheme with the text joomla rocks embroidered on the heel