Install Desktop Environment
Now install XFCE, a lightweight desktop environment, and configure Termux:X11 to display it.
Step 1: Install XFCE Desktopโ
Make sure you are logged into Ubuntu (your prompt should show root@localhost). If not, run proot-distro login ubuntu first.
apt install xfce4 xfce4-goodies dbus-x11 -yThis is the largest download in the setup process -- approximately 200-300MB of packages. Installation takes 5-8 minutes depending on your connection speed and device. You'll see extensive package download and configuration output. When finished, you'll be back at the root prompt.
The xfce4-goodies package adds useful extras like a screenshot tool, task manager, and additional panel plugins. If storage is very tight, you can skip it and install just xfce4 and dbus-x11.
Step 2: Install Termux:X11โ
Exit Ubuntu first by typing exit to return to the Termux prompt.
Termux:X11 is an Android app that acts as a display server, allowing graphical Linux applications to render on your device screen. To set it up, you need both an Android app and a companion package inside Termux:
- Download the Termux:X11 APK from the GitHub releases page.
- Install the APK on your Android device (you may need to allow installation from unknown sources).
Samsung devices may silently block the Termux:X11 APK. If the installer closes without installing the app, see Termux:X11 APK will not install on Samsung devices.
- Install the Termux:X11 companion package inside Termux:
pkg install termux-x11-nightlyThe Termux:X11 companion package installs quickly. You'll see a confirmation that the package was installed.
Step 3: Create the Launch Scriptโ
Back in Termux (not inside Ubuntu), create a script that starts everything:
nano ~/start-desktop.shEnter the following content:
After saving (Ctrl+O, Enter, Ctrl+X), make the script executable:
chmod +x ~/start-desktop.shBefore the first launch, verify that both Termux:X11 components are present:
command -v termux-x11pm list packages | grep termux.x11The first command checks the Termux-side client and should print /data/data/com.termux/files/usr/bin/termux-x11. The second checks the Termux:X11 Android app and should print package:com.termux.x11. If the first succeeds but the second returns nothing, the Android app is not installed โ on Samsung devices, see the Samsung APK troubleshooting entry before continuing.
Keep the launch script in your Termux home directory. You'll run it every time you want to start your desktop. You can customize it later as you learn more.
Learn about XFCE and alternative desktop environments in What is XFCE?.
Understand how Termux:X11 provides a display server in What is Termux:X11?.
Next Stepโ
Your desktop environment is installed and ready to go.