Setting up Gollum on Ubuntu


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

I am considering three use-cases:

Either install from source

Either 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

Or install with gem

Or use gem to install system-wide Gollum & addons,

apt -y install ruby ruby-dev build-essential libicu-dev zlib1g-dev
gem install gollum
gem install github-markdown
apt -y install cmake pkg-config libcurl3-dev libssl-dev
gem install gollum-rugged_adapter

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

Optionally, with mediawiki formatting,

#gem install wikicloth

create a user to run gollum (unless you are already inside a container),

useradd -m gollum

now switch back to user and check,

su - gollum

which gollum
gollum -v

GIT setup to handle the documentation

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"

Create either a locally editable,

git init $repo/
#git init --bare $repo.git/

or Setup a GIT bare repository.


You can also use the config file to setup Wiki options and environment,

cd ~/
vi gollum.$repo.rb

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

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

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



as user on a workstation

as gollum on a server or container (possibly with matching UID with the docker host)

Eventually make some handy symlinks,

cd ~/
ln -s /var/lib/gems/2.3.0/gems/gollum-4.1.2/config.rb gollum.rb.dist
ln -s /var/lib/gems/2.3.0/gems/gollum-4.1.2

Enable it at boot time, e.g. here as user gollum and only listening to localhost to be reverse proxied,

vi /etc/rc.local

/usr/bin/chsh -s /bin/dash gollum
echo Starting Gollum.
su - gollum -c "nohup gollum operations/ --config gollum.operations.rb --adapter rugged --host &"
/usr/bin/chsh -s /bin/false gollum

apply and check,

tail -25 ~gollum/nohup.out
lynx -dump localhost:4567


Check that you can now access the Markdown GUI,


Everything’s fine? You can now proceed with the reverse-proxy setup.

Also provide some custom script to start it at boot time,

mkdir -p ~/bin/
vi ~/bin/run_gollum


cd $HOME/
nohup /usr/local/bin/gollum $HOME/gitrepo/ --config gollum.gitrepo.rb --adapter rugged \
    > $HOME/gollum.gitrepo.log 2> $HOME/gollum.operations.error.log &

chmod +x ~/bin/run_gollum

sudo vi /etc/rc.local

echo -n starting Gollum as USER_HERE user...
su - USER_HERE -c '$HOME/bin/run_gollum' && echo ok

Editing the documents

You can now edit the documents with your editor of choice + git commit, either locally (workstation) or remotely (normal or bare through ssh).

Make sure you’ve got git available on your workstation and setup your GIT profile (if not already done),

git config --global "your email"
git config --global "your name"

Remote editing

Send your public SSH key (ssh-keygen && cat ~/.ssh/ to user_id_1000@dockerhost access list (~/.ssh/authorized_keys) and try to log into it without a password,

ssh user_id_1000@dockerhost

if that works, you’re ready to maintain the Documentation tru GIT e.g.,

git clone ssh://user_id_1000@dockerhost/data/gollumprod/operations.git/
cd operations/

(edit/add files)

when finished, commit your changes and push to the hosted repository,

#git add or git commit -a
git commit
git push