To install Flarum files locally, you only need an operating system that can run PHP and Composer. So almost any system will work. On Ubuntu you can install PHP through apt and composer from the Composer website. You don't need a webserver if you're just generating composer.json+composer.lock+vendor folder. Just make sure it's the same PHP version as the server, and that all the same PHP modules/extensions are enabled.
Extensions can be installed with Composer with the commands provided in the extension README. I'm not sure what you would need to download from FreeFlarum? Maybe you are mixing up with Composer/Packagist (the default platform where extensions are hosted) or Extiverse (a website showing Packagist extensions + some private extensions)?