# Install on Amazon EC2

## Overview

This page describes how to create an Aerospike Community Database as an Amazon Machine Image (AMI)

Use this information for development with in-memory storage only. For deployment planning for AWS, see the Aerospike [Capacity Planning](https://aerospike.com/docs/database/8.1.0/manage/planning/capacity) documentation.

## Get the Aerospike AMI

You can either use the Aerospike Enterprise Edition AMI on the AWS Marketplace or prepare your own AMI.

### Aerospike on AWS Marketplace

1.  In your browser, go to [Aerospike Database on AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-t7thoecdg4kdg).
    
2.  Click **Continue** on that page. You are taken to the **Launch on EC2** page.
    
3.  Click **Manual Launch** tab. Then click **Launch with EC2 console** for the region you want to use.
    

### Prepare your own AMI

1.  Launch an OS of your choice, then [install Aerospike](https://aerospike.com/docs/database/8.1.0/install/linux) according to the OS you’ve chosen. For best performance and compatibility, we recommend using Database 6.4.0 and later with Amazon Linux 2023.
    
2.  Optionally [install the Aerospike Monitoring Stack](https://aerospike.com/docs/database/observe/monitor/components).
    
3.  Set the Aerospike service to start on boot.
    
    -   RHEL: `chkconfig aerospike on; chkconfig amc on`
    -   Debian/Ubuntu: `update-rc.d aerospike defaults; update-rc.d amc defaults`
    -   SystemD: `systemctl enable aerospike; systemctl enable amc`
4.  After you’ve configured your [Namespace](https://aerospike.com/docs/database/8.1.0/manage/namespace) and other [configuration parameters](https://aerospike.com/docs/database/8.1.0/manage/database/as-config), [create your AMI](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html).
    

## Instance type

The instance type depends on your RAM requirements for data storage and desired throughput. Aerospike recommends the **r3.2xlarge** instance, which is suitable for many installations.

For more details about instance types, see [Amazon EC2 capacity planning](https://aerospike.com/docs/database/8.1.0/install/aws/plan).

## Virtual Private Cloud (Networking)

Aerospike recommends deploying to an Amazon VPC. For more information, see [How Amazon VPC works](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html).

## Security group

In your security group, open the following ports for Aerospike communication.

| Protocol | Port | Description |
| --- | --- | --- |
| TCP | 22 | SSH port for logging into the instance. |
| TCP | 3000-3003 | Aerospike ports for clients and other servers to communicate with this instance. |

## Launch

Launch your instance and `ssh` to it.

An in-memory test namespace is configured by default. To learn about adding storage devices, configuring a cluster, and tuning your configuration to your hardware, see [Configure Aerospike Database](https://aerospike.com/docs/database/8.1.0/manage/database/as-config).

## Start Aerospike

```plaintext
[ec2-user@ip-xxx-xx-x-xxx ~]$ sudo service aerospike start

Starting and checking aerospike: asd (pid 8166) is running...

                                                           [  OK  ]
```

## Clustering Aerospike

Multicast traffic is not permitted on AWS. You must form a cluster using Aerospike’s heartbeat protocols. For more information, see [Mesh (unicast) heartbeat](https://aerospike.com/docs/database/8.1.0/manage/network/heartbeat#mesh-unicast-heartbeat).

Connect to each instance using `ssh` and configure mesh networking on the private IP address for each node.

For more information, see [Aerospike on Amazon EC2](https://aerospike.com/docs/database/8.1.0/install/aws/best-practices).