Re: Hosting Application on AWS EC2

How can I deploy a custom app on AWS EC2 without using NGROK?

rooland980304
Shopify Partner
1 0 1

Hey everyone, I would like to ask for some suggestions and ideas. I am new to Shopify app development. I created a custom app, using node-express and react. I used the latest template from the docs. I created an embedded custom app. The main workflow I have is that an admin link takes the user from an order`s detail page in the Admin UI, to the custom app. Here thanks to the admin link I have the order id. I use the ID to get the customer`s email, and if the user clicks on one of my buttons, it will take them to my external site, and the external site`s URL will have the order ID and the email as query params, so that another workflow of mine can be used. I know this is not in the best practices in the docs, but I could use it anyway. My issue is I deployed the app on an AWS EC2 instance, in a docker container. I tried to use NGROK because as far as I understood the embedding doesn`t allow any other method to get the app rendered into the Shopify UI ?! I would like to ask if anyone had luck deploying a custom app to an EC2 instance, and if there is a way to not use NGROK and still deploy the app. EC2 is a must. I cant use Heroku etc. for hosting. Also it would be nice to get some clarification about NGROK, and how does the Shopify app use it.

Replies 5 (5)

gerz
Shopify Partner
1 0 1

Got the same question.

laliux
Shopify Partner
2 0 0

Same answer I wrote in the original post  🙂

laliux
Shopify Partner
2 0 0

I hope there is still time to answer.

- ngrook is not necessary at all.
- You need a valid domain name pointing to your EC2 instance, e.g. mycool.app.com

- You can install and configure nginx to manage that domain, and reverse proxy your Shopify app

- You need to configure the callback URLs in shopify app setup referring to such domain

pschaeffer
Shopify Partner
7 0 1

Since you seem to know something about this, I have a few questions. First question - what port should nginx reverse proxy too. Second question - what command should I use to start the Shopify (I am JavaScript) app (this really implies, what node command should I use)? Third question is what environmental variables need to be set and how should they be set? Fourth question, is what JavaScript programs will actually get run and when. Fifth question, is how should webhooks be supported.

sahanNeos
Shopify Partner
6 0 0

Hi did you get the answers for these?