🇹🇼 中文版
P.S. If you don’t want to install everything from scratch, use scripts made by Termux community instead.
In this article I will tell you how to install proot Debian manually. Step by step, I will install proot Debian from minimum rootfs provided by Temux maintainers and setup a XFCE desktop with audio. Root permission is not required.

First of all, install Termux from F-Droid.
Then setup Termux X11.
- Install proot-distro and pulseaudio
1
2
3
| pkg update
termux-setup-storage
pkg install proot-distro pulseaudio vim
|
- Edit
.profile
with VIM:
- Paste the following commmands. Make Termux start PulseAudio server automatically after launching Termux.
1
2
| pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1
pacmd load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1
|
- Download Debian 11 rootfs using proot-distro
1
| proot-distro install debian
|
- Log into Debian proot.
--user
will make you directly login to the specific user (only root available in the fresh installation). --shared-tmp
will mount Termux’s tmp
directory in proot.
1
| proot-distro login debian --user root --shared-tmp
|
- Install sudo, vim, Firefox in proot
1
2
| apt update
apt install sudo vim firefox-esr
|
Now you are in the proot environment, time to configure the system.
Choose one desktop environment to install. Note currently GNOME desktop will not launched in Termux proot.
XFCE4 is a lightweight desktop environment.
Install XFCE4 desktop environment. Type “0” when apt asking for the keyboard layout.
1
| apt install xfce4 xfce4-goodies
|
KDE Plasma is a beautiful desktop environment however it is also resource-hungry.
Install KDE Plasma:
- Setup timezone. For example, Asia/Taipei.
1
| ln -sf /usr/share/zoneinfo/Asia/Taipei /etc/localtime
|
- Install locales
- Edit /etc/locale.gen with vim:
vim /etc/locale.gen
. Uncomment (remove “#”) your langauge. For example en_US.UTF-8
- Generating locales and set the langauge of system.
1
2
| locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
|
It is recommended to create a normal user for your security. Don’t do everything in root.
- Change root password
- Add group “wheel” and “video”
1
2
3
| groupadd storage
groupadd wheel
groupadd video
|
- Add new normal user named “user” and change his password
1
2
| useradd -m -g users -G wheel,audio,video,storage -s /bin/bash user
passwd user
|
- We need to add normal users to sudoers. Type
visudo
then find something like root ALL=(ALL:ALL) ALL
. Add this in the next line of it.
- Switch to normal user
- Edit
.profile
with VIM at user’s home directory: vim ~/.profile
. Then add this to start Pulseaudio server after logging.
1
| export PULSE_SERVER=127.0.0.1 && pulseaudio --start --disable-shm=1 --exit-idle-time=-1
|
- Create a script for starting X server:
vim startx.sh
. Add these:
1
2
3
4
5
6
7
| export DISPLAY=:0
# For XFCE4 desktop
dbus-launch --exit-with-session startxfce4 &
# For KDE Plasma desktop
dbus-launch --exit-with-session startplasma-x11 &
|
- Make the script executable
- Logout proot.
Relaunch Termux
Launch Termux X11 app, keep it opening in the background. Go back to Termux and type the following commands to run Termux X11.
1
2
| Xvfb :0 -ac &
DISPLAY=:0 termux-x11 &
|
- Log into Debian as
user
.
1
| proot-distro login debian --user user --shared-tmp
|
- Use our script to start desktop environment
You shall see XFCE4 desktop showing at Termux X11. Tap flaoting window and revoke permission to make it go full screen.
Swipe down the notification bar, click Preferences
of Termux X11. Then you can switch touch screen mode to simulating touchpad.

To use soft keyboard of phone in Termux X11, swipe the bar at the bottom and you will see a field for inputing texts.
If the fonts are too small in Termux X11, click Settings Manager at top-left → Appearance and change font size or select 2x window scaling.
To stop the XFCE session, press CTRL+C in Termux. Then logout of proot Debian.