When I paste these files, the website stops working 🙁
Simply move all the files inside the public directory (including .htaccess) into the directory you want to serve Flarum from. Then edit .htaccess and uncomment lines 9-15 in order to protect sensitive resources. For Nginx, uncomment lines 8-11 of .nginx.conf.
You will also need to edit the index.php file and change the following line:
$site = require './site.php';
Edit the site.php and update the paths in the following lines to reflect your new directory structure:
'base' => DIR,
'public' => DIR,
'storage' => DIR.'/storage',
Finally, check config.php and make sure the url value is correct.