3 availability zones. Having fewer than 3 availability zones would prevent the use of high-availability setups, if
needed in the future.
## Instance Setup
:::note
It is recommended to use a VPC with IPv6 enabled for future usage expansion.
:::
### Create Security Groups for the Server and Load Balancer
1. Create a security group for the load balancer.
It is recommended to configure the security group to allow access, at first, only for a trusted IP address or a set
of trusted IP addresses, that will be used for the initial setup of the server.
* Ingress TCP ports: 80, 443 from trusted IP addresses.
* Egress: All addresses and ports.
1. Create a security group for the main server (`clearml-main`):
* Ingress:
* TCP port 10000, from the load balancer's security group
* TCP port 22 from trusted IP addresses.
* Egress: All addresses and ports
:::important
A company’s security policy may require filtering Egress traffic. However, at the initial stage, one should note that
some external repositories will be used to install software.
:::
### Create an IAM Role for the Server
To perform backups to S3, the instance will need a role that allows EC2 access (RW) to a backup bucket.
An example policy document with the above parameters is provided at `self_installed_policy.json`.
### Create Instance
Instance requirements:
1. The instance must be created in a VPC with at least two public subnets to allow for AWS load balancer setup.
2.`x86_64` based instance
3. [Amazon Linux 2 OS](https://aws.amazon.com/amazon-linux-2/?amazon-linux-whats-new.sort-by=item.additionalFields.postDateTime&amazon-linux-whats-new.sort-order=desc)
4. Disks:
1. Root disk: 50GB `gp3` disk, or one with higher volume/performance.
2. Data disk:
1. Used for databases (ElasticSearch and Mongo DB) in which meta-data and events are saved
2. Device: `/dev/sdf`
3. Recommended initial size: 100GB
4. Type: `gp3` or a higher random access performance one.
3. Fileserver disk:
1. Used for storing files such as debug images and models
2. Device: `/dev/sdg`
3. Recommended initial size: Should be estimated by users of the system.
4. Type: Depending on usage, but `gp3` or `st1` are usually the best options:
1. For a large amount of data, used by a small number of users/experiments, use `st1` (minimum `st1` disk size: 500GB).
2. For all other scenarios, use SSD disks (e.g. `gp3`).
3. The disk type can be changed after creation.
4. Very large number of users and/or experiments may require higher than the default `gp3` disk performance.
4. Docker data disk:
1. Used for Docker data.
2. Device: `/dev/sdh`
3. Recommended initial size: 30GB
4. Type: `gp3`
5. Use the `clearml-main` security group and the IAM role created in the previous step.
## Configuration and Software Deployment
### Install Dependencies
1. Copy the following files to `/home/ec2-user` directory on the server: