So I followed this guide which doesn't really provide much commentary on running Composer as root so I ended up running as root for expediency:
https://www.howtoforge.com/tutorial/ubuntu-flarum/
However in the process of getting some extensions installed, I figured I'd read up on it more, and it seems like the general advice is to delete flarum going by this laravel Q&A as running composer as root to install flarum set privileges to things they shouldn't be? My forum works fine, I don't have any issues, I'm just worried about security. So it's not just a runtime risk when you install w/ root/super user? My directory flarum/ is a security risk, even if I don't use root/sudo to install extensions?:
https://stackoverflow.com/questions/43123427/sudo-composer-install-vs-composer-install/43123627
Do I need to rm /var/www/html/flarum and run composer create-project flarum/flarum . --stability=beta w/o super user? My forum has users/activity I'd rather not delete/erase if possible.
I'm asking as currently running composer to install extensions w/o root/sudo gives me:
./composer.json is not writable.
Hopefully I just need to chmod .josn and one or two other files rather than sql dump/backup, and go through the fun of reinstalling, etc flarum?