Installing Phabricator on Linux Mint

Phabricator is a suite of web-based software development collaboration tools, including code review, repository hosting, bug tracking, and project management. In this tutorial, we will walk you through the process of installing Phabricator on Linux Mint.

Prerequisites

Before installing Phabricator on Linux Mint, there are several prerequisites that need to be fulfilled:

Installation

Follow these steps to install Phabricator on Linux Mint:

Step 1: Install Required PHP Extensions

Phabricator requires several PHP extensions to function properly, which can be installed using the following command:

sudo apt install php php-cli php-curl php-dom php-gd php-json php-mbstring php-mysql php-apcu php-redis php-xml php-zip

Step 2: Install Additional Tools

Phabricator requires several additional tools which can be installed as follows:

sudo apt install git git-lfs mercurial graphviz imagemagick subversion python-pygments docutils

Step 3: Install MySQL Server

Phabricator requires a MySQL server, which can be installed using the following command:

sudo apt install mysql-server mysql-client

Step 4: Create a MySQL Database

Now, you need to create a MySQL database for Phabricator using the following command:

sudo mysql -u root -p

Then, enter your MySQL root password and create a new database:

CREATE DATABASE phabricatordb;

Next, create a new user and grant the necessary permissions:

CREATE USER 'phabricator'@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON phabricatordb.* TO 'phabricator'@localhost;

Make sure to replace password with a secure password for the user.

Step 5: Download Phabricator

Download the latest version of Phabricator from their official website (http://phabricator.org/) or use the following command:

wget https://github.com/phacility/phabricator/archive/stable.tar.gz -O phabricator.tar.gz

Extract the downloaded tarball using the following command:

tar -xzf phabricator.tar.gz

Step 6: Configure Phabricator

Navigate to the extracted phabricator directory and copy the config.template.php to config.php as follows:

cd phabricator-stable/
cp ./resources/config/config.template.php ./config/

Next, edit the config.php file and add the following configuration:

// MySQL configuration
$config['mysql.host']     = 'localhost';
$config['mysql.user']     = 'phabricator';
$config['mysql.pass']     = 'password';
$config['mysql.port']     = null;
$config['mysql.socket']   = null;
$config['mysql.protocol'] = 'TCPIP';

// base URI path
$config['phabricator.base-uri'] = '/phabricator';

// email configuration
$config['metamta.mail-adapter']  = 'PhabricatorMailImplementationPHPMailerAdapter';
$config['metamta.mailer.binary'] = '/usr/sbin/sendmail';
$config['metamta.mailer.arguments'] = '-bs';

Make sure to replace password with the password you set while creating the MySQL user.

Step 7: Configure Apache

Create a new Apache virtual host by creating a new configuration file named phabricator.conf under the /etc/apache2/sites-available directory:

sudo nano /etc/apache2/sites-available/phabricator.conf

Add the following configuration to the file:

<VirtualHost *:80>
    ServerName phabricator.local
    DocumentRoot /var/www/phabricator/webroot
    RewriteEngine On
    RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
    RewriteRule ^/favicon.ico  -                       [L,QSA]
    RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]
    <Directory "/var/www/phabricator/webroot">
        Require all granted
        AllowOverride All
    </Directory>
</VirtualHost>

Save and close the file.

Next, enable the virtual host and Apache rewrite module:

sudo a2ensite phabricator.conf
sudo a2enmod rewrite

Lastly, restart the Apache service to apply the changes:

sudo systemctl restart apache2

Step 8: Run the Phabricator Install Script

Navigate to the Phabricator directory and run the ./bin/config set mysql.host localhost command to set the MySQL hostname:

cd ~/phabricator-stable/
./bin/config set mysql.host localhost

Next, run the Phabricator install script and follow the prompts:

./bin/storage upgrade --user root

Once the installation is complete, you can access Phabricator by opening your web browser and visiting http://localhost/phabricator/.

Conclusion

In this tutorial, we walked you through the process of installing Phabricator on Linux Mint. With Phabricator installed, you now have a powerful set of collaboration tools at your disposal.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!