Install Glassfish Web Server on Windows
View more Tutorials:
This document is based on:
-
Glassfish 5.0
-
Windows (ALL)
Glassfish Server is a webserver, allowing you to deploy web applications written on java. Like some other Webserver:
- Tomcat
- Weblogic
- Websphere
- JBoss
- ....
You may be so familiar with Tomcat, a webserver serves for the purpose of studying and development applications. Glassfish developed by Sun is stronger than Tomcat. After Java part was sold to Oracle, Glassfish becomes the product of Oracle. Currently, Glassfish server has two version: a free version with open source code, and a commercial version.
In this document I will guide you to install and configure Glassfish free version.

After downloading, you have one file:

Unzip Glassfish to specific folder on the hard drive:

Declare Java Home:
Glassfish5 requires you to use Java8 or newer. You need to declare the location of the Java:
Go to:
- <Glassfish_Home>/glassfish/config
Edit File:
- asenv.bat

Add configuration:
- set path=<Java_Location>/bin

Run Glassfish
Open CMD and cd to:
- <GlassFish_Home>/bin

Move to:
- cd C:\glassfish5\bin

To start domain1 on Glassfish server:
- asadmin start-domain domain1
To stop domain1:
- asadmin stop-domain domain1

domain1 has been successful start.

Open URL:

Try deploying a web application:
You can download a demo web application at:



By default after being deployed, the application is run on port 8080. You can change to other port, or change to port 80. Configuration is discussed in detail below.





Open CMD as Administrator.

CD to bin folder of Glassfish:

Run command:
asadmin create-service --name domain1

