Deploying a Meteor app to Galaxy - a step-by-step guide


#1

I just went through the process of deploying a Meteor app to Galaxy. It’s not super complicated, but there was a lot of jumping around between different help instructions and a few gotchas along the way. So, I created a step-by-step tutorial for anyone (especially less experience developers) who want to deploy to Galaxy.

http://coderchronicles.org/2016/03/15/deploying-a-meteor-app-to-galaxy/

Please take a look, and definitely let me know in the comments if I got something wrong.

-Anders


Why is deploying meteor apps so "hard"?
#2

Thanks for this!

It’s not super complicated

That’s why we love Galaxy. :slight_smile:

One question though — I noticed you only set up MONGO_URL in the galaxy settings. When I’ve used MUPX before it was a requirement to also set MONGO_OPLOG_URL. Do you know if this needs to be set up with Galaxy too?


#3

I did not include MONGO_OPLOG_URL for a couple reasons:

  • It’s not a requirement for deployment.
  • Mongolab’s free tier, the “Sandbox”, which I use in the tutorial, doesn’t include it.

However, I should probably mention something about this in the guide. Thanks for the feedback!


#4

Thank you for doing this. I wish it was around before I deployed to Galaxy. I think your tutorial is thorough, but if you feel so inclined, I’d add this to the “Your app URL” section (only because it involves more steps).

Where you say…

If you had a custom domain name, you would insert that here.

You could remove that, or change it to…

If you had a custom domain name, you would insert that here. Galaxy support will need to whitelist your app domain, and you will need to point your DNS to galaxy-ingress.meteor.com.

That way, newbies won’t think it’s as simple as just adding it to settings.json.


#5

@jaclynn - thx, updated! Though I did not include the mention of whitelisting, since as I understand it, that requirement no longer exists.


#6

Oh - good to know! Thanks for setting me straight.


#7

Fantastic. This should go straight into the Meteor Guide.

One question: does this line actually work?

DEPLOY_HOSTNAME=galaxy.meteor.com meteor deploy my-meteor-app.meteorapp.com --settings settings.json

Don’t you at least need a semi-colon before the start of ‘meteor deploy’? And isn’t the syntax for creating environment variables shell-specific?


#8

Brilliant. If it had been around about 2 hours earlier, you would have saved me a bit of time.

My conclusion was the same: It’s not complicated, it’s just poorly explained/documented.

+1 for the Guide.


#9

Anders - This is a great walkthrough guide! Thanks for putting this together and sharing with the community.

We’ll take this feedback and create a more comprehensive guide to deploying to Galaxy that we’ll make available in our materials.

For specific questions here:

Integrating with the Mongo Oplog is used for performance reasons. It’s not a blocking requirement when deploying to Galaxy.

On Windows the cmd terminal requires that DEPLOY_HOSTNAME be defined separately before executing meteor deploy. So the commands would look like this:
$ SET DEPLOY_HOSTNAME=galaxy.meteor.com
$ meteor deploy …


#10

@rohit2b - great to hear! And thanks for the additional pointer re. using Windows.
@timfletcher - added a note about the Mongo Oplog URL as well. Thanks again!


#11

Thanks very much for your Guide @andersr. I wish it existed sooner since I’m sure many of us (who wanted to support MDG with their paid hosting service), wasted a lot of time struggling with poor Galaxy instructions.

Here are a couple more points that may be helpful to others:

1. There is a Direct Link to Server Logs

if you have further troubles deploying your app, you can directly access your server logs at:

https://galaxy.meteor.com/app/myAppName.meteorapp.com/logs

2. Ensure mLab Credentials are R/W

Maybe it’s just me, but when I saw the mLab read-only setting for username and password, I thought that mLab was asking whether I wanted to deny any incoming web API requests to change the database login credentials, so I set it to true. It turns out that this setting must be for database documents, not the login credentials. Your excellent screenshots helped me realize that the read-only setting must be false (don’t check it). And now everything is working. Thanks again!


#12

Thanks for the additional info! I’ve updated the guide to include this.


#13

Great article @andersr, I’m serving my on galaxy now but I get a bad gateway error when I try opening the app in a browser, according to the galaxy page I need to configure my DNS records to point to galaxy. I’m totally lost at this stage, any help will be deeply appreciated. Thanks


#14

Are you using a custom domain? If so, you need to go to the DNS settings for that domain and create a CNAME record that points to galaxy-ingress.meteor.com


#15

I am trying to deploy to galaxy… . I made a subdomain “www” and added the galaxy-ingress.meteor.com CNAME in the DNS settings …but in my browser, when I go to the app url I get a 404 error saying there is no App registered.

In galaxy, I can see 1 container running with 25% ram being consumed with 0 client so the app is there…kinda lost …any pointers @andersr , @jaclynn

I am confused at the redirecting bit in the domain manager. I have two option :

or

which one should I choose?


#16

Hold on, Galaxy does have mongodb? do have to pay for another service, even after paying Galaxy for a server?


#17

Galaxy just offers app server hosting at the moment, no database. mLab have a free tier which many people use to start with.


#18

should i change my host ? I use 1&1.

Looks like they kinda forces you to choose either a redirect or webspace option by default


#19

In your galaxy settings.json file are you pointing to the “www” sub-domain?

It should look something like this:

{
  "galaxy.meteor.com": { 
    "env": { 
  	"ROOT_URL": "http://www.yourdomain.com/", 
  	...
    } 
  }
}




#20

I personally use name.com and that’s worked great. I tried 1&1 once and did not have a great experience.

However, if you are thinking of transferring, keep in mind that you have to wait 60 days after the initial registration or most recent transfer.