How to Setup a GitHub Style Wiki Using Gollum on CentOS 7

Updated on March 9, 2020
How to Setup a GitHub Style Wiki Using Gollum on CentOS 7 header image

Gollum is the Git-based wiki software used as the backend of the GitHub Wiki. Deploying Gollum will allow you to host a GitHub-like Wiki system on your server.

Interested? Great! Let's take a look at how to install Gollum on CentOS 7.

Prerequisites

  • A CentOS 7 x64 server instance.
  • A sudo user.
  • The EPEL yum repository.

1. Update the system

Log in to your server via SSH using the sudo user to install epel, update the system, and restart to apply the updates.

sudo yum install epel-release -y
sudo yum update -y && sudo shutdown -r now

2. Install Gollum using gem

On CentOS 7, the easiest way to install Gollum is by using RubyGems:

sudo yum group install "Development Tools" -y
sudo yum install ruby ruby-devel libicu libicu-devel zlib zlib-devel git -y
sudo gem install gollum

Note: The gem install command above may take a while to complete. If you are in hurry, you can accelerate the installation by skipping documents as follows. You can also run it in a screen session

sudo gem install --no-rdoc --no-ri gollum

The Gollum binary will be installed into your system at /usr/local/bin/gollum, and you can confirm whether or not the installation was a success by running the simple command below:

gollum --v

3. Setup a Gollum wiki

All you need to do to setup a Gollum Wiki is to create a git repository and run the gollum command inside it:

cd
mkdir my-wiki
cd my-wiki
git init
gollum

Note: When necessary, you can use Ctrl+C to exit Gollum.

4. Allow web access

Before you can visit your Gollum wiki site in your web browser, you need to modify firewall rules as follows:

sudo firewall-cmd --zone=public --permanent --add-port=4567/tcp
sudo firewall-cmd --reload

5. Access Gollum from web

While Gollum is running, point your web browser to http://203.0.113.1:4567 to start creating the first Gollum wiki page. Feel free to create more wiki pages there, and all the pages your create will be saved as .md files in current git repo directory.

6. Create or edit Gollum wiki pages from CLI

Apart from creating or modifying pages from a web browser, you can also create or edit pages from the CLI. To do that, you only need to create .md files in accordance with the MarkDown syntax, and then commit them to the git repo:

cd ~/my-wiki
vi page1.md
git config --global user.email "admin@example.com"
git config --global user.name "admin"
git add page1.md
git commit -m "create page1"

That's it. To learn more about Gollum, type gollum --help to check out the Gollum help or pay a visit to official Gollum website.