find . -type f -exec chmod 644 {} ;
find . -type d -exec chmod 755 {} ;
find var pub/static pub/media app/etc generated/ -type f -exec chmod g+w {} ;
find var pub/static pub/media app/etc generated/ -type d -exec chmod g+ws {} ;
chown -R <Magento user>:<web server group> .
chmod u+x bin/magento