At first, this was a fun experiment installing a terminal app on my Android phone and playing around with some Linux commands. One thing lead to another and I ended up running a Payara Micro instance on my device! In this article, I’m going to show you exactly how to do that.
The best terminal app I found isTermux, which is an open source terminal emulator that provides a Linux environment. This means that you can install packages, run common Linux commands, and even configure startup processes when you boot up your phone. One of the most amazing things you can do with it is install community-made images of Linux’s distributions like Arch, Debian, Fedora, Kali, Ubuntu, etc.
However, even with Termux, you can’t install a JDK yet. After several tries, I installedFedora 27 in Termuxsince I realized that is the most lightweight distribution for this requirement. To install it, just type the following commands in Termux (usef27_armorf27_arm64depending your device):
This operation will take from 10 to 30 minutes depending on your device, so be patient. After the installation is complete start the Fedora environment with thestartfedoracommand:
Installing OpenJDK 8
Now that we are inside of ourFedora 27environment, we are going to install OpenJDK v8 using the YUM package manager:
yum install java-1.0.8-openjdk
Fedora might want to update some dependencies before installing the JDK, so this might take a while. If you check the Java version withjava -versionafter installing the JDK, you will notice that it will fail; don’t worry about it since it doesn’t affect our goal to run an instance of Payara Micro.
Downloading Payara Micro and deploying an application.
Let’s download the Payara Micro JAR file. To do this, just copy the distribution link from thePayara websiteand use it with the following command:
This may take several minutes depending on your device, and may throw some exceptions (in some cases), but your application will be deployed nonetheless.
In this case, the server is listening on port8080by default, so go to the device web browser and launch thehttp://localhost:8080website:
Open the Payara Micro server outside your local Network
In case you want to show your new portable Payara Server to your friends, you can install a service calledNgrok.
To do this, you need to download theARM versionand install it on your Termux terminal. Once installed you can open your server with the following command:
./ngrok http 8080
Which will give you an URL to see your server from the Internet. Isn’t it cool?
Final Notes
At this time, the steps to achieve all of the above are a bit convoluted, so maybe in the future the entire process can be simplified to ease running a Payara Micro instance on your smartphone.
Remember that all of this depends on your device specifications, which means that the server can run too slow or become unresponsive. Using myNexus 5Xsmartphone, it took up to 5 minutes for the Payara Server’s homepage to load, but on a separate tablet with more RAM the page loaded faster.
With an ever increasing performance in mobile processors each year, maybe we can start thinking about creating a distributed-mobile fleet of Payara Micro Servers that talks to severalIoTdevices using an array of microservices? Can you imagine that?!
Nearby devices sharing real-time data powered by Java EE and/or MicroProfile? Future possibilities are unlimited…!
Leading the Way: Payara Platform Community 7 Beta Now Fully Jakarta EE 11 Certified
We’re excited to announce that Payara Platform Community 7 Beta application server is now fully certified as Jakarta EE 11 […]
4 minutes
Community
Dominika Tasarz
02 Sep 2025
The Payara Monthly Catch – August 2025
Welcome aboard the August 2025 issue of The Payara Monthly Catch! With summer in full swing, things may have felt […]
6 minutes
Jakarta EE
Chiara Civardi
29 Aug 2025
What Is a Java Application Server? A Short Guide
Enterprise Java applications power global commerce, healthcare, government and countless other industries. These systems must be scalable, secure and […]