Setup PWA (Linux os)
Step 1 : Install magento 2.3.1
Step 2 : Install/upgrade node
Use n module from npm in order to upgrade node
sudo npm install n -g
For the latest stable version:
sudo n stable
For the latest version:
sudo n latest
Step 3: Install/update yarn :
sudo npm install --global yarn
sudo npm upgrade --global yarn
Step 4 : Install node-gyp - Node.js native addon build tool
sudo npm install -g node-gyp
Step 5 : Clone the PWA Studio repository
Go to html root and run :
git clone https://github.com/magento/pwa-studio.git
After running this you will get pwa-studio folder
Step 6: Install PWA Studio dependencies
sudo yarn install
Step 7: Specify the Magento backend server
Under the packages/venia-concept directory, copy .env.dist into a new .env file:
Example command:
sudo cp packages/venia-concept/.env.dist packages/venia-concept/.env
change in .env file (this will be your magento URL, not admin url):
MAGENTO_BACKEND_URL="https://release-dev-231-npzdaky-zddsyhrdimyra.us-4.magentosite.cloud/"
Step 8: Now create a build
sudo yarn run build
Step 9: Run the server
sudo yarn run watch:venia
Starts the Venia storefront development environment only.
sudo yarn run watch:all
Runs the full PWA Studio developer experience, which include Venia hot-reloading and concurrent Buildpack/Peregrine rebuilds.
sudo yarn run build && yarn run stage:venia
Generates build artifacts and runs the staging environment, which uses more compressed assets and more closely reflects production.
Once you run one of the above command you will get the virtul url created by PWA.
NOTE: if you are rood user then use sudo.
Follow Magento 2 officical dev docs:
https://devdocs.magento.com/guides/v2.3/pwa/
Best Answer
For more reference
1. Enter the following command in DIR /var/www/html/ (m230 is my Magento 2.3 directory):
2. Install Magento by Command Line:
3. Create base pwa theme which will be the parent them for [PWA Venia theme.][25]
4. Create directory
app/design/frontend/Magento/pwa
and copy all files and directories of base theme here.Let's check base theme is available or not.
Run: php bin/magento setup:upgrade
And navigate to your Magento Admin->Content->Themes
5. Download PWA studio project.
6. Navigate to your Magento installation’s root directory and create a Pwa symlink folder linking to the project’s module directory(pwa-studio/packages/pwa-module).
from this directory i run my command - /var/www/html/m230
This is a directory where my pwa downloaded source is /var/www/html/PWA/
7. Link theme directory as well.Navigate to your Magento installation’s root directory and create a Pwa symlink folder linking to the project’s module directory(pwa-studio/packages/venia-concept).
8. Now navigate to your pwa-studio project’s venia-concept directory, copy
.env.dist
into a new.env
file and update the variables with the URL to your Magento development store.9. Install venia theme and Pwa Module:
we can see the venia theme is installed successfully.
10. Configure venia theme from
admin->Content->Configuration
11. Navigate to path (
/var/www/html/PWA/pwa-studio
) run:or
12. And Finally Navigate to
/var/www/html/PWA/pwa-studio/packages/venia-concept