Install MEAN Stack Dev Environment On Ubuntu/Debian

Exported on 28-Aug-2021 14:44:46

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 APT 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 apt update

2 - Installs Node Package Manager

Installs NPM (Node Package Manager) for dependency management

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 npm
sudo apt -y install npm

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
# Install MongoDB
sudo apt install -y mongodb

4 - Install NodeJS v16

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
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -

# Start installation 
sudo apt-get 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