How to Install Gitit on AlmaLinux 9 or Rocky Linux 9
Compile the Git-backed Gitit wiki with GHCup and cabal on AlmaLinux 9 or Rocky Linux 9, then configure it and run it as a systemd service.
Gitit is a wiki written in Haskell that keeps its pages in a Git repository and converts them with pandoc, so you can write in Markdown, reStructuredText, LaTeX and other formats and edit pages either in the browser or with Git. This guide builds the current release on AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9 and runs it as a systemd service.
CentOS 7 reached end of life in June 2024; the RHEL 9 family replaces it. Gitit is still maintained (version 0.16.1 was released in November 2026), but there is no package for it in the distribution repositories, so you compile it from source. The build procedure has changed: older tutorials used the stack tool, but the project removed its Stack configuration in 0.16.1 and now requires GHC 9.6 or newer, so this guide uses GHCup and cabal.
Requirements
- A server running AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9.
- A user with
sudorights; the examples usedeploy. - Plenty of memory and disk space for the build. Gitit depends on pandoc and a large number of Haskell libraries, all compiled on your server. On a small VPS add swap space before you start, and expect the build to run for a long time.
sudo dnf update -yStep 1: Install the build dependencies
These are the system packages GHCup lists for this distribution family, plus Git (which Gitit needs at run time) and the zlib headers:
sudo dnf install -y gcc gcc-c++ gmp gmp-devel make ncurses ncurses-compat-libs xz perl git zlib-develStep 2: Create a user for Gitit
Build and run the wiki under a dedicated account, and give it a directory for the wiki data:
sudo useradd --create-home --shell /bin/bash gitit
sudo mkdir /var/lib/gitit
sudo chown gitit:gitit /var/lib/gititStep 3: Install the Haskell toolchain
Switch to the new account:
sudo -iu gititInstall GHCup, the Haskell project's installer. The variables make it run without questions and skip Stack; it installs the recommended versions of the GHC compiler and of cabal into the user's home directory:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_INSTALL_NO_STACK=1 shLoad the tools into the current shell and check the compiler version:
source ~/.ghcup/env
ghc --versionGitit needs GHC 9.6 or newer. If the version shown is older, pick a newer one from ghcup list and activate it with ghcup install ghc version followed by ghcup set ghc version.
Step 4: Build Gitit
Still as the gitit user, download the package index and build the latest release:
cabal update
cabal install gitit --installdir=$HOME/bin --install-method=copy --overwrite-policy=alwayscabal downloads and compiles every dependency, then copies the finished program to ~/bin/gitit. Verify it:
~/bin/gitit --versionDo not delete the gitit user's home directory afterwards. The program loads its templates and static files from the cabal package store that the build created there.
Step 5: Create the configuration
Write the default configuration into the data directory:
cd /var/lib/gitit
~/bin/gitit --print-default-config > gitit.conf
vi gitit.confThe file is commented throughout. The settings worth reviewing first:
| Setting | Default | Meaning |
|---|---|---|
address | 0.0.0.0 | IP address to listen on. Use 127.0.0.1 if a reverse proxy runs in front. |
port | 5001 | TCP port of the built-in web server. |
wiki-title | Wiki | Title shown in the browser. |
repository-type | Git | Git, Darcs or Mercurial. |
repository-path | wikidata | Directory of the page repository; created on first start. |
require-authentication | modify | none, modify (login needed to edit) or read (login needed to view). |
access-question / access-question-answers | empty | A question new users must answer to register an account. |
default-page-type | Markdown | Markup used for new pages. |
By default anyone who can reach the wiki can register an account and then edit pages. On a public server set an access-question with an answer only your team knows.
Leave the gitit account when you are done:
exitStep 6: Run Gitit as a service
Back as your sudo user, copy the program to a system location:
sudo install -m 755 /home/gitit/bin/gitit /usr/local/bin/gititCreate a systemd unit:
sudo vi /etc/systemd/system/gitit.service[Unit]
Description=Gitit wiki
After=network.target
[Service]
User=gitit
Group=gitit
WorkingDirectory=/var/lib/gitit
Environment=LANG=C.UTF-8
ExecStart=/usr/local/bin/gitit -f /var/lib/gitit/gitit.conf
Restart=on-failure
[Install]
WantedBy=multi-user.targetGitit expects pages to be UTF-8, which is why the unit sets a UTF-8 locale. Relative paths in the configuration (wikidata, static, templates, gitit-users, gitit.log) are created inside the working directory on first start.
sudo systemctl daemon-reload
sudo systemctl enable --now gitit
systemctl status gititStep 7: Open the firewall and log in
If Gitit listens on all addresses, open its port:
sudo firewall-cmd --permanent --add-port=5001/tcp
sudo firewall-cmd --reloadBrowse to http://203.0.113.10:5001/, register the first account and edit the front page. Every saved change becomes a commit in /var/lib/gitit/wikidata, which you can inspect and clone like any other Git repository.
The built-in server speaks plain HTTP only. For a wiki reachable from the internet, set address: 127.0.0.1, skip the firewall rule above, and put Nginx or Apache with a TLS certificate in front, proxying to http://127.0.0.1:5001/. The Gitit README has example configurations for both web servers.
Updating and troubleshooting
To upgrade, rebuild as the gitit user and copy the new binary into place:
sudo -iu gitit sh -c '. ~/.ghcup/env && cabal update && cabal install gitit --installdir=$HOME/bin --install-method=copy --overwrite-policy=always'
sudo install -m 755 /home/gitit/bin/gitit /usr/local/bin/gitit
sudo systemctl restart gitit- The build is killed part-way: the server ran out of memory. Add swap space and run the same
cabal installcommand again; it continues with the packages that are still missing. - The build fails with dependency conflicts: the active GHC is older than 9.6. Check
ghc --versionand switch versions withghcup. - The service exits immediately: read
sudo journalctl -u gititand/var/lib/gitit/gitit.log. The usual causes are a syntax error ingitit.confor a data directory not owned bygitit.
Frequently asked questions
Is Gitit still maintained?
Yes. It is developed by the author of pandoc, and releases in 2026 kept it building against current pandoc and GHC versions. It is a small project with a deliberately simple feature set, so expect maintenance releases rather than large new features.
Is there a way to avoid compiling it on the server?
You can build on another machine with the same distribution and architecture, but the program also needs its data files from the build, so copying only the binary is not enough. Building as the gitit user on the server, as shown here, is the simplest reliable method.
What alternatives exist if the build is too heavy?
Gollum is another Git-backed wiki and installs as a Ruby gem or container. If you do not need Git storage, DokuWiki stores pages in plain text files and needs only PHP, and MediaWiki or Wiki.js suit larger teams with a database available.
Can I edit pages without the web interface?
Yes. The pages are files in the Git repository at /var/lib/gitit/wikidata. Edit them there as the gitit user and commit the changes with Git; Gitit serves the committed versions.