DEV Community

Cover image for Getting Started with TERMUX πŸ“²
John Johnson Okah
John Johnson Okah

Posted on

Getting Started with TERMUX πŸ“²

Have you ever been stuck with just your phone on a bus or in a boring environment and all you could think of is getting right back to your Dev environment? πŸ§‘β€πŸ’»

If you've got an android device, we've got good news.
Termux essentially turns an Android device into a lightweight and portable development environment, enabling users to perform various tasks, such as coding, scripting, system administration, and network testing, directly on their smartphones or tablets.

The Introduction πŸ“–

Termux is an Android terminal emulator and Linux environment app that allows users to run a full-fledged Linux distribution on their Android devices. It provides a powerful command-line interface (CLI) that enables users to execute various Unix commands, run shell scripts, and access a wide range of Linux tools and utilities directly on their Android smartphones or tablets.

Termux provides a convenient and flexible environment for developers, system administrators, and enthusiasts who want to perform tasks such as programming, scripting, development, testing, and system management on their Android devices. It offers access to a package manager (pkg) that allows users to install various software packages, including programming languages, text editors, version control systems, networking tools, and more.

With Termux, users can perform tasks similar to what they would do on a traditional Linux distribution, making it a popular choice for those who need a Linux-like environment on their mobile devices. It's worth noting that while Termux provides a Linux-like environment, it operates within the confines of Android's security mechanisms, so it might not have access to certain system-level functions or require root permissions for some operations.

The Setup βš™οΈ

Setting up Termux on an Android device is a straightforward process. Here's a step-by-step guide to help you get started:

1. Download and Install Termux from F-Droid:
β†’ Go to F-Droid App Store.
β†’ Search for the Termux APK file and click Download
β†’ Open APK file and install on your device

2. Open Termux:
β†’ After the installation is complete, tap on the "Open" button to launch Termux.

3. Update and Upgrade Termux Packages:
β†’ Once Termux is open, update and upgrade the packages to ensure you have the latest versions.
Run this command :

pkg update
Enter fullscreen mode Exit fullscreen mode

to update the package lists and Run:

pkg upgrade
Enter fullscreen mode Exit fullscreen mode

to upgrade all the installed packages to their latest versions.

4. Grant Access to Storage
β†’ Finally, grant Termux the permissions to access files in your device's internal storage, including directories like DCIM, Downloads, and Documents.
β†’ Run this command to grant access:

Enter fullscreen mode Exit fullscreen mode

Accept the pop-up notification on your device requesting for file access from Termux.

The Features πŸ› οΈ

Termux comes with a range of powerful features that allow users to leverage a full-fledged Linux environment on their Android devices. Some of its key features include:

1. Terminal Emulator: Termux provides a fully functional terminal emulator that enables users to run various Unix commands, execute shell scripts, and interact with the Linux command-line interface (CLI) directly on their Android devices. Commands such asΒ ls,Β cd,Β mv,Β cp,Β touchΒ are available in Termux.

2. Package Management: Termux includes a package manager (pkg) that allows users to install, update, and remove software packages from a vast repository of Linux tools and utilities. This makes it easy to extend the functionality of Termux with various programming languages, text editors, development tools, networking utilities, and more.

Install a package with this:

pkg install <package-name>
Enter fullscreen mode Exit fullscreen mode

where <package-name> can be ffmpeg, vim, git, ...

3. Programming and Development Environment: Termux provides a platform for developers to write, compile, and run code directly on their Android devices. Users can work on coding projects using languages like Python, Ruby, Node.js, and C/C++

Run this command to install Python:

pkg install python3
Enter fullscreen mode Exit fullscreen mode

Then you can install python packages with pip:

pip install <package-name>
Enter fullscreen mode Exit fullscreen mode

where <package-name> can be pytest, yt-dlp, flask, ...

4. OpenSSH and OpenSSL: Termux includes OpenSSH and OpenSSL, which provide secure encrypted communications and cryptographic functions, respectively.

5. File Access: Users can access and manipulate files in their device's internal and external storage, making it easy to work with documents, media, and other files.

6. Text Processing Tools: Termux offers a variety of text processing tools like grep, sed, awk, and regular expressions, which are valuable for text manipulation and analysis.

7. Scripting and Task Automation: Users can create and run shell scripts on their Android devices, enabling automation of repetitive tasks.

8. Customization: Users can customize their Termux environment with themes, fonts, and various configurations to suit their preferences and workflow.

The Conclusion πŸ“•

Overall, Termux stands as a reliable and user-friendly solution, allowing individuals to embrace the power of a Linux environment on their Android devices, making it an invaluable tool for learning, productivity, and creativity, all in the palm of their hands.

- Do not download Termux from playstore, the version there is no longer supported
- Do not install suspicious packages and do not run random scripts from the internet on Termux.
- For more Info visit Termux ℹ️ Wiki, for Discussions visit Termux πŸ’¬ Reddit, and to Report Bugs visit Termux 🐞 Github.

Good luck and have fun exploring

Top comments (1)

hideandseekstheorder profile image