Published on

Setup Payara Application Server on Ubuntu 16.04


Today we will setup Payara 5 on Ubuntu 16.04


Payara is an Open Source Java Application Server.


Update and Install Java 8:

apt update && apt upgrade -y
apt-get install wget curl unzip software-properties-common python-software-properties -y
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java8-installer -y
source /etc/profile.d/

Install Payara:

Download and Install Payara 5:

cd /usr/local
wget --content-disposition ''

mv payara5 payara
rm -rf


Create the Payara user and Grant Permissions:

echo 'export PATH=/usr/local/payara/glassfish/bin:$PATH' > /etc/profile.d/
addgroup --system payara
adduser --system --shell /bin/bash --ingroup payara payara
echo 'payara soft nofile 32768' >> /etc/security/limits.conf
echo 'payara hard nofile 65536' >> /etc/security/limits.conf
chown -R payara:payara /usr/local/payara

Setup the Payara Domain:

Switch to the Payara user, delete the default domain and start the production domain. It is useful to configure the JVM Options under the domains config directory according to your servers resources.

su - payara

asadmin delete-domain domain1
asadmin change-admin-password --domain_name production # default blank pass for admin
asadmin --port 4848 enable-secure-admin production

asadmin start-domain production
asadmin stop-domain production


SystemD Unit File:

Create the SystemD Unit File to be able to manage the state of the Payara Server via SystemD:

cat > /etc/systemd/system/payara.service << EOF
Description=Payara Server
ExecStart=/usr/local/payara/glassfish/bin/asadmin start-domain production
ExecReload=/usr/local/payara/glassfish/bin/asadmin restart-domain production
ExecStop=/usr/local/payara/glassfish/bin/asadmin stop-domain production
WantedBy =

Reload the systemd daemon:

systemctl daemon-reload

Start the Payara Service:

systemctl enable payara
systemctl start payara

Verify that port 4848, 8080 and 8181 is running:

netstat -tulpn | grep java

tcp        0      0 :::8080                     :::*                        LISTEN      24542/java
tcp        0      0 :::4848                     :::*                        LISTEN      24542/java
tcp        0      0 :::8181                     :::*                        LISTEN      24542/java

Access Payara Admin UI:

Access the Payara DAS via https://ip-of-payara-server:4848

Thank You

Thanks for reading, feel free to check out my website, and subscrube to my newsletter or follow me at @ruanbekker on Twitter.

Please feel free to show support by, sharing this post, making a donation, subscribing or reach out to me if you want me to demo and write up on any specific tech topic.

Buy Me A Coffee