Magento2 File and Folder Permission

Lot of people suffer problem during move magento2 project on server, one of the issue is due to file and folder permission.
Here are very important command that fix the issue :

sudo find . -type d -exec chmod 770 {} \; 
sudo find . -type f -exec chmod 660 {} \;
sudo chmod u+x bin/magento

For local development set pub and var to 775 or 777

Magento 2 Important Commands List

Here are very importand commands that used in magento2.
1. Setup Upgrade Command

php bin/magento setup:upgrade

2. Cache Clean

php bin/magento cache:flush 
php bin/magento cache:clean

3. Cache Clean Status

php bin/magento cache:status

4. Enable Cache

php bin/magento cache:enable

5. Disable Cache

php bin/magento cache:disable

6. Check Current Mode Status

php bin/magento deploy:mode:show

7. Set Developer Mode

php bin/magento deploy:mode:set developer

8. Set Production Mode

php bin/magento deploy:mode:set production

9. tatic Content Deploy Using Command Line (Use -f for force deploy on 2.2.x or later)

php bin/magento setup:static-content:deploy

10. Static Content Deploy For Particular Language Using Command Line

php bin/magento setup:static-content:deploy en_US

11. Reindexing

php bin/magento indexer:reindex

12. View the list of indexers

php bin/magento indexer:info

13. Check index status

php bin/magento indexer:status

14. Show the mode of all indexers

php bin/magento indexer:show-mode

15. Check All module Status

php bin/magento module:status

16. Enable Module

php bin/magento module:enable Module_name

17. Disable Module

php bin/magento module:enable Module_name

18. Compile

php bin/magento setup:di:compile

19. Enable Maintenance Mode

php bin/magento maintenance:enable

20. Disable Maintenance Mode

php bin/magento maintenance:disable

21. Status Maintenance Mode

php bin/magento maintenance:status

how to improve magento2 website speed

There are following steps by which you can increase the performance(speed) of magento2 website :

Step 1: Disable Unwanted module or extension
Step 2: Purchase best hosting server
Step 3: Enable Flat Categories and Products
Step 4: Merge CSS and JS Files
Step 5: Content Delivery Network
Step 6: Caching FPC
Step 7: Image Optimization
Step 8: Enable Compression
Step 9: Reduce Server Response Time
Step 10: Keep the number of third-party extension
Step 11: Magento Updates
Step 12: Optimize Query
Step 13: Enable Production Mode
Step 14: Gzip Compression
Step 15: Expire Headers

   <ifModule mod_expires.c>
   ExpiresActive On
   ############################################
   ## Add default Expires header
   ## http://developer.yahoo.com/performance/rules.html#expires
   <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
   ExpiresDefault "access plus 1 year"
   </FilesMatch>
</ifModule>
   

Step 16: Update Indexes
Step 17: Try to create module cacheable

A part of above steps you can check which module orĀ  section will take much time optimize that mention Varien_Profiler::enable(); in your index.php file magento root than you able track every layout.