Best Setup of Termux Desktop GUI on Android – OrcaCore
This tutorial is designed to guide you through the process of installing a Termux Desktop GUI and accessing it via VNC on your Android device. If you prefer a graphical user interface (GUI) over the command-line interface (CLI), the Termux Desktop offers an excellent solution, enabling you to run your Termux applications in a visually intuitive environment. This is truly the best setup of Termux Desktop GUI you can find.
For the complete instructions, continue reading on the Orcacore website. This article will delve into the step-by-step process.
Termux Desktop GUI on Android – Step-by-Step Installation
Before initiating the Termux Desktop installation, ensure Termux is installed and configured on your Android device. If you haven’t already done so, refer to our comprehensive guide on setting up Termux on an Android device. A properly configured Termux environment is crucial for the success of the best setup of Termux Desktop GUI.
Note: It is highly recommended to perform the Termux Desktop setup within a fresh Termux installation. This helps avoid potential conflicts with existing configurations.
Once Termux is set up, follow these steps to configure the Termux Desktop GUI on your Android device.
Step 1 – Update Termux on Android
The initial step involves updating the Termux system using the following commands:
# pkg update
# pkg upgrade -y
Note: For a detailed explanation of Termux commands and their usage, refer to our guide on Termux Commands For Android Devices.
Step 2 – Install Termux-API and Git in Termux
Since the Termux Desktop application will be cloned from GitHub, Git must be installed on your device. Execute the following command to install Git:
pkg install git
Additionally, install Termux-API, which allows command-line programs in Termux to access device functionalities through APIs. Use the following command:
pkg install termux-api
After completing these installations, proceed to the next step.
Step 3 – Download the Termux Desktop app on Android
In this step, the Termux Desktop application is cloned from its GitHub repository. Execute the following command:
git clone --depth=1 https://github.com/adi1090x/termux-desktop.git
Upon completion of the download, navigate to the Termux Desktop directory using the following command:
cd termux-desktop
Next, make the setup file executable with the following command:
chmod +x setup.sh
Step 4 – Install Termux Desktop
Now, use the following command to install the Termux Desktop on your device:
./setup.sh --install
During the installation process, you will be prompted to set a password for the VNC server. Enter your desired password and confirm it. You will then be asked for a view-only password; simply enter N and continue.

This command will also install all necessary dependencies. The installation process may take some time. Upon completion, you should see output similar to the following:
**Output**
[*] Server Is Running...
TigerVNC server sessions:
X DISPLAY # PROCESS ID
:1 12590
[*] Creating Launcher Script...
[*] Script /data/data/com.termux/files/home/.local/bin/startdesktop created successfully.
[*] $PATH reference ~/.local/bin added to /etc/profile successfully.
[*] Termux Desktop Installed Successfully.
[-] Restart termux and enter startdesktop command to start the VNC server.
[-] In VNC client, enter 127.0.0.1:5901 as Address and Password you created to connect. [-] To connect via PC over Wifi or Hotspot, use it's IP, ie: ...:5901 to connect. Also, use TigerVNC client. [-] Make sure you enter the correct port. ie: If server is running on Display :2 then port is 5902 and so on.
~/termux-desktop $
Step 5 – Start Termux Desktop VNC Server
After the installation is complete, restart Termux on your Android device. Then, execute the following command to start the VNC server:
startdesktop
Step 6 – Install VNC Viewer on Android
At this point, you need to install a VNC viewer on your Android device. Open the Google Play Store, search for a VNC viewer (e.g., RealVNC Viewer), download, and install it. Once installed, open the VNC viewer application. The best setup of Termux Desktop GUI depends on a stable VNC viewer.

Step 7 – Access Termux Desktop via VNC Viewer on Android
In the VNC viewer, tap the Plus sign ( + ) located in the main menu to add a new connection.

In the New Connection window, enter 127.0.0.1:5901 in the Address field. Provide a name for your connection in the Name field (e.g., Termux1). Then, tap Save.

Note: If you run the server again, the IP address port may change to 2 or 3.
Tap on the newly created connection to connect to your Termux app. Then click on Connect.

You will see an Unencrypted connection window; click OK.

Enter the password you set for the VNC server in Step 4 and click continue.

