How To Install GlassFish on Ubuntu 14.04

Install GlassFish on Ubuntu 14.04

For those of you who didn’t know, GlassFish is a popular app server that can run java based web applications for you. GlassFish 4.1 release supports the latest Java Platform: Enterprise Edition 7. It supports Enterprise JavaBeans, JPA, JavaServer Faces, JMS, RMI, JavaServer Pages, servlets, etc.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation GlassFish in Ubuntu 14.04 server.

Install GlassFish on Ubuntu 14.04

Step 1. First of all make sure that all packages are up to date.

Step 2. Install Java JDK 8 on Ubuntu 14.04.

Verify Installed Java Version:


Step 3. Install GlassFish.

GlassFish should not run under root privileges, to run it as a non-root user we will create a user glassfish. If you wish to run glassfish as root simply skip this step and perform everything as root, however I strongly discourage that. The user’s home directory will be glassfish directory:

Download the latest stable version of GlassFish, At the moment of writing this article it is version 4.1:

Create init script for the GlassFish service:

Add the following code lines:

Make the ‘glassfish’ script executable:

To start GlassFish service daemon, use the following command:

To turn the remote administration on and access the GlassFish admin console via web browser, execute the following commands:

Step 4. Accessing GlassFish.

GlassFish will be available on HTTP port 8080 by default also port 4848 by administration. Open your favorite browser and navigate to or http://server-ip:4848 and complete the required the steps to finish the installation. If you are using a firewall, please open port 8080 and 4848 to enable access to the control panel.

Congratulation’s! You have successfully installed GlassFish. Thanks for using this tutorial for installing GlassFish on Ubuntu 14.04 system. For additional help or useful information, we recommend you to check the official GlassFish web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!