Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy meteorjs project to digital ocean?

How to deploy meteorJS project to Digital Ocean VPS? CentOS x64 - is good for it? Or I need to setup something else?

like image 283
Vladislav Avatar asked May 24 '13 10:05

Vladislav


2 Answers

It is a bit difficult, and if you are new to Meteor and Node.js it would properly be too much to grasp.

  1. You will first have to setup Node.js on your Digital Ocean VPS:

    How to install Node.js on Ubuntu
    https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
    
  2. Then you wil have to package your Meteor app: http://docs.meteor.com/#deploying

    meteor bundle myapp.tgz
    
  3. Then you would either install MongoDB on the VPS or sign up for MongoHQ

  4. Then you have to start the app:

    PORT=3000 MONGO_URL=mongodb://localhost:27017/myapp node bundle/main.js
    
like image 74
Kevin Simper Avatar answered Oct 27 '22 11:10

Kevin Simper


the meteor.sh script will help you providing setup and deploy commands. Anyway, the setup command was broken for me, so I installed everything with:

sudo apt-get install software-properties-common
sudo apt-get install python-software-properties python g++ make
add-apt-repository ppa:chris-lea/node.js
sudo apt-get update

sudo apt-get install nodejs
sudo apt-get install -y build-essential  
apt-get install mongodb
npm install -g forever

Then use meteor.sh deploy You'll have to check the meteor.sh file and find the lines where it patches the server.js file, since that file may change over time you have to make sure that the patch targets the right lines.

If the app is still broken, set these variables:

export APP_NAME=meteorapp
export ROOT_URL=http://yourdomain.com
export APP_DIR=/var/www/meteorapp
export MONGO_URL=mongodb://localhost:27017/meteorapp

This, more or less, worked for me with UBUNTU 32bit V12

like image 33
handmade Avatar answered Oct 27 '22 12:10

handmade