-
Notifications
You must be signed in to change notification settings - Fork 0
Dev Environment ‐ Set up on Phone
- Update termux: apt-get update && apt-get upgrade -y
- Install wget: apt-get install wget -y
- Install proot: apt-get install proot -y
- Install git: apt-get install git -y
- Go to HOME folder: cd ~
- Download script: git clone https://github.com/MFDGaming/ubuntu-in-termux.git
- Go to script folder: cd ubuntu-in-termux
- Give execution permission: chmod +x ubuntu.sh
- Run the script: ./ubuntu.sh -y
- Now just start ubuntu: ./startubuntu.sh
lsb_release -a
Installing Docker on Ubuntu is straightforward. Follow these steps:
If you want a stable Linux distro for development on your Samsung Galaxy S23 Ultra, your best options depend on whether you want a chroot/proot-based environment (non-root) or a full Linux installation (rooted).
Distro | Stability | Performance | Root Required? | Package Support | Recommended For |
---|---|---|---|---|---|
Ubuntu (via Andronix or UserLAnd) | ⭐⭐⭐⭐ | Good | ❌ No | APT, Snap | General development (Python, Web, Node.js, etc.) |
Debian (via Proot-Distro in Termux) | ⭐⭐⭐⭐ | Good | ❌ No | APT | Stability-focused development |
Alpine Linux (via Termux Alpine) | ⭐⭐⭐⭐⭐ | Excellent | ❌ No | APK (lightweight) | Lightweight development |
Arch Linux (via Andronix) | ⭐⭐⭐ | High | ❌ No | Pacman | Latest software, rolling release |
PostmarketOS (Rooted Install) | ⭐⭐⭐⭐⭐ | Excellent | ✅ Yes | APT | Native Linux replacement for One UI |
Manjaro ARM (Rooted Install) | ⭐⭐⭐⭐ | High | ✅ Yes | Pacman | Best for a full Linux desktop on DeX |
- Run DOCKER locally in any ANDROID (without root or special kernels) - Termux - Linux on Android
- How to run Docker on Android
- https://github.com/AntonyZ89/docker-qemu-arm
Using PodMan or QEMU (Full VM)
Since Termux does not support systemd or cgroups, running Docker directly inside Termux will not work as expected. However, you can try an alternative approach using Podman or Rootful Docker with QEMU.
Podman is a container engine similar to Docker but does not require systemd or root privileges.
pkg update && pkg upgrade -y
pkg install podman -y
podman --version
podman run hello-world
Podman provides almost full Docker compatibility.
If you absolutely need Docker, running a lightweight Ubuntu VM inside Termux using QEMU is the best approach.
pkg install qemu-utils qemu-common qemu-system-x86-64 -y
mkdir ~/ubuntu
cd ~/ubuntu
curl -O https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
qemu-system-x86_64 -m 2048 -smp 2 -drive file=jammy-server-cloudimg-amd64.img,format=qcow2 -net nic -net user,hostfwd=tcp::2222-:22 -nographic
This will start an Ubuntu VM inside Termux.
Open a new Termux session and connect:
ssh -p 2222 ubuntu@localhost
Inside the VM, install Docker as usual:
sudo apt update && sudo apt install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
Now you can run Docker containers normally.
Since Termux lacks systemd and cgroups, running Docker natively is not possible. The best alternatives are:
- Use Podman (lightweight and systemd-free).
- Run a QEMU-based Ubuntu VM to fully support Docker.
Would you like help setting up a specific use case for containers in Termux? 🚀
Option1-using proot
Termux does not use **systemd** as its init system, which is required to run Docker in a standard way. However, you can still run Docker inside Termux using **PRoot** (a user-space implementation of chroot) to simulate a Linux environment.First, update and install required dependencies:
pkg update && pkg upgrade -y
pkg install proot-distro -y
Use proot-distro
to install Ubuntu:
proot-distro install ubuntu
After installation, start the Ubuntu environment:
proot-distro login ubuntu
Once inside Ubuntu, install Docker using the standard commands:
apt update && apt upgrade -y
apt install -y docker.io
Since Termux doesn’t use systemd
, manually start the Docker daemon:
dockerd --host=unix:///data/data/com.termux/files/usr/var/run/docker.sock
Open a new Termux session, enter Ubuntu (proot-distro login ubuntu
), and run:
docker --version
docker run hello-world
- Docker-in-Termux is limited because it cannot use kernel features like cgroups.
- You might face performance issues due to PRoot overhead.
- Rootless Docker is experimental in this setup.
Option2 - normal ubunty - not working
Open a terminal and run:
sudo apt update && sudo apt upgrade -y
Install necessary packages:
sudo apt install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo tee /etc/apt/keyrings/docker.asc > /dev/null
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
without sudo
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
without sudo
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
without sudo
systemctl enable --now docker
docker --version
sudo docker run hello-world
without sudo
docker --version
docker run hello-world
Add your user to the docker
group:
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world # Test without sudo
Install n8n
Since n8n (an automation workflow tool) provides a Docker image, we can run it using Podman in Termux.
First, make sure Podman is installed in Termux:
pkg update && pkg upgrade -y
pkg install podman -y
Verify the installation:
podman --version
Run the following command to pull the official n8n image:
podman pull docker.io/n8nio/n8n
To persist your workflows and settings, create a storage volume:
mkdir -p $HOME/n8n-data
Start n8n using Podman:
podman run -d --name n8n \
-p 5678:5678 \
-v $HOME/n8n-data:/home/node/.n8n \
docker.io/n8nio/n8n
🔹 Explanation:
-
-d
→ Run in detached mode. -
--name n8n
→ Name the container "n8n". -
-p 5678:5678
→ Expose n8n on port 5678. -
-v $HOME/n8n-data:/home/node/.n8n
→ Persist data.
Check running containers:
podman ps
If it's running, you should see n8n in the list.
To view logs:
podman logs -f n8n
Now, open Termux's local browser and go to:
http://localhost:5678
Or, if accessing from another device on the same network, use:
http://<your-device-ip>:5678
Find your local IP using:
ip a | grep wlan0
✅ Stop n8n:
podman stop n8n
✅ Restart n8n:
podman start n8n
✅ Remove n8n:
podman rm -f n8n
Let me know if you need additional setup, like database integration (PostgreSQL) or custom environment variables! 🎯