I didn't set it up myself, it was given to me like that, so although I am free to modify anything I don't know exactly well all the things that have been done so far.
clarkwinkelmann If you are able to change the user the webserver runs as, you could change it to be the same as your shell user.
This would mean modifying the user/group in Nginx (/etc/nginx/nginx.conf) and PHP-FPM (/etc/php-fpm.d/www.conf) Is there anything else I'm missing?
I have replicated the system locally and with the root user there is no problem, even if I keep the chown -R nginx:nginx in the flarum path, but I can't use root on the live system.
With this I think maybe the problem is in the user I have to use, this user has sudo permissions, but it requires constantly specifying sudo before any command and right after that entering the password all the time, the problem is that I can't add the sudo with the composer command, then the user without sudo has super limited permissions which of course don't allow writing anywhere.
clarkwinkelmann Most likely you have composer in your PATH variable? You might need to set the PATH variable for your nginx user bash shell, move Composer to a path that's already global for all users, or manually specify the path to the composer executable in the command.
Yes, the composer.phar is located in /usr/local/bin/composer which is supposed to be global, I could confirm that it works in the test I did with the root on the local copy, while I could use composer update, it didn't work sudo composer update, does this command work on other distros? On CentOS it asks for the password and it "breaks" it doesn't seem to work even if you are root.