We currently only support installing flarum extensions through composer. Most extensions include instructions on how to install them.
EDIT: Sorry, I misread the initial question. Yeah, for PHP extensions, using your operating systems package manager as described by @xkeyC is the best approach