How to setup Team City on Ubuntu Server

Reading Time: 4 minutes

Hello Readers! In this blog we will see how to setup Team City on Ubuntu Server. So, before moving towards its installation firstly we should know what Team City is. 

TeamCity by JetBrains is a continuous integration software designed to help DevOps teams perform automated tests and deploy applications, packages, and containers. So, let’s move towards its setup. 

1.Install Java

Team City is a Java Based application and therefore needs the JRE & JDK installed with the JAVA_HOME environment variable pointing to the Java installation directory.So,to install Java on your ubuntu server follow these steps:

# sudo apt-get install openjdk-11-jdk

and after that execute this command:

# exportJAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

# echo $JAVA_HOME

Now, check your Java Version

# java -version

2.Download & Install Team city

  Download the latest TeamCity for linux from Jetbrains

After the download completes unpack the file by following command:

3.Install and configure Database for TeamCity

TeamCity needs a Database in order to operate, it comes with an internal DB but only good enough for learning purposes. If you want to install teamcity for production capacity then you should have either MySQL, SQL Server, Oracle or PostgreSQL.

In order to install mysql server execute the following command:

Create a database for Team City:

Create teamcity user for this database:

Grant all privileges to teamcity user for teamcity database:

4.Start Team City Service:

Now go to the TeamCity/bin directory and execute following command:

By default, TeamCity runs on http://localhost:8111/ and has one registered build agent that runs on the same machine. If another application already uses this port, the TeamCity server will not start with the “Address already in use” errors in the server logs or server console.

5.Team City First Start:

Now on your http://localhost:8111/ it will show:

TeamCity comes with its own pre-configured database by default. However, it’s used for demonstration purposes. It’s a good idea to install and use a separate database. I’ll use MySQL. So, select MySQL from the “Select the database type” dropdown:

To connect to a MySQL server TeamCity requires a JDBC driver. Click on the “Download JDBC driver” button in order to install JDBC driver. Now add database details which were created earlier.

After that, click on Proceed. It will initialize the teamcity server component.

Read the license agreement from JetBrains, accept the agreement and proceed.

Create an Administrator account for login, give the User name and Password for this account.

After that you can create your own project:

That’s it. By now you should have a running teamcity server. If something goes wrong, be sure to check the logs which can be found at /var/TeamCity/logs.


So, In this blog we have seen how to set up a team city server on ubuntu and connect it to a database. Thanks for being with me till the end. If you find this blog helpful do share with your friends.


Written by 

Naincy Kumari is a DevOps Consultant at Knoldus Inc. She is always ready to learn new technologies and tools. She loves painting and dancing.