You should now see your Termux Desktop GUI displayed on your Android device.
You can now perform tasks using a graphical user interface.
Conclusion
You have successfully learned how to install a Termux Desktop GUI on your Android device and access it via a VNC client. The process is straightforward and user-friendly. For users who prefer a graphical environment, the Termux Desktop offers an ideal solution. Achieving the best setup of Termux Desktop GUI doesn’t have to be complicated.
Hope you enjoy it. Also, you may like to read the following articles:
- Remote Windows via Android Device
- Install Android Studio on Debian 12
- Install Metasploit on Android with Termux
Alternative Solutions for Termux Desktop GUI on Android
While the VNC-based approach detailed above is a common method for accessing a Termux desktop GUI, alternative solutions exist, each with its own advantages and disadvantages. Here are two alternative methods for setting up and accessing a Termux-based GUI on your Android device.
1. Using XSDL/XServer XSDL with a Window Manager (X11 forwarding)
Instead of using VNC, you can use an X server application like XSDL (available on the Google Play Store) combined with a window manager installed within Termux. This method leverages X11 forwarding to display graphical applications from Termux on the XSDL server.
-
Explanation: X11 is the underlying protocol for graphical environments in Unix-like systems. XSDL acts as an X server on your Android device, capable of receiving and rendering graphical output from X11 clients. Within Termux, you would install a lightweight window manager (like
xfce4
,lxde
, orfluxbox
) and configure it to forward its display to the XSDL server. This is a more direct approach than VNC, potentially offering lower latency and better performance. -
Steps:
-
Install XSDL from the Google Play Store.
-
Within Termux, install a window manager and other X11 utilities:
pkg update pkg install xfce4 xfce4-terminal pkg install tigervnc-viewer #needed for xfce to start properly
-
Configure the DISPLAY environment variable within Termux to point to the XSDL server. Add the following line to your
.bashrc
or.zshrc
file:export DISPLAY=:0
-
Start XSDL on your Android device. You may need to configure XSDL with appropriate settings such as screen resolution and input methods.
-
In Termux, start the window manager:
startxfce4
XSDL should then display the XFCE desktop.
-
-
Code Example: (Within
.bashrc
or.zshrc
)export DISPLAY=:0
-
Advantages:
- Potentially lower latency compared to VNC.
- More direct connection between Termux and the display.
-
Disadvantages:
- Requires more configuration compared to the VNC method.
- Performance can still be limited by the device’s resources.
- Compatibility issues with certain applications may arise.
2. Using a Web-Based Desktop Environment (noVNC)
Another approach involves setting up a web-based desktop environment accessible through a web browser on your Android device. This utilizes a combination of a desktop environment within Termux and a noVNC server. This solution also delivers the best setup of Termux Desktop GUI.
-
Explanation: You install a full desktop environment (like XFCE or LXDE) within Termux, similar to the XSDL method. However, instead of forwarding the display directly, you use a VNC server (like TigerVNC) running inside Termux. A noVNC server then acts as a bridge, allowing you to access the VNC session through a web browser. noVNC translates the VNC protocol into HTML5 canvas elements, which can be rendered by any modern web browser.
-
Steps:
-
Install a desktop environment and a VNC server in Termux:
pkg update pkg install tigervnc xfce4 xfce4-terminal
-
Start the VNC server. You will be prompted to set a password.
vncserver -geometry 1280x720
Replace
1280x720
with your desired resolution. -
Install
websockify
using pip. First install python if you don’t have it.pkg install python pip install websockify
-
Run websockify to bridge the VNC server to a web browser. Replace 5901 with the actual port that vncserver started on, if different.
websockify -v --web . 6080 localhost:5901
-
Open a web browser on your Android device and navigate to
http://localhost:6080
. You should see the noVNC interface. Enter the VNC password you set earlier.
-
-
Code Example:
vncserver -geometry 1280x720 #Start the VNC server websockify -v --web . 6080 localhost:5901 #Bridge VNC to web browser
-
Advantages:
- Platform-independent access (any device with a web browser).
- No need to install a separate VNC client app.
-
Disadvantages:
- Can be more resource-intensive compared to direct VNC.
- Requires more setup and configuration than the basic VNC method.
- Performance might be affected by network latency.
Both of these alternatives provide different ways to achieve a similar goal: accessing a graphical environment running inside Termux on your Android device. The best method depends on your specific needs, technical expertise, and the resources of your device. However, the best setup of Termux Desktop GUI is always the one that works best for you.