perte important is to understand the user the forum is running as (on apache this might be www-data for instance). Then from the install path:
chown www-data: ./ for writing config.php
chown -R www-data: ./assets for avatars and other uploads
chown -R www-data: ./storage for cache and other temporary files
All other files and directories can stay owned by root (under normal circumstances). In case you want to use bazaar also run;
chown -R www-data: ./vendor so Bazaar can replace the vendor folder.
Please note I did not chmod anything, because that's not really necessary. If still necessary also chmod 755 the directories mentioned above. Reset them to the defaults, eg by looking at https://unix.stackexchange.com/questions/249845/reset-permissions-back-to-default