Java is a very popular programming language, widely used on servers and for software deployment. However, to perform this deployment and application service, it is necessary to have a server. That’s why today I’ll talk to you about how to install Payara Server.
Payara Server is the open source platform of choice for the development of Java EE production applications. In addition, it contains many improvements and better community support. Many companies worldwide use it for the deployment of their Java applications.
Installing the Payara Server will bring many advantages to our projects. For this reason, here are some of what it provides.
- Fully Supported Server derived from GlassFish 5.x Open Source Edition.
- Drop in Replacement for GlassFish Open Source Edition.
- Microprofile 1.3 API support.
- Supports deployment of JavaEE 8 applications.
- Production Enhancements including JCache, JBatch, and Hazelcast session clustering.
- Payara Micro for cloud and microservice deployments.
It is possible to install Payara Server in different operating systems such as Windows Server, Ubuntu, Debian, CentOS, RHEL, OpenSUSE, SUSE 11.4 and others.
In this tutorial, I will show you how to install it on Ubuntu 18.04 and Linux Mint 19.
1. Installing JDK for Payara Server
Payara Server requires JDK for its operation. In the case of version 5, the recommended is the JDK 8, so the first step is to check if it is installed. Type on the terminal:
:~$ java --version
In this case, note that I have JDK10 installed. In this case, I must install the 8.
:~$ sudo apt install openjdk-8-jdk
Now you must tell the system which version of Java it will use by default.
:~$ sudo update-alternatives --config java
After executing the command, enter the number corresponding to the installed Java version. And finally, run:
:~$ java -version
For now, we’re done with the JDK.
2. Install Payara Server
In a first place, you must download Payara Server from its website.
Then unzip it to the folder of your choice.
:~$ unzip payara-5.183.zip
Next, enter the folder. And in the path
:~$ cd payara5/bin/ :~$ ./asadmin start-domain
This command will start the server running domain1, which is the default domain included in Payara Server. In case you want to start another domain, this must be explicitly specified as an argument of the command.
Now, go to localhost:4848 on your web browser.
3. Changing the default port
It is always a good idea to change the default port to avoid conflicts with others.
In a first place, stop the domain:
:~$ ./asadmin stop-domain
Note: remember to execute the command being located in the
Then, edit the
domain.xml file. Located in the
:~$ cd payara5/glassfish/domains/domain1/config/ :~$ nano domain.xml
Next, locate the
network-listener section, specifically in
admin-listener and modify the port you want.
Now place yourself in the bin folder and run again:
:~$ ./asadmin start-domain
4. Deploy an application on Payara Server
There are two ways to deploy an application with Payara Server. Using the terminal the command is:
:~$ ./asadmin deploy /home/angelo/example.war
In case you want undeploy the application, run:
:~$ ./asadmin undeploy /home/angelo/example.war
And that’s all there is to it. Remember that Payara Server is very flexible so there are many options and its management although simple is very powerful.
Tell us about your experience with Payara Server. Have you used it?
Please spread this article to your social networks.