Installing TeamCity on Ubuntu 16.04

Today I will spend some time trying to install TeamCity on Ubuntu 16.04 VPS.


wget https://download.jetbrains.com/teamcity/TeamCity-2018.2.3.tar.gz

First download TeamCity server file. Do not use the link above, instead get the latest link by navigating to
https://www.jetbrains.com/teamcity/download/download-thanks.html?platform=linux

Unzip (your filename will be different)


tar xvzf TeamCity-2018.2.3.tar.gz

Java is required to run TeamCity, to check what version is currently running


java -version

If you need to install Java like I did follow this website https://www.linode.com/docs/development/java/install-java-on-ubuntu-16-04/

I’m going to use the default configuration and press the start button and see what happens. First I had to give myself permission to run the scripts


cd /TeamCity/bin
chmod 711 teamcity-server.bat
chmod 711 runAll.bat

And to run


./runAll.sh start

Now when I navigate to <URL>:8111 I see a TeamCity configuration page.

Setup Database

I chose to use MySql and for that all I had to do what create a database for TeamCity


mysql -u  -p
CREATE DATABASE teamcity;

If you get a JDBC driver missing error you will need to do the following:


sudo apt-get install libmysql-java
echo "# Set classpath for JDBC & MySQLCLASSPATH=\".:/usr/share/java/mysql.jar\"" >> /etc/environment

When I selected MySql it complained about not having a mysql jdbc driver. I had to create the following folders: ‘.BuildServer/lib/jdbc/’. Download mysql connector jar and copy to ‘.BuildServer/lib/jdbc/mysql-connector-java-<version>.jar’.

‘.BuildServer’ is the default data directory but you can set it to any path. Make sure it is secure!

And make sure you copy the jar to /TeamCity/lib/ as well (obviously).

When you have TeamCity server fired up, it will ask for a super token. You can find this by opening ‘TeamCity/logs/team-server.log. To search with vim press ‘?’ and type ‘Super user authentication token’ (obviously).

Voila! TeamCity is up and running

Leave a Comment