How do I install Flarum on a server?
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!
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:
- sudo apt-get install curl php5-cli git
- curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
Now we can install Flarum directly in Apache’s document root:
- cd /var/www/html
- composer create-project flarum/flarum . --stability=beta
- 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:
- 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
</Directory>
Now we’ll restart Apache for the changes to take effect:
- 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:
- CREATE DATABASE flarum;
- GRANT ALL PRIVILEGES ON flarum.* TO 'flarum'@'localhost' IDENTIFIED BY 'password';
- FLUSH PRIVILEGES;
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:

For full installation instructions, check out the Flarum documentation.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.