This is a basic tutorial, suitable only for beginners; experts, please go easy on me. This article mainly covers installation with composer, so it is not suitable for virtual hosts. Of course, you can also install it with composer locally and then upload it to a virtual host.
Installation Preparation
First, check the server environment. Your server must meet the following requirements:
Web server: Apache (with mod_rewrite), Nginx, or Lighttpd
PHP 5.6+ and these extensions: mbstring, pdo_mysql, openssl, json, gd, dom, fileinfo
MySQL 5.5+
If you are using a VPS built with LNMP, the fileinfo extension is usually missing. Please modify the contents of the include/upgrade_php.sh file yourself, changing
--disable-fileinfo
to
--enable-fileinfo
Then execute ./upgrade.sh and select 4 to upgrade PHP. For virtual machines, please contact your hosting provider yourself. Linux virtual hosting is generally recommended.
(Update: Starting with LNMP 1.5, there will be a fileinfo switch option, allowing you to specify whether to enable it during installation.)
Starting the Installation
If you are using the Flarum CV integration package, first extract it and upload it to the website root directory as a ZIP archive, then extract it. For details, see
{cat_insidepost id="116"}
For installing the official VPS version, cd to the website root directory and then enter the following (please make sure Composer is installed on your server. Since LNMP already includes it, this will not be described in detail here):
composer create-project flarum/flarum . --stability=beta
After completing the steps above, change the permissions of assets/ and storage/ in the website root directory to 777 (if they do not meet the installation requirements, you will be prompted to modify them), and then create a new database. Open the website homepage to enter the installation interface directly, and enter 社区名称, 数据库名, 数据库用户名, 数据库密码, 数据库前缀 (leaving it blank is recommended), 超级管理员名称, 邮箱, 密码, and 确认密码 in order, then click Install.

Pretty URL Configuration (NGINX)
Modify the nginx.conf file, or configure pretty URLs in one of the various control panels, and add the following content:
location / { try_files $uri $uri/ /index.php?$query_string; }
location /api { try_files $uri $uri/ /api.php?$query_string; }
location /admin { try_files $uri $uri/ /admin.php?$query_string; }
location /flarum {
deny all;
return 404;
}
location ~* \.php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
}
location ~* \.html$ {
expires -1;
}
Email Settings
After a successful installation, first go to 基本设置 to configure the site description and welcome banner content. Then, of course, set up email delivery; otherwise, how can new users register? (If you are not worried about advertising spam, you can also enable the user-management user management plugin and disable email registration.)

Here, 163 is used as an example for the email settings. In fact, some free overseas email services are recommended. In the settings interface, only the first SMTP item is fixed (unless your server has its own email service and can use the default mail service); modify the remaining settings according to the SMTP settings of your email service provider.
Permission Settings
Here are a few options that require attention:
- View user list - This option was added in beta7 and controls permission to use search. If it is set to registered users, guests will not be allowed to search.
- Posts do not require approval and Replies do not require approval - These are two separate options. Configure them according to your needs.
- If you need to restrict the permissions of registered user groups, enable the
默认用户组plugin (it is included in the CV version). - If you need to set up
隐私分类orVIP 分类, add a node and then set viewing posts to the corresponding user group. At the same time, modify permissions such as posting and replying.
Setting Up Nodes (Forums)

Tips: After creating a category, the new category will appear in the tag bar below. To turn it into a node, drag it with the mouse to the node area above. If you drag it below an existing node and to the right, the category will become a subcategory of that node (as shown on the right side of the screenshot); if you drag it below an existing node and place it alongside it, the category will become a parent node (as shown on the left side of the screenshot).
Relationship between nodes and tags: In Flarum, nodes are categories (forums), while tags are shared tags. As shown on the left side of the screenshot, selecting Announcements allows you to add tags such as Downloads and Questions; in the screenshot on the right, Announcements can only have one Moderation tag.
This concludes the tutorial.