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

Tutorials ·

Localhost is a local web server for testing and development. In this tutorial, we learn to install XAMPP and setup localhost.

What Will We Learn

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

What is XAMPP?

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), Pearl (P). After installing XAMPP, you have a local web server with database.

Download XAMPP

Go to Apache Friends, and download XAMPP.

Download XAMPP

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

Install XAMPP

After downloading XAMPP, double click to launch the installer.

Install XAMPP

Click on Next and proceed with the installation.

XAMPP 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 would recommend installing Apache, PHP, MySQL and phpMyAdmin for standard web development environment. MySQL (MariaDB) and phpMyAdmin are used to setup database. By installing database, we can setup popular CMS like WordPress.

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

XAMPP Installation - Installation Folder

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

XAMPP Installation - Learn More

Uncheck it then continue with the installation. The installation starts after this step. Wait for a few minutes for the installation to be completed.

XAMPP Installation - Complete Installation

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

XAMPP Installation - Windows Warning

After completing the installation, you may see this security alert from Windows Firewall. Click on Allow Access to allow XAMPP to run on your computer.

Launch XAMPP

After the installation, it is time to launch XAMPP.

XAMPP - language selection

When you launch XAMPP for the first time, you have the option to choose your language.

Setup Localhost


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

Setup Localhost

If you able to see this page, it means you have successfully setup localhost environment in 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 purpose, 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. That’s all for this tutorial, hope you enjoyed it.

Tutorial Files



Leave a Reply

Your email address will not be published.