Lyft For a starter, I would do something along these lines:
adduser --system --home /flarum/install flaruminstall && chown -R flaruminstall:www-data /flarum/install
with /flarum/install == your flarum install directory and flaruminstall == the user you want to own the webserver files. Something like web may fit better.
The above command adds a system (limited) user and sets the home directory to /flarum/install under the name of flaruminstall and if that command is successful, changes the ownership recursively to flaruminstall and a group of www-data of the /flarum/install directory.