Hello @saycoda,
welcome to the Nextcloud community! ![]()
please use search the topic is discussed many times already. basically the right commands are
#chown -R www-data:www-data ./files
find ./app ./config ./data -type d -exec sudo chown -R www-data:www-data '{}' \;
find ./app ./config ./data -type d -exec sudo chmod 750 '{}' \;
find ./app ./config ./data -type f -exec sudo chmod 640 '{}' \;
where www-data is the user running your webserver and app, config and data are directories used for respective data.
As you are missing basic knowledge I recommend to review 101: Self-hosting information for beginners