Automatic Plugin Installation

How can I automatically install plugins? What’s the best practice for that?

For example, I have a plugin .tar.gz, which I want to automatically install, when installing Mattermost for the first time. The config.json is already appropriately adjusted.