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:
- NixOS installed with root access
- A domain name and SSL certificate configured for your Phabricator installation
Steps
- Update your system to ensure you have the latest packages installed.
sudo nix-channel --update && sudo nixos-rebuild switch
- Install Apache web server using the command below:
sudo nix-env -i apache
- 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
- Install MariaDB database server.
sudo nix-env -i mariadb
- 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;
- 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"
- Install and configure the dependencies for Phabricator.
sudo nix-env -i arcanist libphutil
./bin/storage upgrade --force
- 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>
- Restart Apache web server.
sudo systemctl restart apache2
- 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!