Table of Contents
Step 1: Provision an AWS Instance
Step 2: Install Node.js
Step 3: Install MongoDB
Step 4: Install Express and Set Up Routes
Step 5: Access the Routes with AngularJS
Step 6: Run the App
Deploying a Web Book Register Application on an Ubuntu AWS EC2 instance using the MEAN stack (MongoDB, Express, Angular, Node.js) involves several steps. Here’s a step-by-step guide:
Step 1: Provision an AWS Instance
Launch an EC2 Instance:
Use the AWS Console to launch an Ubuntu Server (e.g., 22.04 LTS).
Choose an instance type (e.g., t2.micro for free tier).
Add certificates:
Install Node.js:
Step 3: Install MongoDB
Follow these steps to install MongoDB Community Edition using the apt package manager.
Install gnupg and curl if they are not already available:
Start and verify MongoDB.
You can start the mongod process and Verify that MongoDB has started successfully by issuing the following commands:
Install npm (Node Package Manager):
Note: I faced issues with installing the npm, so I used aptitude to Resolve Dependencies. If you face issues, you can try using aptitude (an alternative package manager) to handle the dependency resolution:
aptitude:
Install aptitude:
Initialize the npm project:
Create a file named server.js and add the following code:
Step 4: Install Express and Set Up Routes
Install Express and Mongoose:
Create a file named routes.js and add the following code:
Create a file named book.js and add the following code:
Step 5: Access the Routes with AngularJS
Change the directory back to Books:
Step 6: Run the App
Go back to the project root directory and run the following command:
Opening TCP port 3300 on AWS Web Console for your EC2 Instance to access it from the Internet.
Testing the Book Management Application:

SOCIAL SHARE CARD GENERATOR