First Deployment : Digital Ocean

I’m about to kick off my first Meteor deployment, and I’m hoping it will go very smoothly (I’ve been burned before by complex Rails and Python proxy server hosting configurations, but Meteor promises to solve all those sorts of issues for you, and I’m confident it will).

I’m going with Digital Ocean despite they’re lack of managed Meteor services because I’ve heard very good things about them and also because they’ve just launched a promo offering new users up to 4 months of free hosting (details below if you’re interested).

So I just wanted to ask a couple of questions before I start:

  • The Meteor docs deployment section says: [quote]The current release of Meteor has been tested with Node 0.10.36.[/quote]

  • This may be a dumb question, but I want to get it right the first try: do they mean Node versions up to 0.10.36, or to use that specific version?

  • I didn’t see any mention of a specific Mongo version in the docs, so the current stable release is ok - is that right?

For anyone who hasn’t heard, Koding.io (a cloud-based IDE with Meteor support) has a promo going on with Digital Ocean: Koding users or anyone who signs up with Koding can get up to 4 months of free hosting with Digital Ocean. It says up to 4 months because that assumes you choose the $5/month starter package. They actually give you a $20 hosting credit which you can apply to any of their packages, so for instance, if you went with their $10/month package (which I think comes with slightly more RAM), then of course you’d get 2 months free.

Anyway, I didn’t intend this post to be a Digital Ocean promo; I’m not affiliated with them in any way. I just saw their offer in my inbox and thought others might want to try it.

1 Like

Also, I didn’t notice anything in the forum FAQ about not posting commercial stuff (I assumed people who like Digital Ocean would want to know about a free hosting deal). But if posting any sort of business promotion is frowned upon, I’ll be glad to remove my post (again, I have no association with them)

If on the other hand no one minds, I’m going to move the promo details to a separate post in either the Deployment or Community category, so it won’t make this post so long to read.

You should use 0.10.36. Easy way is

npm install -g n
n use 0.10.36

Latest MongoDB works fine.

It’s perfectly nice to use Node (yes, on v0.10.36) and Mongo on its latest version at Digital Ocean.

Our production app is hosted there and we’re using meteor up to deploy. Besides, we use DO’s private networking feature to easily clusterize (meteorhacks:cluster) the app and separate it from Mongo.

Meteord is also nice if you like the docker layer.

Oh, you mean you can install npm without first having Node installed?

I should have been able to find that out without bugging you guys. I just assumed you had to have the core language installed before you could install its package manager, as in Python and Ruby.

I was going to try to find a ppa with whichever version you guys recommended, but that will make it even easier.

Speaking of repos, Ubuntu 15.04 has Node 0.10.25 in the native repo. But the later version is still a better choice, right?

Thank you

Oh sweet! It sounds like DO will scale well. And I thought the private networking feature might be useful for microservices also.

Thanks very much. I’m excited that I landed on DO now

Node comes with npm. But the n package just helps you switch node versions painlessly. So if your distro comes with 0.10.25, you can install that first, then run what I wrote in the other post :smile:

I see. So, you can do that even if the number of the Node version you install is lower than the Node version number you need?

Yes that’s correct. :slight_smile:

1 Like

npm install -g n n use 0.10.36

Ok, I followed your instructions, installed Node (latest version), then used the n package to install the version I want, 0.10.36.

Then I ran the last command, n use 0.10.36 - but it immediately dropped me in a Node shell.

Is that what’s supposed to happen? Can I just install mup now and deploy my Meteor app at this point?

You can type in node -v to see if your node version was changed successfully. If you want to just use mup, then pretty sure you just need node/npm installed. It’ll update your node version automatically for you.

I used the node -v version flag - it printed v 0.12.7.

However, I screwed up. I’ve also been referring to these instructions (because they were published very recently):

I overlooked the line that said “You should be installing this stuff on your development machine - not your server”.

So, I guess I’ll leave the n package on my DO server - that might be useful anyway. I have now installed Node.js and the n package on my OS X dev machine and am about to install mup and then follow the instructions on that link above and Arunoda’s official instructions for the mup tool.

1 Like

Update

Ok, when I ran the cmd npm install -g mup this is the output I got. Evidently, there’s a version conflict in one of the packages mup depends on, semver:

npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data requires semver@'2 || 3' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/semver,
npm WARN unmet dependency which is version 4.3.6

It sounds to me like mup requires semver at version 2 or 3, but npm installed version 4.3.6.

So, I checked npm’s documentation and found that you can specify a version to install of a specific package, by going:
npm install package@version_number, so I typed (I’ve been using sudo for all these commands)
sudo npm install semver@3

After I typed that, npm printed this:

sudo npm install semver@3
semver@3.0.1 node_modules/semver

But, it evidently STILL went and installed semver version 4.3.6, because I got the same output again (that is frustrating):

/usr/local/bin/mup -> /usr/local/lib/node_modules/mup/bin/mup
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-package-json/node_modules/normalize-package-data requires semver@'2 || 3' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/semver,
npm WARN unmet dependency which is version 4.3.6

Does anyone have any suggestions about how I can resolve this and get mup installed? Thanks

FYI I run 0.10.36 on dev machine as well. Reinstalling npm will probably fix the issue for you (make sure you reinstall as root).

1 Like

Ok, thanks. I’ll try that.

@arunoda

Hey Arunoda, this Meteor Up tool is very nice. Thanks for that, man. :grinning:

I have a question, regarding Ubuntu Server 15.04 (I neglected to mention I was planning to use Ubuntu 15.04 in my previous questions about deployment, so that’s my fault).

In this issue on Github, it’s recommended to use the mup2 branch for deploying on Ubuntu 15.04:

Is that still the recommended course of action? Will that work for Digital Ocean (I noted you said mup2 requires Docker support - I believe Digital Ocean has docker support on all of their “droplets,” but I’m not certain).

Finally, if I’ve already gone through the mup setup process with mup from the master branch, should I just stick with that?

Thanks!

Well, I ended up resetting my DO image to Ubuntu 14.04, and now I can see why Meteor Up is so awesome. I typed only 2 lines in the terminal on my dev machine, and my site was up and running! Woohoo

Here’s a link (it’s just the app from the DM book, tho - nothing earth-shattering):
http://thecalculus.tk/

So, for anyone running Ubuntu 15.04, it’s not quite that easy yet. Ubuntu’s conversion to Debian’s systemd init system caused some problems. But the new version of Meteor Up, when it’s released, will have Docker support, so that’s awesome too.

Thanks to everyone for giving me so much guidance.

Grats on getting your first deploy up!
It’s actually not that hard to get an app running on systemd. But Docker support is much nicer :slight_smile:

+1 for Docker. I’d also like to recommend Dokku. Wrote a quick guide for it here: http://maxmalm.se/blog/2015-06-12-digitalocean-dokku-meteor

@hellstad
@benjick

Thanks! Yeah, I’ve been meaning to get started with Docker. All I really know about it is that it uses Linux containers, is more lightweight than a VM, and makes it easy to deploy code that will run on any machine without a bunch of config-file hacking.

Of course, since it’s the new hotness, there are a billion articles and books about Docker. Was it hard to get started using it?

What would the two of you say is the best book, guide, or tutorial for getting started using Docker quickly?