AEM Setup Part 4 : Installing AEM as a Windows Service

To start open the crx-quickstart\opt\helpers\instsrv.bat file in a text editor.

To prevent the process from forking into more than one process, increase the maximum heap size and the PermGen JVM parameters.

Locate the set jvm_options command and set the value as follows:

set jvm_options=-XX:MaxPermSize=256M;-Xmx1792m

If you are configuring on a 64-bit machine, replace all instances of prunsrv with one of the following commands, according to your operating system:

  • prunsrv_amd64
  • prunsrv_ia64

Open a terminal with admin priveledges and cd to crx-quickstart/opt/helpers

Run the following command, replace  AEM_Author with then name of your service.

instsrv.bat AEM_Author

I got the following error.

To fix this I opened instsrv.bat and modified the jvm_path to be correct as per my machine.
set jvm_path="%JAVA_HOME%\bin\server\jvm.dll"

I ran instsrv.bat AEM_Author again and it worked successfully.

Start your aem service from the terminal by running.

net start AEM_Author

Verify the service is running by typing 'net start' in the terminal.

Or  verify the service by going to the Services windows (services.msc from terminal).

You can  also see the sevice is running in task manager and if you navigate to http://localhost:4502 AEM will be started.

To uninstall a the service you can use the following command

instsrv.bat -uninstall AEM_Author