This repository contains instructions and resources for setting up NGROK with Magento2.
Before you begin, ensure you have an NGROK account. If not, sign up at ngrok.com.
Follow the platform-specific installation instructions provided in the NGROK Documentation.
NGROK offers the ability to create a one static domains for your projects (FREE). This allows for easier access to your tunnels. Follow the steps outlined in the NGROK Blog Post to set up a static domain for your NGROK account.
NGROK provides cloud edges for all users, enhancing performance and reliability. Learn how to utilize this feature in the NGROK Blog Post.
Ensure that you specify the port number correctly. Instead of using 9555, you have the option to use 8080 Magento NGINX config.
Run the following command (replace YOUR_EDGE_HASH and the port number of magento project):
ngrok tunnel --label edge=YOUR_EDGE_HASH http://localhost:9555
UPDATE `core_config_data` SET `value` = 'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/' WHERE `core_config_data`.`path` = 'web/unsecure/base_url';
UPDATE `core_config_data` SET `value` = 'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/' WHERE `core_config_data`.`path` = 'web/secure/base_url';
UPDATE `core_config_data` SET `value` = 'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/' WHERE `core_config_data`.`path` = 'web/unsecure/base_link_url';
UPDATE `core_config_data` SET `value` = 'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/' WHERE `core_config_data`.`path` = 'web/secure/base_link_url';
REPLACE to yours admin path.
INSERT INTO `core_config_data`(`scope`, `scope_id`, `path`, `value`)
VALUES(
'default', -- Or whatever your Scope is
0, -- Or whatever your Scope ID is
'admin/url/custom',
'https://YOUR-STATIC-URL-PROVIDED-FROM-NGROK.ngrok-free.app/magento_admin/'
);
php bin/magento setup:config:set --backend-frontname="magento_admin"
sudo rm -r pub/static/*/* && sudo rm -r var/view_preprocessed/* && bin/magento cache:f && bin/magento cache:c
bin/magento setup:upgrade && bin/magento setup:di:compile && bin/magento s:s:d -f
bin/magento indexer:reindex
- Open the edges and the your static app domain:
- Go to Request Headers and add the option with value
ngrok-skip-browser-warning true