Flarum’s official recommended installation method is to use Composer. You can search Google or Baidu for tutorials on installing Composer. LNMP and LAMP come with it, so they will not be discussed here. If you find that Composer updates are slow, fail, or even produce errors when setting up on a local machine or a server in China, you can use a domestic mirror.

sudo composer config -g repo.packagist composer https://packagist.phpcomposer.com

After entering the command, simply running composer update will use the domestic mirror.

Common Composer Commands

Using the plugin flagrow/ads as an example:

Install a plugin

composer require flagrow/ads

Remove a plugin

composer remove flagrow/ads

Update a plugin

composer update flagrow/ads

Running composer update in the Flarum root directory updates the entire Flarum installation, including plugins.

Specify a Version When Installing a Plugin

Using the plugin flagrow/upload as an example:

composer require flagrow/upload:0.4.13

You can also use the following command to update to a minor version within a major version:

composer require flagrow/upload:0.4.*

If you need to install the latest development version:

composer require flagrow/upload:dev-master

If you want to install the official Flarum development version (dev), here is one recommended method:

After installing the beta version, modify the composer.json file in the root directory.

Change the flarum/core version to "flarum/core": "0.1.x-dev".

Then replace all the flarum/flarum-ext-**** versions with dev-master.

In other words, batch-replace ^0.1.0 with dev-master.

Finally, run composer update to update to the dev version.