How to Run n8n Locally on Android (Termux + Ubuntu)
This guide shows you how to turn your Android device into a portable automation server by running n8n inside an Ubuntu environment using Termux.
Step 1: Install Termux
- Download Termux (preferably from F-Droid or the GitHub releases to ensure you have the latest version).
- Open Termux and update the base packages:
pkg update && pkg upgrade -y
Step 2: Install Ubuntu via Proot-Distro
We use proot-distro to create a standard Linux environment where Node.js modules can compile without Android-specific errors.
-
Install the distro manager:
pkg install proot-distro -y -
Install Ubuntu:
proot-distro install ubuntu -
Login to the Ubuntu shell:
proot-distro login ubuntu
Step 3: Setup Node.js & Build Tools
Now that you are inside Ubuntu (root@ubuntu), you need to install the environment for n8n.
-
Update Ubuntu packages:
apt update && apt upgrade -y -
Install Curl and Build Essentials:
apt install curl sudo build-essential python3 -y -
Install Node.js (LTS Version):
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - apt install -y nodejs
Step 4: Install and Run n8n
- Install n8n globally:
npm install n8n -g
(This may take a few minutes as it compiles native modules like SQLite for your phone's ARM64 architecture.) 2. Launch n8n:
n8n start
Step 5: Access the Dashboard
Once you see the message n8n ready, the server is live!
- Open any browser on your phone (Chrome, Kiwi, etc.).
- Navigate to:
http://localhost:5678 - If you want to access it from a laptop on the same Wi-Fi, find your phone's IP in a new Termux session (type
ifconfig) and go tohttp://<your-phone-ip>:5678.
Pro-Tips for Your Build
- Prevent Crashes: Android often kills background apps. In Termux, run
termux-wake-lockand disable battery optimization for the Termux app in your phone settings. - Local Automations: You can now use n8n to trigger local Python scripts, manage your phone's files, or even connect it to your local Ollama/DeepSeek setup for private AI workflows!