Skip to content

How to install and run the Engine on AWS EC2

Gopal Saraf edited this page Apr 2, 2024 · 4 revisions

Step 1: Launch an EC2 instance

1.1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

1.2. From the console dashboard, choose Launch Instance.

1.3. The Choose an Amazon Machine Image (AMI) page displays a list of basic configurations, called Amazon Machine Images (AMIs), that serve as templates for your instance. Select an AMI, such as Amazon Linux 2 AMI.

1.4. On the Choose an Instance Type page, you can select the hardware configuration of your instance. Select the t2.micro type, which is selected by default.

1.5. Choose Review and Launch to let the wizard complete the other configuration settings for you.

1.6. On the Review Instance Launch page, under Security Groups, choose Edit security groups.

1.7. Add a rule to allow inbound traffic to your instance. The Engine uses port 2000. You can add a rule to allow inbound traffic to port 2000 from anywhere.

1.8. Connect to your instance. You can connect to your instance using the Amazon EC2 console.

Step 2: Install the prerequisites

2.1. Update the installed packages and package cache on your instance.

sudo yum update -y

2.2. Install the Git, Docker, Node.js, and npm packages.

sudo yum install git docker nodejs npm -y

2.3. Configure the Docker daemon and start Docker.

sudo service docker start
sudo chmod 777 /var/run/docker.sock

2.4. Install Docker Compose.

sudo curl -L --fail https://raw.githubusercontent.com/linuxserver/docker-docker-compose/master/run.sh -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Step 3: Install the Engine

3.1. Clone the Engine repository from GitHub.

git clone https://github.com/Code-Elevate/Engine

3.2. Change the directory to the Engine directory.

cd Engine

3.3. Start the Engine API using Docker Compose.

docker-compose up -d engine

3.4. Install dependencies for the Engine CLI.

cd cli
npm install

3.5. Install the required programming languages and tools.

./index.js ppman install dart gcc go java node perl php python rscript ruby rust sqlite3 swift typescript

Step 4: Access the Engine

4.1. Open a web browser and enter the public IP address of your EC2 instance followed by port 2000 (e.g., http://<public_ip>:2000) to access the API of the Engine.

4.2. You can now use the Engine to run and test your code in various programming languages and environments.