WordPress Locally On Android – If you’re interested in creating a website or blog, WordPress is a great choice for its user-friendly interface and extensive customization options.
Did you know that you can install WordPress locally on your Android device? In this article, we’ll guide you through the steps of how to install WordPress locally on Android
WordPress Locally On Android – How To Install WordPress Locally On Android.Â
So let’s start the guide and follow me step by step guide to Install WordPress Locally On Android. So lets do it.
1. Before we can install WordPress, we need to install Termux on our Android device. Termux is a free and open-source terminal emulator that provides a Linux environment on your Android device. You can download Termux from the download section below.
Read More :
- How To Build a Professional Website Using GeneratePress Premium WordPress Theme
- WordPress Locally On Android – How To Install WordPress Locally On Android
- WordPress Website Speed Optimization With WP Rocket Best Settings
- 3 Best Ways To Fix 404 Page Not Found Error On WordPress Website
- How To Build a Professional Website Using Astra Pro WordPress Theme
2. To ensure that your Termux packages are up to date and functioning optimally, it’s important to regularly update and upgrade them. To do this, simply copy and paste the following command into your Termux terminal:
apt update && apt upgrade -y
Please note that during the update process, you may be prompted to enter “y” for yes or “n” for no. Simply type “y” and press enter to proceed with the update.
3. Congratulations, your Termux packages have now been successfully updated and upgraded! In order to install the necessary packages to run WordPress locally on your Android device, simply copy and paste the following command into your Termux terminal:
pkg install git nano wget -y
This command will install the Git, Nano, and Wget packages, which are necessary for running WordPress. Once the packages have been installed, you can proceed with the installation of WordPress locally on your Android device.
4. Now that you have installed Termux with all the necessary packages, the next step is to download and install the LAMP server on your Android device.
To do this, simply follow the commands below to download the LAMP server files. Open your Termux terminal. Type the following command and press Enter:
git clone https://github.com/mayTermux/lampTermux.git
This command will clone the LAMP server files from the mayTermux/lampTermux Github repository and create a new directory called “lampTermux” in your current directory.
You can navigate to this directory and run the necessary scripts to install the LAMP server on your Android device. With the LAMP server installed, you can proceed with installing WordPress locally on your Android device.
5. After following the previous step, you would have downloaded the LAMP server files on your Termux. The next step is to install these files onto your system. To do this, navigate to the lampTermux directory with the following command:
cd lampTermux
Once you are in the lampTermux directory, you need to make the lampTermux script executable by running the following command:
chmod +x install.sh
After making the script executable, run the lampTermux script using the following command:
./install.sh
This script will install Apache, PHP, MySQL, and phpMyAdmin on your Android device. By executing this script, you will have successfully installed the LAMP server on your Android device.
6. Now that you have installed the LAMP server on your Android phone, the next step is to start the server. To do this, follow the command below:
NOTE : After installation of LAMP server. Exit The termux app to refresh the changes.Â
Open your Termux terminal. Type the following command and press Enter:
lamp
This command will display all the available options on your screen.
Enable two options: start Apache and start MySQL. To start Apache, type “0” and press Enter. To start MySQL, type “1” and press Enter.
You will see a message that Apache and MySQL have been started successfully.
Congratulations! You have now started the Apache and MySQL servers on your Android device,
7. Once you have successfully started Apache and MySQL on your Android device, you can access your localhost site by following the steps below:
Open any browser on your Android device. For example, Chrome browser.
Type “localhost:8080” in the address bar and press Enter.
This will take you to the Apache page.
If you see the Apache page, it means that you have successfully installed and configured the LAMP server on your Android device.
How To Configure MySQL :
To configure MySQL and set the root password, follow the steps below:
1. After enabling the MySQL service, log in to MySQL with the root user by entering the following command in the Termux terminal:
mysql -u root
This command will take you to the MySQL login.
Once you are logged in, type the following command to use the MySQL database:
use mysql;
This command will log you in to the MySQL database.
Since we don’t know the password for our MySQL database, we will set a new password using the command below:
set password for 'root'@'localhost' = password('000000');
Replace ‘000000’ with the password you want to set.
After setting the root password, refresh the MySQL settings using the following command:
flush privileges;
To exit MySQL, type the following command:
exit;
Congratulations! You have now successfully configured MySQL and set the root password.
2. To log in to your phpMyadmin page, open any browser and type in the address bar:
localhost:8080/phpmyadmin
It will prompt you for a username and password. Use “root” as the username and “000000” as the password, according to the steps mentioned earlier.
3. If you encounter an error message such as :
"mysqli::real_connect(): (HY000/2002): No such file or directory,"
you need to perform an additional step.
Open the Termux app and copy-paste the following command:
nano /data/data/com.termux/files/usr/etc/phpmyadmin/config.inc.php
4. This command will open the “config.inc.php” file in your Termux terminal. Next, you need to replace one line of code. Look for this line:
$cfg['Servers'][$i]['host'] = 'localhost';
Replace it with:
$cfg['Servers'][$i]['host'] = '127.0.0.1';
Then press CTRL + o + Enter and CTRL + x to save your changes.
Restart the MYSQL server and try logging in to the phpMyadmin page again. The error message should be resolved now.
How To Create New Database For WordPress :
Now to use WordPress you need to create a database manually. So lets fo it.
1. First login to your phpMyadmin using above steps.
2. Click on the “Databases” tab at the top of the page.
3. In the “Create database” field, enter the name “MT”.
5. Click on the “Create” button to create the new database. After completing these steps, you should see a confirmation message indicating that the database has been successfully created.
You can now begin creating tables and adding data to the MT database.
How To Install WordPress Locally On Android
All required setups have been completed, and we are now ready to download and configure WordPress on your Termux app. Let’s get started!
1. First, you need to download the WordPress zip file to your device. Follow the commands below:
Navigate to the folder using the following command:
cd && cd htdocs/
Remove the default index file using the following command:
rm index.php
Download the WordPress zip file into that folder using the following command:
wget https://wordpress.org/latest.zip
Extract the WordPress zip file using the following command:
unzip latest.zip
Move the WordPress files to the proper folder using the following command:
cd wordpress/ && mv * ../ && cd ..
Now all your WordPress files have been added properly. Let’s configure the WordPress admin dashboard.”
2. Here are the steps to set up the WordPress admin dashboard:
Open a web browser and go to the URL where you have installed WordPress. For example, we have installed WordPress on your local machine, the URL will be http://localhost:8080
3. Once you open the URL, you should see the WordPress installation page. Select your preferred language and click on the “Continue” button.
4. On the next page, you will see the WordPress database setup form. Enter the following information in the appropriate fields:
Database Name: In this case, the database name is “MT”
Username: “root”
Password: “000000”
Database Host: “127.0.0.1”
Table Prefix (if you want to change it): [Insert desired prefix here]
Once you have entered the information, click on the “Submit” button to continue.”
5. If the database connection is successful, you will see a confirmation message on the next page. Click on the “Run the installation” button to proceed.
6. On the next page, you will be prompted to enter the site title, username, password, and email address for your WordPress site. Fill in the fields with the appropriate information and click on the “Install WordPress” button.
7. Once the installation is complete, you will see a success message. Click on the “Log In” button to access the WordPress admin dashboard.
Enter your username and password on the login page and click on the “Log In” button.
8. Congratulations! You have successfully set up your WordPress admin dashboard. From here, you can customize your site’s design, create new posts and pages, install plugins, and much more.
Download Section :
File Name | Download Links |
---|---|
Termux App | Download |
Youtube Tutorial :
Conclusion :
Installing WordPress locally on Android is a great option for those who want to have their own website or blog on the go. By following the step-by-step guide in this article, you can easily install and configure a LAMP server on your Android device using Termux, and then install WordPress to run locally.
With WordPress locally on your Android device, you can work on your website or blog from anywhere, without the need for an internet connection.
It is a convenient and efficient way to manage your website, anZ d the best part is that it is completely free. Give it a try and see how it works for you.
Very well structured
Thank you
Very useful article writen by you sir.
Everything working perfectly.
There is some issue for developer, I want to edit theme using external app like Quickedit, Acode etc, but i can’t access to that htdocs files. I’ve tried many time to browse that folder and files, using Zarchiver, but i coudn’t find. Please suggest a way to edit that files using external app.
Thanks.
Use termux or you can use github to host your htdocs files so u can easily modify your files in any editor. You can also use solid Explorer app as well. It has in build editor