How to Install Phorge (Phabricator's Successor) on AlmaLinux 9 or Rocky Linux 9
Phabricator ended maintenance in 2021. Install its community fork Phorge on AlmaLinux 9 or Rocky Linux 9 with nginx, PHP-FPM and MariaDB.
Phabricator, the code review and project management suite, is no longer developed: its upstream announced that it stopped active maintenance on 1 June 2021. The community continuation is Phorge, a fork that keeps the same applications (Differential, Maniphest, Diffusion, Phriction and the rest) and still receives releases. CentOS 7 reached end of life in June 2024, so this guide installs Phorge on AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9 with nginx, PHP-FPM and MariaDB. At the end you will have a working Phorge instance on its own domain with the background daemons running under systemd.
Requirements
The Phorge installation guide asks for the following:
- A normal Linux server or VM (shared hosting is not supported) and shell access with
sudo. - A whole domain or subdomain such as
phorge.example.com. Phorge cannot be installed in a path likeexample.com/phorge/, and the host name must contain a dot. - PHP 7.2.25 or newer, or PHP 8.0 or newer, with the
mbstring,iconv,mysqli,curl,pcntlandposixextensions.gd,zip,opcacheandapcuare optional. - MySQL 8.0 or newer, or MariaDB 10.5.1 or newer. The MariaDB 10.5 packages shipped with the RHEL 9 family meet this.
- git 2.5.0 or newer on the server.
Install nginx, PHP and MariaDB
The default PHP in the RHEL 9 family is 8.0. Newer versions are provided as module streams; list them with dnf module list php and enable the newest one your release offers (8.3 in the example):
sudo dnf module reset php -y
sudo dnf module enable php:8.3 -y
sudo dnf install -y nginx mariadb-server git php-cli php-fpm php-mysqlnd php-mbstring php-process php-gd php-opcache php-pecl-zip
Start the database and run the hardening script:
sudo systemctl enable --now mariadb
sudo mariadb-secure-installation
Phorge does not use a single database. It creates a set of databases whose names start with phabricator_, so the account it uses needs rights on that whole prefix. Open a client with sudo mariadb and run:
CREATE USER 'phorge'@'localhost' IDENTIFIED BY 'choose-a-strong-password';
GRANT ALL PRIVILEGES ON `phabricator\_%`.* TO 'phorge'@'localhost';
FLUSH PRIVILEGES;
Download Phorge and Arcanist
Phorge is deployed from git and needs the Arcanist library checked out next to it. After cloning, mark both working copies as safe so git does not refuse them with a "dubious ownership" error:
sudo mkdir -p /opt/phorge
cd /opt/phorge
sudo git clone https://github.com/phorgeit/arcanist.git
sudo git clone https://github.com/phorgeit/phorge.git
sudo git config --system --add safe.directory /opt/phorge/arcanist
sudo git config --system --add safe.directory /opt/phorge/phorge
Both repositories have a master and a stable branch. The project promotes master to stable regularly; to follow the calmer branch, run sudo git checkout stable in each directory. Always keep both on the same branch.
Configure the database connection
Local settings are written to conf/local/local.json with the bin/config tool. Set the database credentials and the address users will type, then load the schema:
cd /opt/phorge/phorge
sudo ./bin/config set mysql.host localhost
sudo ./bin/config set mysql.user phorge
sudo ./bin/config set mysql.pass 'choose-a-strong-password'
sudo ./bin/config set phabricator.base-uri 'http://phorge.example.com/'
sudo ./bin/storage upgrade
The option names still begin with phabricator. and mysql. in Phorge. Once you have a TLS certificate in place, change phabricator.base-uri to the https:// address.
Configure nginx
On the RHEL 9 family PHP-FPM listens on the socket /run/php-fpm/www.sock, which nginx is allowed to use out of the box. Create /etc/nginx/conf.d/phorge.conf, based on the server block from the Phorge configuration guide:
server {
listen 80;
server_name phorge.example.com;
root /opt/phorge/phorge/webroot;
location / {
index index.php;
rewrite ^/(.*)$ /index.php?__path__=/$1 last;
}
location /index.php {
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
}
}
The document root must end in /webroot. Test the configuration, start the services and open the firewall:
sudo nginx -t
sudo systemctl enable --now php-fpm nginx
sudo firewall-cmd --permanent --add-service=http --add-service=https
sudo firewall-cmd --reload
Finish setup in the browser
Open http://phorge.example.com/. If anything essential is missing, Phorge shows a setup page that names the problem and the command to fix it. When you reach the welcome screen, enter the details for the first administrator account. Until you configure an authentication provider under Auth, nobody else can register or log in, so do that next.
After logging in, a banner links to the list of unresolved setup issues. Work through it: it covers items such as PHP settings, the outbound mail configuration and the base URI.
Run the daemons with systemd
Phorge needs its phd daemons for repository updates, mail and background tasks. The source tree ships a systemd unit that expects a dedicated user, an environment file and a writable repository directory. Create them:
sudo useradd --system --create-home --home-dir /var/repo --shell /sbin/nologin phd
sudo mkdir -p /etc/phorge
echo 'PHORGE_ROOT=/opt/phorge/phorge' | sudo tee /etc/phorge/environment
sudo cp /opt/phorge/phorge/resources/phd/phorge-phd.service /etc/systemd/system/
sudo systemctl edit phorge-phd.service
In the editor that opens, add an override that sets the user and the path the daemons write to (the value of repository.default-local-path):
[Service]
User=phd
Group=phd
ReadWritePaths=/var/repo
Save, then start the service:
sudo systemctl daemon-reload
sudo systemctl enable --now phorge-phd.service
sudo /opt/phorge/phorge/bin/phd status
The Phorge documentation also allows systemctl link instead of copying the unit, so that it follows upgrades automatically. If a daemon will not stay up, run it in the foreground with bin/phd debug <daemon> to see its output.
Upgrade Phorge
Upgrade Arcanist and Phorge together, in this order:
sudo systemctl stop nginx php-fpm phorge-phd
cd /opt/phorge/arcanist && sudo git pull
cd /opt/phorge/phorge && sudo git pull
sudo ./bin/storage upgrade
sudo systemctl daemon-reload
sudo systemctl start phorge-phd php-fpm nginx
The project publishes a changelog that lists compatibility notes and security fixes for each promotion to stable. Details are in the official installation guide and upgrade guide.
Frequently asked questions
Can I still install Phabricator itself?
The code is still downloadable, but it has had no maintenance since June 2021, which means no security fixes and no support for current PHP releases. For a new installation use Phorge.
Can I use Apache instead of nginx?
Yes. The configuration guide documents an Apache virtual host with mod_rewrite whose DocumentRoot points at the same webroot directory, and a lighttpd variant. PHP's built-in web server is only suitable for development.
Why does the page show a database or permission error on a fresh install?
Check that bin/storage upgrade finished without errors and that the MariaDB account has rights on every phabricator_ database. On SELinux-enforcing systems, also look at sudo ausearch -m avc -ts recent; a denial there means the web server was blocked from a file or socket rather than Phorge being misconfigured.
Does the Phorge server run on Windows?
No. The server side needs Linux, BSD or another Unix-like system. Windows machines can use the web interface and the Arcanist command-line client.