TeamCity
 
You are viewing the documentation for an earlier version of TeamCity.

Installation

Last modified: 20 April 2023

Installation and Configuration



In this section:

Downloading TeamCity



TeamCity installation package is available at http://www.jetbrains.com/teamcity/download/index.html

Download one of the three available installation packages:

Installing TeamCity server



Having obtained the TeamCity installation package, proceed with installing the build server for:

Installing TeamCity via executable file (Windows only)



For the Windows platform, run the executable file and follow the installation instructions. You have options to install TeamCity web server and one build agent that can be run as Windows services.

Installing TeamCity bundled with Tomcat servlet container



Unpack TeamCity<version number>.tar.gz archive (for example, using tar xfz TeamCity<version number>.tar.gz command).

Start TeamCity server:



  1. Go to TeamCity/bin directory

  2. Launch the following command:

    • sh runAll.sh start command for Linux and MacOS X

    • runAll.bat for Windows.

As a result, TeamCity runs on http://localhost:8111/ and has one registered build agent that runs on the same computer.

Stop TeamCity server and agent:



  • Launch sh runAll.sh stop command on Linux and MacOS X

  • Press Ctrl+C in the runAll.bat console for Windows.

Installing TeamCity into existing J2EE container



  1. Copy the downloaded TeamCity<version number>.war file into the web applications directory of your J2EE container under teamCity.war name.

  2. Restart the server or deploy the application via servlet container administration interface and access http://server/teamCity/.

Installing and running additional Build Agents



Before you can start customizing projects and creating build configurations, you need to configure Basic Concepts.

To install a build agent, follow these general steps:



  1. Open Agents tab

  2. Click Install Build Agents link

  3. In the Install Build Agents dialog, choose one of the available installation options:

  4. Enable the agent, if it connects to the server for the first time. To do that, open Agents page, select the desired agent in the list, and click Enable agent link.

    note

    Until enabled, agents will not run builds. Agents running on the same computer as the server are enabled by default.

Installing Build Agents via Java Web Start



  1. Make sure JDK 1.5+ is installed on the computer.

  2. On the agent computer, set up JAVA_HOME environment variable to point to JDK 1.5+ installation directory.

  3. Navigate to the Agents page in TeamCity web UI.

  4. Click the "Install Build Agents" link and then click "Via Java Web Start".

  5. Follow the instructions.

    tip

    You can install build agent Windows service as part of installation process or buildAgentsWindowsService.

Installing Build Agents via MS Windows installer



Just follow the installation instructions to install additional build agents.

Installing Build Agents via zip file



  1. Unzip the downloaded file into the desired directory.

  2. Make sure that you have a JDK or JRE installed (You will need JDK (not JRE) for some build runners like IPR runner, Inspections, Duplicates). Please ensure there are JRE_HOME or JAVA_HOME environment variables set (pointing to the installed JRE or JDK directory respectively) for the shell in which agent will be started.

  3. Navigate to the <installation path>\conf directory, locate the file called buildAgent.dist.properties and rename it to buildAgent.properties.

  4. Edit the buildAgent.properties file and change the desired properties of the installed build agent:

    • serverUrl - URL of the TeamCity server.

    • name - name of the build agent that will be visible in the web UI.

    • ownPort - port number that agent use to accept connections from server. Please make sure there is no firewall blocking incoming connections to the port.

    • ownAddress - the IP address of the computer running build agent. Required only if automatic detection fails.

  5. Under Linux, you may need to set execute permission for bin/agent.sh shell script.

Starting the Build Agent



To start the agent manually, run the following script:

  • for Windows: <installation path>\bin\agent.bat

  • for Linux and MacOS X: <installation path>\bin\agent.sh

    note

    When running build agent on MacOS X, and you're going to run Inspection builds, you may need to use StartupItemContext utility:

    sudo /usr/libexec/StartupItemContext agent.sh start

Installing and running Build Agent as a Windows service



On Windows, you may want to use build agent Windows service to allow the build agent to run without any user logged on.

To install the service:



  1. Make sure there is no TeamCity Build Agent Service <build number> or agentd service already installed.

  2. Run the <agent>/bin/service.install.bat file.

To start the service:



  • Run <agent>/bin/service.start.bat

To stop the service:



  • Run <agent>/bin/service.stop.bat

The new service wrapper allows to change agent JVM parameters via standard way of Java Service Wrapper library. The configuration is located at <agent>\launcher\conf\wrapper.conf

Configuring TeamCity server



Configuring TeamCity data directory



By default, TeamCity data directory, is $HOME/.BuildServer. Alternatively, you can define this directory in one of the following ways:

  • as a Tomcat system property teamcity.data.path

  • in the TEAMCITY_DATA_PATH environment variable

Setting up MySQL database



  1. Run TeamCity with the default settings to create TeamCity data directory.

  2. Shutdown TeamCity server.

  3. Download MySQL JDBC driver from: http://dev.mysql.com/downloads/connector/j/

  4. Put MySQL connector jar to the WEB-INF/lib of TeamCity web application

  5. Create empty database for TeamCity in MySQL and grant permissions to modify this database to a user from which TeamCity will work with this database. Consult Configuring UTF8 Character Set for MySQL document for more details on how to create database with unicode support.

  6. In the TeamCity data directory rename database.mysql.properties file to database.properties and specify the required settings in this file: connectionUrl=jdbc:mysql://<host>/<database name> connectionProperties.user=<user> connectionProperties.password=<password>

  7. Start server.

Edit server configuration