How to install TeamCity as a Service on Windows

Today I have written a small note on how to install the Jetbrains TeamCity service on windows.

Installing TeamCity as a service on Windows

To install TeamCity as a service you will need to find the location of your TeamCity install. For me I have installed it under:

C:\Teamcity\

Once in this directory you should find the bin directory. THis holds a number of scripts which allow for modification of the server.

To install the service I am going to use the teamcity-server.bat script. This will allow you to create the Windows service along with performing other maintenance tasks on the server.

Using powershell, if you are in the bin directory, you can run the following command to install the service.

 .\teamcity-server.bat service install /runAsSystem 

Once this begins running it will print out the details of the service and how it is configured.

PS C:\TeamCity\bin> .\teamcity-server.bat service install /runAsSystem
 JetBrains JetService v1.1.755.777
 Parsing service settings
 Program to execute:   C:\WINDOWS\system32\cmd.exe
 Program arguments:    /c teamcity-server.bat run service
 Program work dir:     C:\TeamCity\bin
 Program stop timeout: 900000
 Service log file is set to: C:\TeamCity\logs\teamcity-winservice.log
 Installing service under LOCAL_SYSTEM account
 Service 'TeamCity' was created

 Use the following commands to start/stop the service:
   net.exe start TeamCity
     to start service 
   net.exe stop TeamCity
     to stop service 

 Service logs are in F:\TeamCity\bin..\logs\teamcity-winservice.log
 PS F:\TeamCity\bin> 

Once done TeamCity is installed and ready for use. As suggested TeamCity can be started with net.exe start TeamCity or you can use the services panel.

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.