Install MEAN Stack Dev Environment on CentOS/Fedora/Red Hat

Exported on 28-Aug-2021 14:39:54

This installs following packages into the target system:

  • MongoDB
  • ExpressJS
  • AngularJS
  • NodeJS

Parameters

Name Type Script Reference Default Value Comment
s1 Linux / Unix Server s1
s1c Linux OS Credential s1c

1 - Update yum repositories

Update apt packages

The connection details have changed from the last step.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install APT update
sudo yum -y update

2 - Upload MongoDB Repo Configuration File

This adds the mongodb package to yum repository of the target system.

Login as user on node

Connect via SSH
ssh user@hostname
Deploy archive mongodb-org-4.4.repo.zip to remote path uploads
  1. Locate Files archive "mongodb-org-4.4.repo.zip", This can be downloaded from Attune
  2. Copy the Files archive to the server
  3. Extract the root of the Files archive to uploads, relative to the home directory
  4. Check that the files are in the correct location

3 - Install MongoDB

This installs MongoDB database server

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Move MongoDB repo file
sudo mv uploads/mongodb-org-4.4.repo /etc/yum.repos.d/mongodb-org-4.4.repo

# Install MongoDB

4 - Install NodeJS v12

This installs NodeJS server into the target machine

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Download setup script
sudo curl -fsSL https://rpm.nodesource.com/setup_12.x -o nodesource.sh

# Configure install script
sudo bash nodesource.sh

# Start installation 
sudo yum install -y nodejs

5 - Download MEAN.io Stack

Downloads MEAN Stack Packager From Git

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
git clone https://github.com/linnovate/mean

6 - Install Node Dependencies

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Change current working directory
cd mean

# Install Node Dependencies
npm i --force

# Create environment file
cp .env.example .env

7 - Install and Configure Screen

Installs and configures screen package to run the development server in background.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Install Screen 
sudo apt install -y screen && 

# Configure mean stack
sudo echo "zombie xy" >> ~/.screenrc

8 - Start Development Server

This starts the development server on port 4040 of the target machine.

Login as user on node

Connect via SSH
ssh user@hostname
This is a Bash Script make sure you run it with bash -l from a terminal session
# Start development server
cd ~/mean && screen -d -m npm start