# Getting the Source Code on EC2

To deploy MyCRT, you must obtain MyCRT's source code, install al of MyCRT's dependencies, and build the MyCRT project. MyCRT is still in active development - future developments of this project could be automated.

## 1: Launch an EC2 Instance

From the EC2 dashboard, click "Launch Instance".

![Launching an EC2 Instance](https://1572547363-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L9ux89_cZRZjByEyMgG%2F-LAQfrmuyFOSlUlnCXOU%2F-LAQixeZSfx8ktM1-tms%2FScreen%20Shot%202018-04-18%20at%207.27.49%20PM.png?alt=media\&token=454a868a-f7ab-423d-8464-db9c842fd8af)

Select "Ubuntu Server 16.04 LTS (HVM), SSD Volume Type", t2.micro, and click "Launch".

![Launching an EC2 Instance](https://1572547363-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L9ux89_cZRZjByEyMgG%2F-LAQfrmuyFOSlUlnCXOU%2F-LAQjMWu_nraBiIZgPCR%2FScreen%20Shot%202018-04-18%20at%207.30.23%20PM.png?alt=media\&token=f2445826-6426-4c48-9d4b-50bc5416f9a6)

Choose or create a key pair to use when logging into the instance. After a few minutes, your instance will be available for use. Use your key pair and instance public DNS or IP address to SSH in.

Modify your instance's security group to allow HTTP traffic from all sources.

## 2: Obtain the MyCRT source code

After SSH'ing in, run the following command to get the source code. Git should come pre-installed on the machine.

```bash
git clone https://github.com/CPSECapstone/LilBobbyTables-MyCRT.git mycrt
```

This will create a `mycrt` directory for the repository.&#x20;

![clone the repository](https://1572547363-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-L9ux89_cZRZjByEyMgG%2F-LAQfrmuyFOSlUlnCXOU%2F-LAQlSxkfHN345Ni_4p4%2FScreen%20Shot%202018-04-18%20at%207.39.55%20PM.png?alt=media\&token=a7a97356-5ceb-4114-9469-cff349f519af)

## 3: Install Dependencies

Running the MyCRT service will require that the following dependencies be installed.

### Update apt-get

```bash
sudo apt-get update
```

### MySQL Client

```bash
sudo apt-get install mysql-client
```

Running `mysql --version` should show `mysql  Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using  EditLine wrapper`

### Node and NPM

```bash
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -; sudo apt-get install -y nodejs
```

This will install both node and npm. `node --version` should show at least v8.11.1, and `npm --version` should show at least 5.6.0

### Ruby

```bash
sudo apt-get install ruby-full
```

### Sass

```bash
sudo apt-get install ruby-sass
```

### Chromedriver

```bash
sudo apt-get install chromium-chromedriver
sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/bin/chromedriver
```

## 4: Build MyCRT&#x20;

Now, we should be able to build MyCRT. This will ensure that everything has gone well so far!&#x20;

To build MyCRT, run the following:

```bash
cd mycrt
./scripts/npm_install.sh
```

This will take several minutes, and there should be no errors in the output.

**Next Step**

{% content-ref url="create-an-rds-instance" %}
[create-an-rds-instance](https://lilbobbytables.gitbook.io/mycrt-user-guide/installation/create-an-rds-instance)
{% endcontent-ref %}
