How to Deploy MEAN stack to my hosted server?
Another good starting point would be Digital Ocean, they offer a one click install MEAN stack, with tutorials. https://www.digitalocean.com/community/tutorials/how-to-use-the-mean-one-click-install-image
I have just deployed my MEAN Stack application
on Heroku cloud application
environment. The deployment steps are easy.
Steps to deploy:
- Your mean stack project structure should be like this.
This is very important step. The bottonline is your package.json and server.js should be under your root directory. Have a look at the link to know more about the structure.
- Clone your remote repository locally i.e.
git clone https://github.com/heroku/node-js-getting-started.git
- Go inside the cloned repository e.g.
cd node-js-getting-started
- Run
git add .
- Run
git commit -m "Sample"
- Run
Heroku login
(It will ask you to press any key and then open up the browser and ask you to click login. After logged in closed the browser instance. - Run
heroku create myApp --buildpack heroku/nodejs
.Note: Buildpacks are responsible for transforming deployed code into a slug, which can then be executed on a dyno
. More information - Run
git push heroku master
. Your deplyment will start. - Once deployment is done, you will see the complete deployment logs on command prompt terminal
The application is now deployed. Ensure that at least one instance of the app is running:
heroku ps:scale web=1
Run
heroku open
. It will run your deployed instance.Run
heroku logs
to view information about your running app. More information
You can find more details visiting following links:
https://devcenter.heroku.com/articles/getting-started-with-nodejs#prepare-the-app https://devcenter.heroku.com/articles/deploying-nodejs
Start from here... https://github.com/linnovate/mean#hosting-mean What operating system do you plan to host it on?