Atlantic.Net Blog

How to Install MEAN.JS Stack on Debian 10

MEAN.JS is an open-source JavaScript framework used for developing web applications rapidly. It provides a set of tools including MongoDB, Express, Angular, and Node.js for simplifying the development process. It uses a single programming language and can handle all aspects of an application.

In this guide, we will show you how to install MEAN.JS on Debian 10.

Step 1 – Install MongoDB

First, you will need to install the MongoDB database on your server. By default, MongoDB is not included in the Debian 10 default repository, so you will need to add the MongoDB repository to your server.

First, install all the required dependencies with the following command:

apt-get install dirmngr gnupg apt-transport-https software-properties-common ca-certificates curl -y

Next, add the GPG key and MongoDB repository with the following command:

curl -fsSL https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -
add-apt-repository 'deb https://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main'

Next, update the repository and install MongoDB with the following command:

apt-get update -y
apt-get install mongodb-org -y

After installing MongoDB, start the MongoDB service and enable it to start at system reboot:

systemctl start mongod.service
systemctl enable mongod.service

Step 2 – Install Node.js

Next, you will need to install Node.js on your server.

First, install the necessary dependencies using the following command.

apt-get install -y ca-certificates curl gnupg

Next, download the Node.js GPG key.

mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

Next, add the NodeSource repo to the APT source list.

echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list

Then, update the repository index and install the Ndoe.js with the following command.

apt update
apt-get install -y nodejs

Next, verify the Node.js version using the following command.

node -v

Output.

v18.19.0

Next, install the Yarn and Gulp package with the following command:

npm install -g yarn
npm install -g grunt-cli
npm install -g gulp

Once all the packages are installed, you can proceed to the next step.

Step 3 – Install MEAN.JS

First, download the latest version of MEAN from the Git repository using the following command:

git clone https://github.com/meanjs/mean.git meanjs

Once the download is completed, change the directory to the downloaded directory and install all required dependencies with the following command:

cd meanjs/
yarn install

Once all the dependencies are installed, you can proceed to the next step.

Step 4 – Launch MEAN.JS

At this point, MEAN.JS is installed on your server. You can now start the MEAN.JS with the following command:

npm start

You should see the following output:

MEAN.JS - Development Environment

Environment:     development
Server:          http://0.0.0.0:3000
Database:        mongodb://localhost/mean-dev
App version:     0.6.0
MEAN.JS version: 0.6.0

At this point, MEAN.JS is started and listen on port 3000.

Step 5 – Access MEAN.JS

Now, open your web browser and access the MEAN.JS web interface using the URL http://your-server-ip:3000. You should see the MEAN.JS web interface on the following screen:
MEAN Dashboard Page

Conclusion

Congratulations! You have successfully installed MEAN.JS on Debian 10. You can now start developing dynamic web applications using MEAN.JS; get started on dedicated server hosting from Atlantic.Net.

Get a $250 Credit and Access to Our Free Tier!

Free Tier includes:
G3.2GB Cloud VPS a Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year