How do I install Flarum on a server?

How do I install Flarum on a server?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Flarum runs on top of the LAMP stack. So the first step in getting it up and running on your server is to use the DigitalOcean LAMP One-Click application or to follow this tutorial:

We’ll also need Composer installed. You can get a lot more details about how to use Composer in this tutorial, but for now we’ll just quickly install it with:

  1. sudo apt-get install curl php5-cli git
  2. curl -sS | sudo php -- --install-dir=/usr/local/bin --filename=composer

Now we can install Flarum directly in Apache’s document root:

  1. cd /var/www/html
  2. composer create-project flarum/flarum . --stability=beta
  3. sudo chown -R www-data:www-data /var/www/html

We’ll also have to make some configuration changes to Apache. Enable URL rewriting by running:

  1. sudo a2enmod rewrite

Then we’ll need to add the following block inside of the Apache VritualHost located at `` It allows the .htaccess file installed with Flarum to function:

        <Directory "/var/www/html">
            AllowOverride All

Now we’ll restart Apache for the changes to take effect:

  1. sudo service apache2 restart

Next, we’ll need to create an new database and MySql user. Enter the MySql shell by running sudo mysql -uroot -p Then run:

  1. CREATE DATABASE flarum;
  2. GRANT ALL PRIVILEGES ON flarum.* TO 'flarum'@'localhost' IDENTIFIED BY 'password';

You can now visit the IP address of your server in a web browser to finish the installation using the database details you just set up:

Install wizard

For full installation instructions, check out the Flarum documentation.