Skip to content

Installing as a Windows Service

Any Java-based application, including WSO2 Carbon and Carbon-based products, can be run as a Windows service by using a bridging tool such as Yet Another Java Service Wrapper (YAJSW).


As YAJSW is distributed under the LGPL license and WSO2 is distributed under the Apache2 license, these two cannot be packed together in a distribution. However, any end-user or customer can freely combine components under these two licenses as long as the combined work is not distributed. The following instructions will guide you via the process of using YAJSW to install WSO2 Identity Server as a Windows Service.

Follow the instructions in the sections below to set it up.


  • Install JDK and set up the JAVA_HOME environment variable. For more information, see Installation Prerequisites.
  • Download and install a service wrapper library for running WSO2 Identity Server as a Windows service. WSO2 recommends Yet Another Java Service Wrapper ( YAJSW ) version 12.14, and several WSO2 products provide a default wrapper.conf file in their <PRODUCT_HOME>/bin/yajsw/ directory. The following instructions describe how to set up this file.

Setting up the YAJSW wrapper configuration file

wrapper.conf file is used for wrapping Java Applications by YAJSW. The wrapper.conf file found in the <IS_HOME>/bin/yajsw/ directory holds the minimal configuration for running a WSO2 product as a Windows Service.

  1. Copy the wrapper.conf file found in the <IS_HOME>/bin/yajsw/ directory and paste it in the <YAJSW_HOME>/conf/ directory.
    A sample wrapper.conf file that is packed with the WSO2 product is given below.


    If you wish to set additional properties from an external registry at runtime, store sensitive information like usernames and passwords for connecting to the registry in a properties file, and secure it with the cipher tool.

    # working directory
    # Java Main class.
    # YAJSW: default is ""
    # tmp folder
    # yajsw creates temporary files named in_.. out_.. err_.. jna..
    # per default these are placed in jna.tmpdir.
    # jna.tmpdir is set in setenv batch file to <yajsw>/tmp
    wrapper.tmp.path = ${jna_tmpdir}
    # Application main class or native executable
    # One of the following properties MUST be defined
    # Java Application main class
    # Log Level for console output.  (See docs for log levels)
    # Log file to use for wrapper output logging.
    # Format of output for the log file.  (See docs for formats)
    # Log Level for log file output.  (See docs for log levels)
    # Maximum size that the log file will be allowed to grow to before
    #  the log is rolled. Size is specified in bytes.  The default value
    #  of 0, disables log rolling by size.  May abbreviate with the 'k' (kB) or
    #  'm' (mB) suffix.  For example: 10m = 10 megabytes.
    # If wrapper.logfile does not contain the string ROLLNUM it will be automatically added as suffix of the file name
    # Maximum number of rolled log files which will be allowed before old
    #  files are deleted.  The default value of 0 implies no limit.
    # Title to use when running as a console
    wrapper.console.title=WSO2 Carbon
    # Wrapper Windows Service and Posix Daemon Properties
    # Name of the service
    # Display name of the service
    wrapper.ntservice.displayname=WSO2 Carbon
    # Description of the service
    wrapper.ntservice.description=Carbon Kernel
    # Wrapper System Tray Properties
    # enable system tray
    wrapper.tray = true
    # TCP/IP port. If none is defined multicast discovery is used to find the port
    # Set the port in case multicast is not possible.
    wrapper.tray.port = 15002
    # Exit Code Properties
    # Restart on non zero exit code
    # Trigger actions on console output
    # On Exception show message in system tray
    # genConfig: further Properties generated by genConfig
    placeHolderSoGenPropsComeHere= = java = ${carbon_home}/bin/*.jar = ${carbon_home}/lib/commons-lang-*.jar = ${carbon_home}/lib/*.jar = org.wso2.carbon.bootstrap.Bootstrap = RUN = -Xbootclasspath/a:${carbon_home}/lib/xboot/*.jar = -Xms256m = -Xmx1024m = -XX:MaxPermSize=256m = -XX:+HeapDumpOnOutOfMemoryError = -XX:HeapDumpPath=${carbon_home}/repository/logs/heap-dump.hprof = = -Dcarbon.registry.root=\/ = -Dcarbon.home=${carbon_home} = -Dwso2.server.standalone=true = -Djava.command=${java_home}/bin/java =${carbon_home}/tmp = -Dcatalina.base=${carbon_home}/lib/tomcat = -Djava.util.logging.config.file=${carbon_home}/repository/conf/etc/ = -Dcarbon.config.dir.path=${carbon_home}/repository/conf = -Dcarbon.logs.path=${carbon_home}/repository/logs = -Dcomponents.repo=${carbon_home}/repository/components/plugins = -Dconf.location=${carbon_home}/repository/conf = -Dcom.atomikos.icatch.file=${carbon_home}/lib/ = -Dcom.atomikos.icatch.hide_init_file_path=true = -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true = -Dcom.sun.jndi.ldap.connect.pool.authentication=simple = -Dcom.sun.jndi.ldap.connect.pool.timeout=3000 = -Dorg.terracotta.quartz.skipUpdateCheck=true = -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false = -Dfile.encoding=UTF8 = -DworkerNode=false = -Dhttpclient.hostnameVerifier=DefaultAndLocalhost =${carbon_home}/repository/resources/conf

Setting up carbon_home

Extract the Carbon-based product that you want to run as a Windows service, and then set the Windows environment variable carbon_home to the extracted product directory location. For example, if you want to run WSO2 IS 5.11.0 as a Windows service, you would set carbon_home to the extracted wso2is-5.11.0 directory.

Edit System Variable window

Running the product in console mode

You will now verify that YAJSW is configured correctly for running the Carbon-based product as a Windows service.

  1. Open a Windows command prompt and go to the <YAJSW_HOME>/bat/ directory. For example:

    cd C:\Documents and Settings\yajsw_home\bat
  2. Start the wrapper in console mode using the following command:


    If the configurations are set properly for YAJSW, you will see console output similar to the following. Now you can access the WSO2 management console from your web browser via https://localhost:9443/carbon.

    Console output

Working with the WSO2CARBON service

To install the Carbon-based product as a Windows service, execute the following command in the <YAJSW_HOME>/bat/ directory:


The console will display a message confirming that the WSO2CARBON service has been installed.

Service installation confirmation

To start the service, execute the following command in the same console window:


The console will display a message confirming that the WSO2CARBON service has been started.

Service startup message

To stop the service, execute the following command in the same console window:


The console will display a message confirming that the WSO2CARBON service has been stopped.

Service stop message

To uninstall the service, execute the following command in the same console window:


The console will display a message confirming that the WSO2CARBON service has been removed.

Service removal message