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.
Go to Apache Friends, and 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.
After downloading XAMPP, double click to launch the installer.
Click on Next and proceed with the installation.
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.
Select a folder to install XAMPP, then continue with the installation.
Uncheck it then continue with the installation. The installation starts after this step. Wait for a few minutes for the installation to be completed.
At this step, we have completed the installation. Click on Finish to close the installation window.
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.
After the installation, it is time to launch XAMPP.
When you launch XAMPP for the first time, you have the option to choose your language.
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.
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
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,
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.