How to Install Phabricator on NixOS Latest

Phabricator is a powerful open-source project management software that enables developers to collaborate and manage projects. In this tutorial, we will show you how to install Phabricator on the latest version of NixOS.

Prerequisites

Before installing Phabricator on NixOS, make sure your system meets the following requirements:

Steps

  1. Update your system to ensure you have the latest packages installed.
sudo nix-channel --update && sudo nixos-rebuild switch
  1. Install Apache web server using the command below:
sudo nix-env -i apache
  1. Install PHP and its dependencies.
sudo nix-env -i php php-fpm php-mysql php-curl php-pecl-xdebug php-gd php-intl php-mbstring php-openssl php-zip
  1. Install MariaDB database server.
sudo nix-env -i mariadb
  1. Create a new database for Phabricator.
sudo mysql -u root -p
MariaDB [(none)]> create database phabricator;
MariaDB [(none)]> create user 'phabricator'@'localhost' identified by 'your_password';
MariaDB [(none)]> grant all privileges on phabricator.* to 'phabricator'@'localhost';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit;
  1. Now we need to install and configure Phabricator.
sudo nix-env -i git
cd ~
git clone https://github.com/phacility/phabricator.git
cd phabricator
./bin/config set mysql.user phabricator
./bin/config set mysql.pass your_password
./bin/config set phabricator.base-uri "http://your_domain"
  1. Install and configure the dependencies for Phabricator.
sudo nix-env -i arcanist libphutil
./bin/storage upgrade --force
  1. Configure Apache web server to serve your Phabricator installation.
sudo editor /etc/apache2/sites-enabled/your_domain.conf
<VirtualHost *:80>
   ServerName your_domain
   Redirect permanent / https://your_domain/
</VirtualHost>

<VirtualHost *:443>
   ServerName your_domain
   DocumentRoot /path/to/phabricator/webroot
   ErrorLog /var/log/apache2/your_domain_error.log
   CustomLog /var/log/apache2/your_domain_access.log combined

   SSLEngine On
   SSLCertificateFile /path/to/ssl/cert.pem
   SSLCertificateKeyFile /path/to/ssl/key.pem
   SSLCertificateChainFile /path/to/ssl/chain.pem

   <Directory "/path/to/phabricator/webroot">
      AllowOverride All
      Require all granted
   </Directory>

   <Location "/res">
      Require all granted
   </Location>

   <Directory "/path/to/libphutil/resources/">
      Require all granted
   </Directory>

   <LocationMatch "/(support|legal)">
      Require all granted
   </LocationMatch>
</VirtualHost>
  1. Restart Apache web server.
sudo systemctl restart apache2
  1. Access your Phabricator installation on your web browser by navigating to your domain. For example,
https://your_domain/

Congratulations, you have successfully installed Phabricator on NixOS!

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!