Installing Phabricator (Debian, nginx, MySql)

This article covers the basic installation and setup of Phabricator on Debian systems running MySql and nginx.

Setup environment

To setup the environment Phabricator provides with scripts for RedHat and Ubuntu systems [1]. I have adapted the Ubuntu script to Debian environment. Get it from here [3]:

$ git clone https://github.com/povilasb-com/phabricator-install

Simply run the install_debian.sh script with sudo privileges. It will get neccessary packages and download Phabricator to the current directory.

Setup nginx

Let’s configure nginx to point to Phabricator root directory [2].

I’ll be using hostname phabricator.localhost for local installation. For this to work you must add it to your hosts file. On linux machines add “127.0.0.1 phabricator.localhost” to /etc/hosts file. E.g.:

127.0.0.1       localhost
127.0.0.1       phabricator.localhost

Finally add nginx config file phabricator.localhost [3] to nginx enabled sites directory:

1
2
3
4
5
$ cd /etc/nginx/sites-available
$ sudo wget https://raw.githubusercontent.com/povilasb-com/phabricator-install/master/phabricator.localhost ./
$ cd ../sites-enabled
$ sudo ln -s ../sites-available/phabricator.localhost phabricator.localhost
$ sudo service nginx restart

Do not forget to edit phabricator.localhost file to point to your custom Phabricator installation directory. Currently it points to /tmp/phabricator/webroot:

# Update to the directory where you've installed Phabricator.
root      /tmp/phabricator/webroot;
try_files $uri $uri/ /index.php;

Setup MySql

Let’s create a dedicated MySql user phabricator so that it would be easier to manage it.

1
2
3
4
$ mysql --user root --password
$ mysql> create user 'phabricator'@'localhost';
$ mysql> grant all privileges on *.* to 'phabricator'@'localhost';
$ mysql> set password for 'phabricator'@'localhost' = password('12345');

Modify Phabricator settings:

1
2
3
4
5
$ cd phabricator_dir
$ ./bin/config set mysql.host localhost
$ ./bin/config set mysql.port 3306
$ ./bin/config set mysql.user phabricator
$ ./bin/config set mysql.pass 12345

phabricator_dir in the first line is the directory where you’ve downloaded Phabricator with install_debian.sh script.

Note

3306 is the default MySql port. If you did not do any modifications to MySql config this should be ok. Otherwise, adjust this port to your custom settings.

Setup Phabricator

Open phabricator.localhost in your webbrowser. Phabricator installation page should be displayed. Follow on screen instructions and you should be fine.

References

[1]http://www.phabricator.com/docs/phabricator/article/Installation_Guide.html#installing-required-comp
[2]http://www.phabricator.com/docs/phabricator/article/Configuration_Guide.html
[3](1, 2) https://github.com/povilasb-com/phabricator-install