Tuesday, 4 December 2012

How to setup Deployd on Ubuntu server


Intro


So, you watched Deployd video (http://deployd.com/) and you're so impressed that you want to try it right away. Here is guide of how to setup Deployd on Ubuntu server.


NodeJS


Install NodeJs following this instructions (find instructions for Ubuntu):

https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager

Verify installation by typing "node" (you should get something like "v0.8.15") and "npm" (you should get something like "1.1.66").

There seem to be a bug in NodeJs and NPM. NPM by default installs global modules to "/usr/lib/node_modules/" and that path is not included in paths that NodeJs searches. You can check that by echoing NODE_PATH variable: echo $NODE_PATH. If "/usr/lib/node_modules/" is not present, you’ll need to add it: "export NODE_PATH=$NODE_PATH:/usr/lib/node_modules/"


MongoDb


Before installing Deployd, you’ll need to install MongoDb:

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

Configure MongoDb if you like by editing "/etc/mongodb.conf" file. You may want to change default port (remember port number, you'll need it later), bind IP to “localhost” (add line "bind_ip=localhost" anywhere) and uncomment "nohttpinterface = true" (remove "#").

Make sure "/var/lib/mongodb/" and "/var/log/mongodb.log" exist and have right privileges.

Kill process that runs "/usr/bin/mongod —config /etc/mongodb.conf" ("ps -ef", find PID, "kill -9 " with PID appended)

Start MongoDb: mongod —fork —dbpath /var/lib/mongodb/ —smallfiles —logpath /var/log/mongodb.log —logappend —config /etc/mongodb.conf


Forever


Forever is NodeJs module that we will use for continuous Deployd running.

To install Forever type: npm install forever -g


Deployd


Just type: npm install deployd -g

Verify installation by typing "dpd -V" (you should get "0.6.9" or something like that).


Deployd app


Make directory in which Deployd apps will be hosted. I used "/var/www/". Go to that directory and create "hello world" app:

dpd create hello-world

Go to that directory ("cd hello-world") and create "production.js" according to this: http://docs.deployd.com/docs/server/run-script.md

You’ll need to use your own MongoDb data (and credentials if you use them, otherwise just comment out that part).

After that, just fire up Forever:

forever start production.js

and go to:

www.yourserver.com:5000

You should see "Welcome to Deployd!".

Next, to login to Deployd dashboard, type "www.yourserver.com:5000/dashboard" in your browser. You should be prompt for authentification key.

To get key, in "hello-world" directory type:

dpd keygen

and

dpd showkey

you should now have key. Copy that key in the browser and login. You should see Deployd dashboard. Enjoy creating with Deployd!

http://docs.deployd.com/