How to Deploy Apache AGE Docker Image on AWS

Apache AGE™ is a PostgreSQL extension that provides graph database functionality. Apache AGE provides graph data processing and analytics capability to all relational databases. This article will explore how to set up Amazon Web Services (AWS), deploy the Apache AGE Docker image, and query the PostgreSQL database running in the Docker container on Amazon Web Services (AWS).

Apache AGE™ is a PostgreSQL extension that provides graph database functionality. Apache AGE provides graph data processing and analytics capability to all relational databases. 

This article will explore how to set up Amazon Web Services (AWS), deploy the Apache AGE Docker image, and query the PostgreSQL database running in the Docker container on Amazon Web Services (AWS).

Prerequisites

  1. AWS Account: If you don’t already have one, sign up for an AWS account at Amazon Web Services.
  2. Docker: Install Docker on your local machine. You can download & install Docker from here.

Step 1: Set Up AWS Account

  1. Log in to AWS: Access the AWS Management Console using your AWS account credentials.
  2. Create an IAM User:
    1. Navigate to the IAM (Identity and Access Management) dashboard.
    2. Click on “Users” & then “Add user.”
    3. Provide a username and select “Programmatic access” to generate an access key and secret key for Docker authentication.

Step 2: Deploy Apache AGE Docker Image

  1. Open a terminal on your local machine.
  2. Pull the Apache AGE Docker image from Docker Hub:
  3. Run the Docker container locally to verify its functionality:
  4. Tag the Docker image with the Amazon Elastic Container Registry (ECR) repository URL:
  5. Authenticate Docker to the Amazon ECR:
  6. Push the Docker image to your Amazon ECR repository:

Step 3: Launch the Amazon EC2 Instance

  1. In the AWS Management Console, go to the EC2 Dashboard.
  2. Click “Launch Instance” and choose an Amazon Machine Image (AMI) of your choice.
  3. Configure the instance settings:
    • Choose an instance type.
    • Configure instance details and storage.
    • Add tags if necessary.
    • Configure security group rules to allow incoming traffic on port 5432 (PostgreSQL).
  4. Review the configurations and launch the instance.

Step 4: Deploy Docker Image on Amazon EC2

  1. SSH into your Amazon EC2 instance using the key pair associated with the instance:
  2. Install Docker on the EC2 instance:

  1. Pull and run the Apache AGE Docker image on the instance:

Step 5: Access & Query PostgreSQL Database

  1. Install the PostgreSQL client on the EC2 instance:
  2. Connect to the Postgres database running in the Docker container:

You are now connected to the PostgreSQL database. Execute SQL queries and interact with the database as needed.

Conclusion

By following this comprehensive guide, you have successfully set up an AWS account, deployed the Apache AGE Docker image on an Amazon EC2 instance, and accessed the PostgreSQL database within the Docker container. This setup provides a secure and scalable environment for your data encryption and storage needs.