Magento2 Post Installation For Developers

In this blog we will see the steps to do just after magento2 installation, to properly prepare to start development.

Set Developer Mode

Magento comes with 3 different modes out of the box (developer, default and production)

Read more about the 3 modes here

To enable developer module open the .htaccess file and uncomment the line “SetEnv MAGE_MODE developer”
after you uncomment magento will be set in developer model

Also make sure that your apache configuration follows this

Also run

 php bin/magento deploy:mode:set developer
 php bin/magento deploy:mode:show

to set and check developer mode from command line

Disable Cache

Login into magento admin, navigate to
System -> Cache Management
disable all caches here

you can manage cache from command line using

php bin/magento cache:disable
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento cache:status
php bin/magento cache:enable

Run Indexing

You can also run indexing from command line using command

php bin/magento indexer:reindex

or you can do this from admin as well

Run Cron

You can run cron from command line using the commands

php bin/magento cron:run
php bin/magento setup:cron:run
php update/cron.php

This will just run cron once

You can also setup cron permanently in crontab
for doing that follow article here

Set Permissions

If you get permission error, cannot create directory error in any of the above command or in website
make sure to do below

sudo chmod -R 777 pub/
sudo chmod -R 777 var/

Also enable error_reporting = E_ALL and display_errors = On set in your php.ini configuration.

  • Manoj Kumar

    Hi This is nice post .Can you also write a tutorial for custom magento2 theme.