Has anybody installed mern.io stack successfully on DO

April 10, 2018 94 views
MEAN Debian

I would like to know if anybody has installed and used https://github.com/Hashnode/mern-starter on Digital Ocean. If there are any tutorials it would be great.

If not I will set it up and write a tutorial at a later stage :P

1 Answer

I saw your question this morning and decided to go ahead and install mern.io on a droplet so I could put together a simple guide.

The one roadblock I encountered is that the MongoDB installation instructions linked to by the mern.io github readme are out of date and do not support versions of Ubuntu newer than 14.04. This was easily corrected by using the details from our MongoDB on Ubuntu 16.04 tutorial.

I tested these steps this morning and was able to successfully get the mern.io demo app running.

Install MongoDB

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927;
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list;
sudo apt-get update;
sudo apt-get install -y mongodb-org;
sudo systemctl enable mongod;

Now start MongoDB

sudo systemctl start mongod;

Install npm / Node from NodeSource*

cd ~;
curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh;
sudo bash nodesource_setup.sh;
sudo apt-get update;
sudo apt-get install -y nodejs;

Make sure we have npm3 as required by MERN

npm install -g npm3;

Install MERN

npm install -g mern-cli;
mern init your_new_app;
cd your_new_app;
npm install;
npm start;

You should now have your environment ready to go. Available commands and more information can be found here

MongoDB is a free and open-source NoSQL document database used commonly in modern web applications. This tutorial will help you set up MongoDB on your server for a production application environment.
Have another answer? Share your knowledge.