Skip to main content

AWS ECS for EC2

This page provides steps to install Appsmith on a single node EC2 Linux + Networking ECS Cluster using an EC2 instance.

Prerequisites

  • Amazon Web Services (AWS) account. If you don't have one, Create an AWS Account.
  • An Amazon EC2 key pair. If you don't have one, Generate an SSH Key pair.
  • An Amazon Security group with ports 80, 443, and 22 accessible. If you don't have one, Create a Security Group
  • To enable port access, add an inbound rule for the port ranges 80, 443, and 22 to the security group you created above.
  • Switch to the Classic Amazon Web Console.
  • Ensure you have created the security group and the SSH key pair in the same region.

Install Appsmith

To deploy Appsmith on the Amazon ECS cluster that has a single node, you need to complete the below essential steps:

  1. If you have an EC2 Linux + Networking single node ECS Cluster that has the Number of Instances set to 1, move to create task and container definitions step. If you don't have one, follow these steps to create a single-node ECS Cluster:

    a. Go to Classic Amazon Web Console and click Clusters on the sidebar.

    Create Cluster using Classic Amazon Web Console
    Create Cluster using Classic Amazon Web Console

    b. Click the Create Cluster button.

    c. Choose EC2 Linux + Networking as the cluster template.

    d. Click the Next step button.

    e. Give a desired name to the Cluster name field.

    f. Configure the instance as shown below:

    AttributeValue
    Provisioning ModelOn-Demand Instance
    EC2 instance typeA minimum t3.medium or t3a.medium is needed
    Number of instances1
    EC2 AMI IDAmazon Linux2 AMI
    Key pairSelect the Key pair that you created in the Prerequisites step

    g. Scroll down to the Networking section, and configure as shown below:

    AttributeValue
    VPCEither create a new VPC or select an existing one from the dropdown
    SubnetsSelect the subnet that has public access
    Auto-assign public IPSelect Enabled from the dropdown
    Security groupSelect the security group that you created in the Prerequisites step

    h. Scroll down to the CloudWatch Container Insights section, and tick the Enable container insights checkbox.

    i. Click the Create button. You see a launch status screen as shown below:

    A launch status screen shows the ECS Cluster status
    A launch status screen shows the ECS Cluster status

    j. Click the View cluster button to see your cluster

  2. Follow these steps to create task and container definitions:

    a. Click Task Definitions from the sidebar.

    b. Click Create new Task Definition.

    c. Select EC2 as launch type compatibility.

    d. Click the Next step button.

    e. Configure task and container definitions as shown below:

    AttributeValue
    Task definition NameGive a desired name
    Task role-
    Task execution role-
    Task memory (MiB)Minimum 3 GB is needed
    Task CPU (unit)Minimum 1 virtual CPU is needed

    For other attributes, move ahead with the default selection.

    f. Scroll down to the Volumes section.

    g. Click Add volume button.

    h. Add volume as shown below:

    AttributeValue
    NameGive a desired name
    Volume typeBind Mount
    Source path/appsmith/stacks
    Attention

    The Bind Mount volume type creates a mount directory named /appsmith/stacks on the host EC2 instance. If you delete the cluster or the node, the Appsmith data is also lost.

    i. Click Add button.

    j. Scroll up to the Container definitions section.

    k. Click Add container button.

    l. Add container definition as shown below:

    AttributeValue
    Container nameGive a desired name
    Imagea. For Community Edition - appsmith/appsmith-ce for the
    b. For the Business Edition - appsmith/appsmith-ee
    Memory Limits (MiB)Give a desired value. Minimum 3000 is needed

    m. Scroll down to the Port mappings section.

    n. Add port 80 to the Host and Container port fields, and set the protocol as tcp.

    o. Click Add port mapping and add port 443 to the Host port and the Container port fields, and set the protocol as tcp.

    p. Scroll to the Storage and Logging section.

    q. Add the Mount points as shown below:

    AttributeValue
    Source volumeThe volume name that you added for Appsmith
    Container path/appsmith-stacks
    Log configurationCheck the Auto-configure CloudWatch Logs checkbox

    r. Scroll down to the

    s. Click Add button.

    t. Scroll down to the bottom of the page.

    u. Click Create button.

  3. Follow these steps to create and run an ECS service:

    a. Go to the cluster dashboard and click the name of the ECS cluster.

    b. Click Create under the Services tab.

    c. Configure service as shown below:

    AttributeValue
    Launch typeSelect EC2
    Task definitionSelect the task definition that you created
    Service nameGive a desired name
    Service typeSelect DAEMON

    For other attributes, move ahead with the default selection.

    d. Click the Next step button.

    e. Keep the default selection for the Configure Network page and click the Next step button.

    f. Click the Next step button on the Set Auto Scaling page.

    g. Review the details and click Create Service. You see a launch status screen as shown below:

    A launch status screen shows the ECS Service Status.
    A launch status screen shows the ECS Service Status
  4. Follow these steps to verify the Appsmith installation:

    a. Go to the Clusters section in the sidebar.

    b. Select the desired Cluster name.

    c. Open the Tasks tab.

    d. Choose the specific Task.

    e. Click the link next to the EC2 instance id.

    f. Click the Instance ID to access the Instance Summary page.

    g. Copy the Public IPv4 address from the Instance Summary page.

    Use DNS or Public IP to access Appsmith.
    Use DNS or Public IP to access Appsmith

    h. Paste it in a browser tab to access Appsmith.

Troubleshooting

Some common errors that you may face during installation:

If you continue to face issues, contact the support team using the chat widget at the bottom right of this page.

Further reading