How to setup Localhost on your Computer using XAMPP

how to set up local server on your computer using xampp by linuxhackr

In order to test the web applications before uploading it to server, run the php file or host from your own computer you need to set up the Localhost web server on your computer.

Localhost is very useful for web developers or host any website from your own computer.

If Localhost is working on your system, then it works on typing Localhost or 127.0.0.1 on your browser search bar.

linuxhackr installing xampp on windows, setup localhost on your computer

In order to setup localhost you need Apache, PHP, MySQL. Apache is a server software, PHP is the server side programming language which is executed by Apache. And MySQL is database management tool. It is very hard to download each of them separately.

We need something who comes with all the required softwares, which is XAMPP. XAMPP is free and very easy to install and setup. It has extra more features that you can download applications like WordPress, Joomla, Drupal etc on it.

XAMPP comes for windows, Linux and mac based operating systems. We will see the the complete process of setting local server on windows or Linux based OS.

Process,

  1. Downloading XAMPP From Apache Friends
  2. Installing for Windows
  3. Installing for Linux

let’s get started

1.Downloading XAMPP Software

In order to download the XAMPP software, you have to go it’s website Apache Friends. But, don’t worry here is the download link for XAMPP.
Download XAMPP from here

linuxhackr download xampp

Download XAMPP as per your requirements, Windows or Linux and 64 bit or 32 bit.
So, you have downloaded the xampp software on your system. good job! Now, we have to install XAMPP in computer.
let’s move to the next step.

2. Installing the XAMPP For Windows OS

you have successfully downloaded the Installer of XAMPP which is in .exe file. So, follow the steps to install.

1.Double click on the .exe file and run. During running .exe file you will get a pop-up window, avoid this and press ok button.


2.Then you will see the prompt box, XAMPP setup wizard, click next.

linuxhackr installing xampp on windows, setup localhost on your computer


3.Next you have to choose the components to install in XAMPP. Select components for install, If you confused, just select Apache, MySQL, and PHP. But anyway, you can change it later.

linuxhackr installing xampp on windows, setup localhost on your computer


4.In next steps, it ask for the folder where you want to install XAMPP, by default it is in C:\xampp folder which is in your C drive. You can change it or click next.

linuxhackr installing xampp on windows, setup localhost on your computer


5.If you want to learn about Bitnami for XAMPP, check the checkbox and click next.

linuxhackr installing xampp on windows, setup localhost on your computer


6.Files of XAMPP installer starts extracting and then after sometime it’s complete. Installation success, if you want to open XAMPP control panel now check the box(Do you want to start control panel now) and then click finish.

linuxhackr installing xampp on windows, setup localhost on your computer

After installing XAMPP for Windows

To start the control panel manually, go to C:\xampp >> xampp control panel and double click on xampp-control-panel.exe file. You will get a window that’s shows the dashboard of XAMPP control panel. You can start/stop the applications from here.

linuxhackr installing xampp on windows, setup localhost on your computer

To see weather the localhost is working or not, go to your browser and type localhost in the address bar. Hit enter, If you got XAMPP page it means localhost server is working fine. If it is not opening, make sure you have turned on Apache on the control panel.

linuxhackr installing xampp on windows, setup localhost on your computer

On that XAMPP page there are lots of options, go through each of options that will help you to become familiar with XAMPP.

You might have one question, why localhost is working offline? Because, everything that you are seeing on localhost each files is saved in your computer’s C:\xampp>>htdocs folder.

It means your files should be placed in htdocs folder. Yes, every html or php file should be placed in htdocs folder.

That’s it for windows, Enjoy!

 

3.Installing the XAMPP For Linux Operating System

So, you have downloaded the XAMPP installer for Linux. I am guiding you for 64 bit version, please change the file name as your version name.

So, lets get started. Follow the steps in order to Install XAMPP in Linux System.

1.Open your terminal by pressing Ctrl+Alt+T shortcut and go to that folder where the installer has been downloaded. For example , If you downloaded installer in Downloads folder then, press

cd Downloads

2.Change the permission of the XAMPP installer in order to execute this on your system.

sudo chmod +x xampp-linux-x64-7.2.5-0-installer.run

3.Run the XAMPP installer file

sudo ./xampp-linux-x64-7.2.5-0-installer.run

4.Follow the instruction, it will be installed in /opt/lampp folder

After installing XAMPP on Linux

XAMPP has been successfully downloaded to your system, now you have to start the local server.
To start the XAMPP, open terminal and go to the root folder by typing this command.

linuxhackr installing xampp on windows, setup localhost on your computer

sudo su

Start the XAMPP by this command.

sudo opt/lampp/lampp start

Stop the XAMPP by this command.

sudo opt/lampp/lampp stop

To see wheather the localhost is working or not, go to your browser and type localhost in the address bar. Hit enter, If you got XAMPP page it means localhost server is working fine. If it is not opening, make sure you have turned XAMPP from the terminal.

On that XAMPP page there are lots of options, go through each of options that will help you to become familiar with XAMPP.

You might have one question, why localhost is working offline? Because, everything that you are seeing on localhost each files is saved in your computer’s root /opt/lampp/htocs folder. It means your files should be placed in htdocs folder. Yes, any html or php file should be placed in htdocs folder.

linuxhackr installing xampp on windows, setup localhost on your computer

XAMPP in Linux also comes in graphical interface, for open this go to root folder and type this command.

cd opt/lampp
sudo ./manager-linux-x64.run

linuxhackr installing xampp on windows, setup localhost on your computer

That’s it for Linux, Enjoy!

There are lots of features in XAMPP localhost, you can access you phpMyAdmin by localhost/phpmyadmin

More about localhost
How to install WordPress on localhost

I hope this article will be helpful for you, I have been tried to keep it simple as possible as. Spread the love and Share <3

Show more posts
how to install themes on ubuntu - linuxhackr

How to Install Themes on Ubuntu 18.04 using Gnome Tweaks

In order to install and set up themes on Ubuntu, you can download themes using PPA repository or from the web but you need a separate tool for setting up the external…

0 comments
10 best ubuntu themes

10 Best Themes For Ubuntu 18.04 Bionic Beaver

Linux has full freedom to customize and make it own. After installing Ubuntu 18.04 we have to do lots of customizing to make Ubuntu personal. However Ubuntu’s default theme GNOME is great…

1 comment
ubuntu server explained

What is Ubuntu Server? Introduction

What is Ubuntu server ? Ubuntu server is a Ubuntu operating system which is developed by Canonical and opensource programmers from the world. It is used to serve websites, file shares, and…

0 comments
teleconsole - share your terminal with your others

Teleconsole – Share your Terminal with Others | Port Forwarding

Teleconsole is a free command line tool for sharing terminal session with other people you trust. Your friend can join the terminal command line via SSH or their browser over HTTPS. This…

0 comments

How to Connect Database to IntelliJ Idea

In Ultimate edition of IntelliJ, database bundle comes with in built. But if you are using the community edition, database not comes with that. So, I will guide you that, how to…

0 comments

You May Also Like

About the Author: Linux Hackr

I love to writing Linux blogs. I'll be very happy if you say something in comment box, because it's not just comment it is my motivation. Thank you !