Please use a newer Browser like Firefox or Chrome. We are ending support for this browser. Please upgrade your browser to improve your experience and security.

How to Install XAMPP and Setup Localhost (3 Easy Steps)

Tutorials · Last updated on

I have done web development for years and XAMPP is always my first and best option for setup localhost. Installing XAMPP and setup localhost can be very easy if you found the right article to follow. In this article, I will show you how to install XAMPP and setup localhost in 3 easy steps.

What Will We Learn

  • Install XAMPP
  • Setup a local web server or localhost
  • Learn to view the HTML file in localhost

What are XAMPP and Localhost?

XAMPP is a free and open source cross-platform web server. It is simple and easy to setup. XAMPP stands for Cross-Platform (X), Apache (A), MariaDB (M), PHP (P), and Pearl (P). After installing XAMPP, you have a local web server with a database.

Localhost is a local web server for developers to do web development and testing. It is a local environment for all kinds of development and testing before the website or software goes to the production site.

Step 1: Download XAMPP

Go to Apache Friends, and download XAMPP.

Download XAMPP

Choose a PHP version based on your need. If you do not have a specific requirement for PHP version, just choose the latest one which is 8.1.10 / PHP 8.1.10.

Step 2: Install XAMPP

After downloading XAMPP, double click to launch the installer.

Install XAMPP

Click on Next and proceed with the installation.

Select Components

In this section, you can choose what components you need. To setup localhost, we only need to install Apache and PHP. However, I recommend installing Apache, PHP, MySQL, and phpMyAdmin for a standard web development environment. MySQL (MariaDB) and phpMyAdmin are used to setup a database. By installing a database, we can setup a popular CMS like WordPress.

*Although MySQL is listed in this setup screen, the installed database is MariaDB.

Installation Folder

Select a folder to install XAMPP, then continue with the installation.

Select Language

Next, select your preferred language for XAMPP. The installation starts after this step. Wait for a few minutes for the installation to be completed.

Complete XAMPP installation

At this step, we have completed the installation. Click on Finish to close the installation window.

Step 3: Launch XAMPP and Setup Localhost

XAMPP Installation - Windows Warning

After the installation, it is time to launch XAMPP. When launching XAMPP, you may see this security alert from Windows Firewall. Click on Allow Access to allow XAMPP to run on your computer.

Start XAMPP

Click on Start for the Apache module. Now, localhost is ready to be used. You can access your localhost by opening your browser and entering http://localhost/ into your browser.

Localhost

If you can see this page, it means you have successfully setup the localhost environment on your computer.

To load your file from localhost, you need to place your file into htdocs folder inside XAMPP. If you install XAMPP in the default directory, the path should be C:\xampp\htdocs

For learning purposes, you can download an index.html file from here. Place the file in your htdocs folder, then open it with this URL, http://localhost/index.html

View File in Localhost

If you see the image above, you have successfully viewed the HTML file in localhost.

Conclusion

I hope you enjoy the article and learn on how to install XAMPP and setup localhost for web development. If you have any questions or suggestions for this tutorial, please comment below. If you like this article and it helps you, please show your support by liking my Facebook page.

Tutorial Files

Download

Comments

Leave a Reply

Your email address will not be published.