Google, a real option to deploy Meteor apps

At this moment this blog is deployed on a U$5 instance at Digital Ocean(at the end of this post, will not) and I’m using several packages here, including spiderable. The problem is that when Googlebot comes here trying to index this site, an 500 internal server error happens. Looking for answers I saw this post saying that this it is a memory issue.

Ok, I thought, I’ll increase my instance to see if this really solve my problem. Hmm, 1Gb U$10, let me see Scalin.go, 1Gb €28.82, is that rigImage 2015-06-05 at 4.23.13 PM.pnght?

I don’t know, I don’t care, I don’t want to pay anything, I just want to see if my problem is memory, let me see Google. Nice! 2 months of free trial and if I decide to stay there, a little machine with 1 processor and 1.7Gb will cost U$13.80. I’ll give it a chance, but obviously I’ll use a bigger machine during this trial period =] So let’s go.

 

Preparing the machine

Go to https://console.developers.google.com and create a new project, on the next screen, go to VM instances and wait while Google initialize the Compute Engine for your project, then click on Create instance button.

Image 2015-06-05 at 2.27.09 PM.png

On the next screen you can choose your Machine type (click here to compare Google instances) and (here to calculate how much it’ll cost). In my case I chose an n1-highmem-2, yes I know, 2 cores, I’m using Meteorhacks Cluster =]

Important: If you are planning to use mup like me, you need to use Ubuntu, preferably 14.xx ok?

Image 2015-06-05 at 2.41.18 PM.png

Ok! Next step is add our SSH keys.

I’m using my root key to make mup setup easier.

Go to Access & secutity tab and paste the content of your id_rsa.pub there.

Image 2015-06-05 at 2.54.02 PM.png

Now, go to the bottom and click on Create button and wait Google Create your VM instance.

Image 2015-06-05 at 3.00.04 PM.png

Ok, click on the name of your instance and look for External IP and Edit it, change from Ephemeral to New static IP address and click on Create.

Image 2015-06-05 at 3.02.47 PM.png

Ok, machine setup is done.

 

Preparing your application

If you don’t have mup (meteor up) installed yet, install.  

[code language=”shell”]
npm install -g mup
[/code]

Now go to your project and create the mup configuration file

[code language=”shell”]
mup init
[/code]

Open the mup configuration file and set it up with you own informations, you can see my own here

https://github.com/allandequeiroz/allandequeiroz/blob/master/mup.json

Now run mup setup to see the magic happening, meteor up will setup node, phantom, mongo and everything that you need to deploy your app!

Image 2015-06-05 at 3.42.43 PM.png

Now, the most expected moment, mup deploy

Image 2015-06-05 at 3.46.24 PM.png

After complete, just open your browser and digit your address eg “104.154.82.157 without 3000” and you’ll see your app!!

 

Conclusion

I’m not saying that Google is cheaper than Digital Ocean or that is easier to deploy as Scalin.go, I’m just saying that Google is a real and nice option to host Meteor apps. And about my problem with Googlebot, I don’t know yet but trying by myself, passing ?_escaped_fragment_= parameter in my urls, it seems that the problem disappeared. Let’s see what happens when Googlebot comes again =]

3 thoughts on “Google, a real option to deploy Meteor apps

  1. Thanks for this! I’ve managed to work my way through the same steps; despite being a newb I’m almost there. One thing that seem out of place form me though is the env config (presumably why my meteor site isn’t working properly with defaults). I’m curious about the MONGO_URL, MONGO_OPLOG_URL and DISABLE_WEBSOCKETS settings. How did you know to add these specifically? Thanks

Leave a Reply