Hostwinds Tutorials

Search results for:


Table of Contents


MEAN Stack Requirements
MEAN Stack Preparation
Install Git
Install MongoDB
Install Node.js
Installing Angular
Install MEAN Stack

Install MEAN Stack on a Cloud VPS

Tags: Cloud Servers,  VPS 

MEAN Stack Requirements
MEAN Stack Preparation
Install Git
Install MongoDB
Install Node.js
Installing Angular
Install MEAN Stack

MEAN Stack is a Javascript framework for assisting with developing websites and applications. MEAN is an acronym for the Javascript framework that stands for MongoDB (database), Express.js (software), Angular.js (web framework), and NodeJS (cross-platform backend environment.

These combinations of tools provide a fast and easy way to provide development needs. Additionally, MEAN resource utilization can be more rapid than other CRM frameworks as web pages typically do not require refreshing.

MEAN stacks use JSON providing a cost-effective, open-source framework with global support.

MEAN Stack Requirements

Although MEAN Stack can install on a Windows operating system, it typically runs on a Linux base. Many requirements to build a MEAN Stack solution are free and open-source to get started, but you will need a server with root access and required resources. We have included a brief description of some of the requirements you will need to get the MEAN stack up and running.

Git: You will need to use Git. This is the industry-standard version control system used predominantly by developers around the world. Git is an established, constantly maintained, open-source VCS initially developed by Linus Torvalds in 2005. Innumerable software development projects rely on Git for versioning. Commercial, open-source, corporate behemoths, and small-house development all run through Git.

Git has become an essential tool for developers and, more so, the industry standard. It works well on a wide range of operating systems and IDEs (Integrated Development Environments).

MongoDB: MongoDB is an open-source NoSQL-based database management program. An alternative to traditional databases, NoSQL databases work with larger or growing sets of distributed data and manages document-oriented information to store or retrieve information.

MongoDB supports various forms of data and is one of many nonrelational database technologies that rose to prominence in the mid-2000s under the NoSQL banner. MongoDB is customarily used in big data applications and processing jobs involving unconventional data that doesn't fit well in rigid relationship models. MongoDB architecture is comprised of collections and documents and eschews the use of tables and rows.

Mongo DB is excellent for queries, indexing, load balancing, aggregation, server-side JavaScript execution, and other features.

Node.js provides developers the ability to use JavaScript and write command-line tools and server-side scripting. This means running scripts server-side and producing dynamic web page content before the page is sent to the user's web browser. In this way, the content is reduced down for a quick load time and lessens the load a browser has to lift to produce a website.

Node.js is open-source, cross-platform, and runs on V8. Node.js represents a "JavaScript everywhere" development methodology and is the culmination of the goal to unify web application development around a single programming language instead of multiple languages rendering on the server-side and running client-side scripts.

Node.js is not a file name but a label for the product in its entirety. It is merely the name of the product. Node.js has an event-driven architecture capable of asynchronous I/O. These design choices aim to optimize throughput and scalability in web applications with many input/output operations and real-time Web applications (e.g., real-time communication programs and browser games).

Angular: Angular's development platform is built on TypeScript and as a platform, Angular includes:

  • Component-based frameworks for building scalable web applications.
  • A collection of well-integrated libraries that cover various features, including routing, forms management, client-server communication, and more.
  • A suite of developer tools to help you develop, build, test, and update your code.

Angular allows users to take advantage of a platform that can scale from small single-developer projects to enterprise-level applications. Angular is designed to make updating as straightforward as possible to take advantage of the latest improvements with minimum effort. In addition, the Angular ecosystem consists of a diverse group of over 1.7 million developers, library authors, and content creators.

MEAN Stack Preparation

Before installing Mean Stack, you will need to log into your server via SSH. Once there, follow the steps below to prepare your server.

Install Git

Step 1: Install Git

dnf install gcc make git -y

Install MongoDB

Step 1: Create MongoDB repo file

nano /etc/yum.repos.d/mongodb-org-4.4.repo

Step 2: Add the below entries to the file and save

[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc

Step 3: Check to make sure the file is created correctly.

cat /etc/yum.repos.d/mongodb-org-4.4.repo

Step 4: Install MongoDB.

dnf install -y mongodb-org-4.4.6 mongodb-org-server-4.4.6 mongodb-org-shell-4.4.6 mongodb-org-mongos-4.4.6 mongodb-org-tools-4.4.6

Step 5: Start the MongoDB daemon.

systemctl start mongod

Step 6: Show MongoDB daemon status

systemctl status mongod

Step 7: Enable mongod service on startup

systemctl status mongod

Install Node.js

Install Node.js by performing the following steps.

Step 1: Check for available Node.js modules

dnf module list nodejs

Step 2: Install the Node.js

dnf module install nodejs:14 -y

Step 3: Check the installed Node.js version

node -v

Step 4: Check the installed npm version

npm -v

Installing Angular

Step 1: Install the Angular cli

npm install -g @angular/cli

Install MEAN Stack

Now with the fundamental building blocks installed on your server, the remaining steps will finalize the installation to your server.

Step 1: Use to clone MEANcore

git clone https://github.com/mrdav30/MEANcore.git meancore
cd meancore
npm install

Step 2: Create file .env

nano .env

Add below entries to the file.

NODE_ENV='development'
PRODUCTION=false
DOMAIN=
DOMAIN_PATTERN=
HOST_SECURE=
PROXY=
APP_NAME='meancore'
APP_BASE_URL='/'
API_BASE_URL='api'
APP_DEFAULT_ROUTE='home'
IMAGE_UPLOAD_URL='/admin/upload'
TWITTER_HANDLE=
SESSION_SECRET='MEANCORE'
SESSION_KEY='meancore-key'
SESSION_COLLECTION='meancore-sessions'
GOOGLE_ANALYTICS_ID=''
GOOGLE_CLIENT_EMAIL=''
GOOGLE_PRIVATE_KEY=""
GOOGLE_VIEW_ID=
RECAPTCHA_SECRET_KEY=''
RECAPTCHA_SITE_KEY=''
MAILER_FROM='support@meancore.com'
MAILER_SERVICE_PROVIDER=
MAILER_HOST='smtp.ethereal.email'
MAILER_PORT=587
MAILER_USER="username"
MAILER_SECRET="pass"
MAILER_TEST=true

Step 3: Run Application

npm run start:dev

Step 4: Check to make sure the MEAN Stack install performed correctly in the browser by going to {yourip}:3000. Example, 192.168.1.1:3000.

Written by Hostwinds Team  /  July 30, 2021