Showing results for 
Search instead for 
Did you mean: 

Backend not working in local environment

Backend not working in local environment



New to Magento 2 development here. I've gone through training and am now in the process of setting up my local environment using code from our Magento Cloud instance. I've fetched the code/installed Magento locally. I then tried to do a database dump from my Cloud environment to my local. I used that to overwrite my local machine's instance of magento database. After doing that, my backend will no longer work. The browser is giving me a generic "Unable to connect" page.


Please advise.


Re: Backend not working in local environment

Hello pj860a,


The backend administration isn't working is a common issue faced by the admins. However, It shows an "Unable to connect" page, and the backend stops working.


If you encounter the following issue, you can follow the steps below to resolve the issue,


Impact of installing or updating:


You might get an error message after installing a new extension, upgrading one, or applying Magento 2 core or an extension patch. 


  • You must flush the Magento 2 cache via the command line. Thus, Run the below commands,


php bin/magento cache:clean 
rm -rf var/cache/* 
rm -rf var/generation/* 
rm -rf generated/*

 The compilation hasn't been started:


It is essential to restart the compilation when a new extension is installed in production mode. If you forget it, the backend, as well as the frontend, won't work. To fix the issue, reset the production mode again via the below command line,


  • Firstly,  run the following command to check if the production mode is activated:
php bin/magento deploy:mode:show
  • Next, If the current application mode is production, then run the below command,
<strong>php bin/magento deploy:mode:set production</strong>
  • Lastly, reset everything from the start and set the mode once again.


An incorrect Admin URL:


It might happen if you are trying to access the backend with an incorrect URL. Using the command line, you can check the correct URL for the admin panel via the below command,

php bin/magento info:adminuri

The permission role isn't set correctly:


In order to fix the issue, reset the permission role of your administrator.


  • Firstly, navigate to Admin Panel Systems Permission > User Roles.
  • Then, select the role name that needs to be edited.
  • Now, switch to the 'Role Resources' menu.
  • Next, set the 'Resource Access' to All.
  • Lastly, after the settings get configured, save the role and clear the Magento 2 cache.


I hope the above solution helps you to solve the "Backend not working in local" issue. However, if the issue persists, you can update it here. 




Rex M

VPS Hosting | Magento Hosting