usermod -a -G [group,group] [username]
then chown user:group [path]
the group you had added and then chmod ug+rw,o=r [path]
on the primary group where account is created with that during virtualmin server on create virtual server you have to insert also the group that it has created in the creation of the server
This is the webmin section the OP may not have the virtualmin module for webmin installed as stated earlier there is not enough information to answer the question
I solved the problem,
Flarum suggest to use : chown -R www-data:www-data /path/to/directory
but for me it work using : chown -R username:username /path/to/directory