DEV Community

Cover image for Teamcity + AWS
Guillermo Fernandez
Guillermo Fernandez

Posted on

Teamcity + AWS

In this article we will explain how to create an ec2 ubuntu instance with the Teamcity server installed.

To begin with in this case we will create an instance from an Ubuntu 20.0 image. However, you can take a look at other alternatives that Amazon provides for us here: here.

When we are creating this instance it's important to save the pem file, so that you can access the machine through ssh.

After we have created the instance we will go to security and use the Public IPv4 DNS, in order to create a CNAME record on your domain to access that machine.

  1. Access to the machine
> ssh -i "<file_name>.pem" ubuntu@ec2-ip-address.sa-east-1.compute.amazonaws.com
Enter fullscreen mode Exit fullscreen mode
  1. Install java 8 to install teamcity
> sudo apt-get update
> sudo apt-get install openjdk-8-jdk
Enter fullscreen mode Exit fullscreen mode
  1. Check the java version
> java -version
Enter fullscreen mode Exit fullscreen mode
  1. Download the Teamcity Server, in our case we downloaded the latest version: 2020-2
> sudo wget https://download-cf.jetbrains.com/teamcity/TeamCity-<version>.tar.gz
Enter fullscreen mode Exit fullscreen mode
> tar xfz TeamCity-<version>.tar.gz
Enter fullscreen mode Exit fullscreen mode
> sudo useradd teamcity
> sudo chown -R teamcity:teamcity TeamCity
Enter fullscreen mode Exit fullscreen mode

To change the server port, in the <TeamCityHome>/conf/server.xml file, change the port number in the not commented XML node (here the port number is 8111):

Now if you browse the IP address of your server using port 8111 you should see the TeamCity web interface.

Before creating the projects we need to create at least one build agent.

> cd Teamcity/buildAgent/build
> sudo sh install.sh localhost
Enter fullscreen mode Exit fullscreen mode

Finally we need to run our TeamCity Server with the following command line from: <TeamCityHome>/bin .

> sudo sh runAll.sh start
Enter fullscreen mode Exit fullscreen mode

We strongly recommend that you use docker instead of installing everything locally on this server, so that you can dockerize all your applications.

You can find more information about how to Install Docker Engine on Ubuntu, here: (https://docs.docker.com/engine/install/ubuntu/)

Moreover, in my previous post you can read about Dockerizing an angular app.
On this link: (https://dev.to/ollita7/dockerizing-an-angular-app-3nef)

Top comments (0)