*/5 * * * * means “every 5 minutes”, in any crontab, on any server in the world.
But it is important, that you add the entry to the crontab of the user that is supposed to run the command. (In this case it has to be the user www-data). And of course the command to be executed, has to be correct (in this case php -f /var/www/nextcloud/cron.php)