2

I have successfully installed PWA-studio with Magento 2.3. But I am not able to run it on production mode on a Ubuntu 18.04 LTS server so that we can access the PWA remotely but I am always able to start the application in development mode which only accessible locally.

How I can configure my server as well as the PWA-studio so that we can access the application remotely?

3

1 Answer 1

2
  1. git clone https://github.com/magento-research/pwa-studio.git
  2. cd pwa-studio
  3. npm install
  4. cp packages/venia-concept/.env.dist packages/venia-concept/.env
  5. edit and change MAGENTO_BACKEND_URL in packages/venia-concept/.env
  6. In pwa-studio folder run: npm run build && NODE_ENV=production PORT=8000 npm run stage:venia

It will start the server on port 8000.

I used PM2 to manage node services.

(cd packages/venia-concept/ && NODE_ENV=production PORT=8000 node server.js)

Then I made Nginx proxy to pass connection from 8000 to 80 and 443

Hope it helps.

3
  • Can you update your answer with the Nginx configuration so that it will be helpful? Commented Jan 15, 2019 at 4:56
  • When I used this command I getting below as output after the build has been completed. Using environment variables from .env Launching staging server... NODE_ENV=production and no PORT set. Binding to localhost with random port 0.0.0.0:35210 UPWARD Server listening in production mode. GET / 200 357.467 ms - 2186 Commented Jan 15, 2019 at 9:59
  • 1
    PWA studio docs state that yarn run stage:venia: "Generates build artifacts and runs the staging environment, which uses more compressed assets and more closely reflects production." That doesn't sound like the way to run in production, just something that more closely reflects real production setup. Would be nice to know what's a proper way to set it up for production use.
    – Qtax
    Commented Mar 22, 2019 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.