apt-get install software-properties-common python-software-properties #for minimal ubuntu
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
sudo apt-get install git
sudo wget -c https://download.jetbrains.com/teamcity/TeamCity-9.1.7.tar.gz -O /tmp/TeamCity-9.1.7.tar.gz
sudo tar -xvf /tmp/TeamCity-9.1.7.tar.gz -C /opt
sudo rm -rf /tmp/TeamCity-9.1.7.tar.gz
sudo mkdir /opt/.BuildServer
sudo useradd -m teamcity
sudo chown -R teamcity /opt/TeamCity
sudo chown -R teamcity /opt/.BuildServer
Copy script to /etc/init.d/teamcity
sudo chmod 775 /etc/init.d/teamcity
sudo update-rc.d teamcity defaults
sudo mkdir -p /opt/.BuildServer/lib/jdbc
sudo mkdir -p /opt/.BuildServer/config
sudo wget https://jdbc.postgresql.org/download/postgresql-9.4.1208.jar -O /opt/.BuildServer/lib/jdbc/postgresql-9.4.1208.jar
Copy database.properties to /opt/.BuildServer/config/database.properties
sudo chown -R teamcity /opt/TeamCity
sudo chown -R teamcity /opt/.BuildServer
sudo apt-get install postgresql postgresql-contrib
sudo su - postgres
psql
create role teamcity with login password '<password>';
create database teamcity owner teamcity;
sudo /etc/init.d/postgresql restart
sudo nano /srv/.BuildServer/config/database.properties
Start it up:
sudo /etc/init.d/teamcity start