Use the UserLAnd app on an Android tablet to run a LAMP stack

 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
  1. Open the Google Play Store on your Android tablet and install the UserLAnd app.
  2. Open UserLAnd and select a Linux distribution like Ubuntu or Debian from the list.
  3. Create a username and password when prompted.
  4. 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.
  5. Log into your new Ubuntu/Debian environment via SSH. [1, 2, 3, 4]

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]
  1. Update and upgrade packages:
    bash
    sudo apt update && sudo apt upgrade -y
    
    Use code with caution.
  2. Install Apache, PHP, and MySQL/MariaDB:
    bash
    sudo apt install apache2 php libapache2-mod-php php-mysql mysql-server -y
    
    Use code with caution.
  3. Start the Apache and MySQL services:
    bash
    sudo service apache2 start
    sudo service mysql start
    
    Use code with caution.
  4. Create a MySQL database for WordPress:
    bash
    sudo mysql -u root
    
    Use 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.
  5. Download and configure WordPress:
    • Navigate to the Apache web root:
      bash
      cd /var/www/html
      
      Use 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.gz
      
      Use code with caution.
    • Set the proper file permissions:
      bash
      sudo chown -R www-data:www-data /var/www/html
      
      Use code with caution.

Step 3: Access WordPress
  1. Find your tablet's local IP address on your Wi-Fi network (via your tablet's network settings or by typing ip a / ifconfig in the terminal).
  2. Open a web browser on another device (or the tablet itself) and go to:
    text
    http://<tablet-local-ip>/
    
    Use code with caution.
  3. Follow the on-screen WordPress installation wizard to connect your database (wordpress_db, wp_user, your_password) and finish setting up your site. [1, 2, 3]
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.

Post a Comment

0 Comments