top of page

Hosting Production Server With Node-JS & . Mongo DB on A2 Hosting

Writer's picture: Rakesh KumarRakesh Kumar

Updated: Mar 4, 2019


Let's Do Hosting of Node Server with Mongo DB. Below Link will help you a lot

Step 1: Buy VPS hosting from https://www.a2hosting.com/ ( https://www.a2hosting.com/vps-hosting ).

Step 2: Configure Your DNS servers






As show in above screen shot. In first row under hostname enter your domain name like akaroinvoices.rocks and keep Record type already selected option A(address). In Address field enter your ip address without port number.

In second row under host name enter @ as shown in screen shot. In Record type select default A(address). In Address field type your IP address without port number.


3. Once DNS are configured and domain is mapped then login in SSH

-> On Mac Terminal->Shell-> New Remote Connection-> Then select "Secure Shell (ssh)"

-> Add your domain IP in right column

-> Pass your root username

-> Click Connect

-> Then enter your root user password

-> Now you are connected to your server shell



4. Install Node JS from terminal. Follow the below link:

https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04


5. Install Mongo-Db from terminal. Follow the below link:

https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/


6. Now you have both node js and mongo db on your server. You can run the mongo db by below commands:

mongod

mongo

and for node js

install nodemon by using command : sudo npm install -g nodemon

and run command: nodemon start

7. Now hit the url or IP of your server and you will see your node server working.


8. But for running the node js and mongodb in background we need to start services.

so for mongodb you start service by below command:

sudo service mongod start


9. To run node js service you need PM2. Follow the below link:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04


10. Run the command by navigating to your project folder:

pm2 stop app.js and your production server ready.

15 views0 comments

Recent Posts

See All

Comentarios


Call

Mob: 9972946755

 

Contact:

akarotech@gmail.com

Bengaluru, Karnataka

India

 

  • facebook-square
  • twitter-bird2-square

Follow Us

 

© 2019 by Akaro Technologies (Quality Values Our Work)

bottom of page