> For the complete documentation index, see [llms.txt](https://docs.enclaive.cloud/virtual-hsm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enclaive.cloud/virtual-hsm/integrations/install-vhsm-on-aws.md).

# Install vHSM on AWS

### Prerequisites

* To install vHSM you need an enterprise licence. Contact [support](https://www.enclaive.io/contact) to get an enterprise licence.
* To install vHSM as a production server you need to create a \`config.json\` file. For more information, see [Configuration.](/virtual-hsm/documentation/setup/configuration/server.md)
* [Create a EC2 instance](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html#ec2-launch-instance) and ensure that the **Instance type** is one of these [supported configurations](https://docs.enclaive.cloud/virtual-hsm/documentation/supported-cloud-configurations).
* Ensure your EC2 instance has proper [IAM permissions](https://docs.aws.amazon.com/AmazonECR/latest/userguide/ECR_on_ECS.html) to pull images from ECR.
* Make sure your EC2 instance's security group allows communication on the required ports.
* Depending on your setup, you may need to expose specific ports for accessing services within the container.

#### Installing vHSM using AWS marketplace&#x20;

You can deploy vHSM on Amazon Web Services (AWS) with the official enclaive [AWS Marketplace offering of ](https://aws.amazon.com/marketplace/seller-profile?id=seller-b4ok4zf2he3vw)vHSM.

To install and run the `vhsm-aws` container from Amazon ECR on your EC2 instance, follow these steps:

1\. Connect to your EC2 instance.

Install and configure Docker on your EC2 instance.

```
sudo apt update
sudo apt install docker.io
```

2\. Install AWS CLI on your EC2 instance.

```
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
```

3\. Configure AWS credentials.

```
aws configure
```

where:

* **AWS Access Key ID**: (Get from your AWS IAM)
* **AWS Secret Access Key**: (Get from your AWS IAM)
* **Default region name**: us-east-1 (or the region you are using)
* **Default output format**: Leave it as None

4\. Authenticate Docker to Amazon ECR registry where the vhsm container image is stored.

```
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 709825985650.dkr.ecr.us-east-1.amazonaws.com
```

5\. Pull the `vhsm-aws` image from ECR.

For example, to pull the image tagged as `1.4.1-0`:

```
docker pull 709825985650.dkr.ecr.us-east-1.amazonaws.com/enclaive/vhsm:1.4.1-0
```
