Setting up Gollum on Ubuntu


Gollum is a Wiki-like engine that allows different kinds of formatting, mainly Markdown but also MediaWiki.

Quick Start (server/bare mode)


apt install -y ruby ruby-dev build-essential libicu-dev zlib1g-dev
gem install gollum rdiscount
which gollum
gollum -v #Gollum 4.1.4


cp /var/lib/gems/2.5.0/gems/gollum-4.1.4/config.rb config.rb.dist
mkdir repo.git
git init --bare repo.git/

vi repo.rb

wiki_options = {
  :live_preview => false,
  :allow_editing => false,
  :allow_uploads => false,
  :h1_title => true,
  :universal_toc => true
  :show_all => true

Precious::App.set(:wiki_options, wiki_options)

Precious::App.set(:environment, :production)

gollum --config gollum.rb --bare repo.git/

Privilege Separation

Unless you are already inside a container, create a dedicated user for running gollum,

which git-shell
groupadd -g 32765 gollum
useradd -u 32765 -m -g gollum -s /usr/bin/git-shell gollum
usermod -p '*' gollum

and eventually move the repo to some accessible place for remote usage (while keeping the user permissions),

mv /home/gollum/repo/ /

otherwise if you were a dirty bastard doing everything as root, you need to fix the perms

chown -R gollum:gollum /repo.git/

Shared UI User

Unless you go for Omniauth, setup the GIT profile that corresponds to the non-authenticated Gollum WUI: try to use some mailing-list address and shared name. You will be able to setup binding to some Directory Server afterwards anyway.

git config --global ""
git config --global "ACME Project"

Ready & Testing

Enable it at boot time as user gollum,

vi /etc/rc.local

echo Starting Gollum.
/usr/bin/chsh -s /bin/dash gollum
su - gollum -c "nohup gollum --config gollum.rb --bare repo.git/ > /home/gollum/repo.log 2>&1 &"
/usr/bin/chsh -s /usr/bin/git-shell gollum

chmod + /etc/rc.local

Apply and check,

ps auxw | grep ^gollum
tail -F ~gollum/repo*.log
lynx -dump localhost:4567

git clone ssh://gollum@SERVER_ADDRESS:PORT/repo.git

Proxy Ready

Only listening to localhost to be reverse proxied locally,



More Options

Show everything in Files UI view,

  :show_all => true

More Features

Optionally, add mediawiki formatting,

gem install wikicloth

Replacing rdiscount

gem install github-markdown

You can then omit --bare when launching Gollum, as it is only required by GRIT.

Replacing GRIT Adapter

apt -y install cmake pkg-config libcurl3-dev libssl-dev
gem install gollum-rugged_adapter

--adapter rugged

Note. With sate-of-the-art markdown formatting with better tables, and with the rugged adapter,


install the needed packages to build the thing,

#apt -y install build-essential git ruby ruby-dev libicu-dev zlib1g-dev

problem is I did not figure out how to install some addons,

#apt -y install git ruby ruby-dev zlib1g-dbg zlib1g-dev libicu-dev make build-essential
#gem install bundle
#git clone
#git clone
#cd gollum/
#git pull
#bin/gollum -v
#bundle install



Nethence | Pub | Lab | Pbraun | SNE Russia | xhtml