How to install Apache, MySQL, PHP & PhpmyAdmin on Windows 10 WSL

- Advertisment -
- Advertisement -

If you are into web development, then I know you already familiar with LAMP stack that contains Apache, MySQL, PHP and PhpMyAdmin (optional) on a Linux platform. Yes, there are a couple of applications that provide LAMP in single install package to test various kinds of web applications on Windows 10/8/7 such as XAMPP and WAMP. However, if you are on Windows 10 then you don’t need them, you can get the native performance of Linux with command line interface to download, install and manage LAMP packages. And here in this tutorial, we let you know how to install MySQL, PHP and phpMyAdmin on Windows 10 using Windows Subsystem for Linux.

The Windows Subsystem of Linux which is basically Linux compatibility layer on Windows 10 to run various kind of minimal Linux distro images with command line interface. Such as Debian, Ubuntu, Kali, Arch Linux, OpenSUSE, CentOS and more… Some of them are officially available on the Windows 10 Microsoft Store such as Ubuntu. Here first, we will download Windows 10 WSL Ubuntu and in further steps, we will understand how to set up Apache, MySQL, PHP and phpMyAdmin (LAMP stack) on it. Thus, let’s start the tutorial.

Step 1: Enable Windows 10 WSL for LAMP installation

Installing Windows Subsystem for Linux is not a big deal, we don’t have to download some third-party packages at all. Just search for “Turns Windows features on or off” in the search box of Windows 10. Then find an option Windows subsystem for Linux, select and click the OK button.

On this topic, you can see our step by step article on how to activate Windows 10 WSL.

Step  2: Download WSL Linux Distro

The second thing we need is the Linux Distro on our WSL to install MySQL, PHP and phpMyAdmin. Although there are various Linux apps are available on Microsoft Store but here we are installing the Ubuntu 18.04 WSL. So, in the Windows 10 search box, type Microsoft Store and there search for Ubuntu. When it appears, click on the Get button to install it.

Step 3: Run Ubuntu 18.04 WSL

After installing, the Ubuntu will available in Windows 10 applications, click on it to run. To start properly it needs to download some extra packages, thus it will take some time, hence, be patient.

Run Ubuntu 18.04 WSL

Step 4: Run system update command

So, what we have now is exactly the Linux Ubuntu server in command line interface, thus the command will also be the same to install any Linux packages as we use in standard Ubuntu OS.

Although we have recently, installed the Ubuntu WSL distro, there will be a possibility of updates, thus first run the system update command:

sudo apt-get update 
sudo apt-get upgrade

Step 5: Install Apache on WSL

The first thing in a Linux based LAMP  stack is Linux OS itself which already have setup above, now what we need is Apache web server. It is a light open source web server to run different web apps and websites. To install it on Windows 10 subsystem for Linux use the below command:

sudo apt-get install apache2
sudo service apache2 start

install apache on WSL

Step 4: Installing MySQL on Windows 10 WSL

To install MySQL on Ubuntu Windows 10 WSL, here is the command:

sudo apt-get install mysql-server mysql-client
sudo service mysql start

Create a root user to use with phpMyAdmin later

sudo mysql -u root
CREATE USER 'h2s'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'h2s'@'localhost';

Note: Change the green colour text i.e Username and password with whatever you want to assign.

Step 5: PHP installation in Ubuntu Windows 10 WSL

Here we are installing PHP along with some important PHP extensions that you might need for your web projects.

sudo apt-get install php libapache2-mod-php php-mysql php-gd php-json php-curl php-xml php-intl
sudo apt-get update

Step 6: Install phpMyAdmin

Its time to download and install phpMyadmin on Windows WSL. We already have installed the main components of a LAMP stack that we need to install and run most of the PHP based projects on Linux. However, if you not much profound in database commands to manage it you should install phpMyAdmin too. Here is the command for that:

sudo apt-get install -y phpmyadmin

While installing the installer will ask for a couple of things.

Give some password for phpMyAdmin to register with the database server.

Install phpMyAdmin

Choose the web server that you want to configure automatically with phpMyAdmin. As we have installed Apache thus use the Spacebar key to select the option apache2 and then press the Enter button.

Select the websrver for WSL

Congifure the database for phpmyadmin.

Configuration Phpmyadmin

When it asks for database user then simply type the one we have created above. In our case, it is h2s and you have to enter your created one.

root databse user for phpmyadmin

Step 7: Test Apache and phpMyadmin

After performing all the above steps, its time check whether everything is working or not. For that first, we have to know what is our Ubuntu WSl IP address.  Use the below command:


how to find IPAddress on Ubuntu Windows 10 WSL

Now open your browser and type your system IP which you find in the above step. In our case, it is and must be different in yours.

install mysql php and phpmyadmin check

Test and Login to phpMyAdmin

To access the installed phpMyAdmin, type your system IP along with phpMyAdmin directory name as:



or using the local IP address, in our case it is:

When the login screen appears then type the root user for Database created above along with its password.

PHPmyadmin root login on WIndows WSL

Here is the Dashboard phpMyAdmin.

PHPmyadmin Dashboard


H2S Media Team
H2S is a group of tech enthusiasts those are passionate about latest technology developments. They always like to solve own technical problems and share the same solution with others through this Website.


  1. When I initially left a comment I appear to have clicked on the
    -Notify me when new comments are added- checkbox and from now on each time a comment is added I recieve four emails with the exact same comment.
    Is there a way you can remove me from that service?
    Appreciate it!


Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Latest Posts

6 Best disk space analyzer tools for Windows 10

List of best Storage or disk space usage analyzer software for Windows 10/7 to help in disk analyzation, so...

Electronics Arts “Apex Legends” game is coming to Smartphones

The news has been aired all the way among the mobile game lovers that the PC title from Electronics...

Microsoft Office app brings all the major Office apps and other services under one roof

On installing Microsoft Office on our computers, we get access to all the office applications on your computer. However,...

Half-Life Games are about to become Free to Play on Steam

According to the latest announcement from Valve, all the games under the Half-Life franchises are going to be free...
- Advertisement -

KDM launches dual charging 10,000 mAh Power Bank

KDM that deals in audio products recently has announced its budget-priced 10,000 mAh Power bank names as KDM 10X...

How to mount encrypted VeraCrypt or other volumes on an Android device

If you want to encrypt everything on your computer there are a number of encrypting solutions are available out...

- Advertisment -
- Advertisement -

You might also likeRELATED
Recommended to you