No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

How to install Teamcity on Ubuntu on an EC2 instance on AWS

First create an EC2 instance using an available Ubuntu Server image

SSH into your EC2 instance and follow the instructions

Install Teamcity

sudo wget -c -O
sudo sh
sudo rm -rf

Install postgres

sudo apt-get update
sudo apt-get install postgresql postgresql-contrib

# open the file and append the lines below
sudo nano /etc/postgresql/9.3/main/pg_hba.conf

# remote access (where x.x.x.x is your IP)
host all all x.x.x.x/32 md5

# servers (repeat this line per server)
host all all x.x.x.x/32 md5

# open the file and change the lines below
sudo nano /etc/postgresql/9.3/main/postgresql.conf
listen_addresses = '*'

# open the config file and change the config settings
sudo nano /etc/postgresql/9.3/main/postgresql.conf




# switch user to the postgres user
sudo su - postgres

# load the command line

# create the team city user
create role teamcity with login password '<password>';
create database teamcity owner teamcity;

Install Nginx

sudo wget -c -O
sudo sh
sudo rm -rf

#update nginx config
sudo nano /etc/nginx/sites-available/teamcity

#remove default nginx server
sudo rm -rf /etc/nginx/sites-enabled/default
sudo rm -rf /etc/nginx/sites-available/default

Start postgres, nginx and Teamcity

sudo /etc/init.d/postgresql start
sudo /etc/init.d/nginx start
sudo /etc/init.d/teamcity start

Bonus: Installing TeamCity plugins

More often than not, you would like to extend TeamCity's functionality with available plugins on the Internet.

We happen to have two requirements that needed such extensions:

  • run Grunt tasks on the build nodes, hence we needed to have a plugin that executes node, npm package manager and grunt commands.
  • deploy the artifacts using SSH to the DEV, UAT and PROD servers.

Details about the plugins are here:

We usually SSH to our TeamCity server from an Ubuntu desktop instance. While doing so, and keeping a copy of each plugin/zip file on your home directory, execute the following command to copy the files accross to TeamCity server:

sudo scp <remote-username>@<ip-address-server>:<.BuildServer/plugins-directory>
sudo scp <remote-username>@<ip-address-server>:<.BuildServer/plugins-directory>

Finally restart your Teamcity server :

sudo /etc/init.d/teamcity restart