You can use the UserLAnd app on an Android tablet to run a LAMP stack (Linux, Apache, MySQL, PHP) and host WordPress locally without needing a rooted device. [1, 2]
Step 1: Install UserLAnd and Set Up Linux
- Open the Google Play Store on your Android tablet and install the UserLAnd app.
- Open UserLAnd and select a Linux distribution like Ubuntu or Debian from the list.
- Create a username and password when prompted.
- Choose SSH as the connection method (or use a local terminal app/SSH client inside UserLAnd) and let the app download and build the root filesystem.
Step 2: Install the LAMP Stack & WordPress
Once inside your UserLAnd Linux terminal, update the package lists and install Apache, MySQL (or MariaDB), PHP, and WordPress dependencies: [1]
- Update and upgrade packages:bash
sudo apt update && sudo apt upgrade -yUse code with caution. - Install Apache, PHP, and MySQL/MariaDB:bash
sudo apt install apache2 php libapache2-mod-php php-mysql mysql-server -yUse code with caution. - Start the Apache and MySQL services:bash
sudo service apache2 start sudo service mysql startUse code with caution. - Create a MySQL database for WordPress:bash
sudo mysql -u rootUse code with caution.- Inside the MySQL prompt, run:sql
CREATE DATABASE wordpress_db; CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'@'localhost'; FLUSH PRIVILEGES; EXIT;Use code with caution.
- Inside the MySQL prompt, run:
- Download and configure WordPress:
- Navigate to the Apache web root:bash
cd /var/www/htmlUse code with caution. - Download the latest WordPress package:bash
sudo apt install wget -y wget https://wordpress.org tar -xvzf latest.tar.gz mv wordpress/* . rm -rf wordpress latest.tar.gzUse code with caution. - Set the proper file permissions:bash
sudo chown -R www-data:www-data /var/www/htmlUse code with caution.
- Navigate to the Apache web root:
Step 3: Access WordPress
- Find your tablet's local IP address on your Wi-Fi network (via your tablet's network settings or by typing
ip a/ifconfigin the terminal). - Open a web browser on another device (or the tablet itself) and go to:text
http://<tablet-local-ip>/Use code with caution.
Note on Limitations: Background app restriction on Android/tablets can pause or kill UserLAnd services when the tablet goes to sleep or switches apps. You may need to disable battery optimization for UserLAnd or use a wake-lock app to keep the server running reliably.
If you want, I can help you with:
- Setting up a public tunnel (like Pinggy or Cloudflare) so people outside your home Wi-Fi can view your WordPress site.
- Optimizing PHP and Apache settings for low-RAM mobile devices.
0 Comments