How to install Team City 10.x on ubuntu 16.X
In any software development project a Continuous Integration / Continuous Deployment DevOps environment is essential. A recent project I elected to make use of Team City & Octopus Deploy all on an Azure stack.
In this post I twill detail the steps on how to install and configure Team City 10.x on a Ubuntu 16.X server.
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. I am installing on a fresh install of ubuntu 16.X and Java is not installed by default.
In order to Install Java we will need to SSH on to the box and install Java Via via apt.
To install Java on your ubuntu server follow these steps
- Open a Terminal window , in my case from a ubuntu box
CTRL+ ALT+ T
- Add a reference to the Oracle PPA then update your package repository
12sudo add-apt-repository ppa:webupd8team/javasudo apt-get update
- Install Oracle JDK 8
1sudo apt-get install oracle-java8-installer
- Check your Java Version
123java version "1.8.0_121"Java(TM) SE Runtime Environment (build 1.8.0_121-b13)Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Install Database software
Team City is able to store TeamCity stores build history, users, build results and some run time data to a number of Relation Database Management Systems (RDBMS) including
- Postrgre SQL
- MS SQL
- Default Internal DB
In my particular case I make use of Postgres SQL, Install Postgres SQL on ubuntu
Download & Install Team city
Download the latest TeamCity for linux from Jetbrains
## At the time of writing this article the latest version was 10.0.4
After the download completes unpack the file
tar -xzf TeamCity-10.0.4.tar.gz
We will install TeamCity to the
opt so we need to move the TeamCity Dirctory to
/opt/ and set permissions to the user running the TeamCity Applicaiton.
sudo mkdir /opt/JetBrains
sudo mv TeamCity /opt/JetBrains/TeamCity
sudo chown -R $user /opt/JetBrains/TeamCity # Insert Username for $User
Configure TeamCity to start automatically with the correct use by creating a script to start and stop TeamCity. We’ll create a simple bash script using the
nano text editor
sudo nano /etc/init.d/teamcity
If you are going to running the team city service under username other than the one you are currently installing it with then you will need to replace
$user in the code snippet with that username.
Copy and paste the following code into the editor.
### BEGIN INIT INFO
# Provides: TeamCity autostart
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start teamcity daemon at boot time
# Description: Enable service provided by daemon.
# /etc/init.d/teamcity - startup script for teamcity
### END INIT INFO
# Ensure you enter the right user name that TeamCity will run under
case $1 in
start-stop-daemon --start -c $USER --exec /opt/JetBrains/TeamCity/bin/runAll.sh start
start-stop-daemon --start -c $USER --exec /opt/JetBrains/TeamCity/bin/runAll.sh stop
sudo chmod +x /etc/init.d/teamcity
sudo update-rc.d teamcity defaults
Download database driver
The database drivers are usually not included in the TeamCity set up files. We will need to download the PostGres Driver seperately and place them in the
Change into the directory
Download the driver
We are now ready to start Team City and begin the configuratio in the Team City UI
sudo /etc/init.d/teamcity start
http://[Server name or IP]:8111 and verify that you see “TeamCity First Start” page.
Congratulations TeamCity is installed continue the steps on the web page to configure it.
Team City is a vary easy to use to and configure CI/CD (Continuous Integration/Continuous Deployment) platform. A Freemium license for up to 20 build configurations and 3 free Build Agent licenses is available.
It is possible to use Team City to build Microsoft .net core applications on a Linux Server and all that is required is the basic configuration. Once the basic configuration is complete you can move on to either configuring a Windows Build Agent or Configure Ubuntu headless server 16.x as TeamCity Build Agent to use Cake
A unique background as business owner, marketing, software development and business development ensures that he can offer the optimum business consultancy services across a wide spectrum of business challenges.
Latest posts by Gary Woodfine (see all)
- C# Tuples - June 11, 2017
- C#Local Functions - May 21, 2017
- Using AutoMapper in Domain Objects with DotNet Core - April 24, 2017