Installing Terrene

This guide covers installing Terrene on your own infrastructure

This page is intended for those planning to self host Terrene. If already have a subscription to Terrene's cloud hosted version, please feel free to skip over this page.

Please note that this document is a work in progress and will be updated with more details on an on-going basis. If you have any questions, please feel free to reach out and we will be more than happy to guide you through installation steps. To acquire a license to access Terrene's git repositories, please contact us.

Installing Terrene

To get started, please install Docker CE, and Docker Compose. Terrene could run on any operating system that is supported by Docker.

Once you have installed Docker CE and Docker Compose, please authenticate to Terrene's docker organization. Once prompted for credentials, please use the git credentials given to your systems administrator.

docker login

Once authenticated to Terrene's docker registry, please clone the ee repository.

git clone https://github.com/terreneco/ee

Single Node Setup

Warning: single node setup is intended only for testing/development and should not be used in production.

docker-compose up

Running the above command will start Terrene and will expose the following ports:

  • 0.0.0.0:8002: Terrene's administrative UI for creating new tenants

  • 0.0.0.0:80 Terrene's REST API

  • 0.0.0.0:8080 Terrene's UI for interacting with Terrene's API

Please make sure all of the above ports are permitted to be accessed through your firewall if you intend to expose Terrene to others.

Multi Node Setup on AWS

cmd/deploy configure

Running the above command will prompt you to enter details about production environment such as AWS credentials. Please make sure the provided AWS credentials have full admin access to your account.

cmd/deploy provision-infrastructure

This will provision the servers, S3 buckets, load balancers, etc. according to the provided configuration from the previous command.

NOTE: This command currently can not provision SSL certificates so you'll have to create them manually on AWS for the domain names your provided in the previous step.

cmd/deploy generate-dot-env

Will generate an .env file for the application based on the deployed servers

cmd/deploy provision-database;
cmd/deploy provision-cache;
cmd/deploy provision-sandbox;
cmd/deploy provision-monitoring;

Will provision the database, redis, and code sandboxing servers as well as the monitoring services. This will also automatically setup 24 backups of the databases. If you need to make them more frequent, please modify the deploy/infrastructure/database.tf file.

module "ebs_bckup" {
source = "./ebs-backup"
EC2_INSTANCE_TAG = "database"
RETENTION_DAYS = 3
stack_prefix = "ebs_snapshot"
cron_expression = "45 1 * * ? *"
regions = ["${var.region}"]
}
cmd/deploy provision-workers;
cmd/deploy provision-application;

Will provision the worker and application servers. This will have to be run every time the code is updated, running other commands periodically are optional.