A containerised IkiWiki
  • Shell 52.2%
  • Dockerfile 33.2%
  • Perl 14.6%
Find a file
2026-02-05 11:32:22 +01:00
scripts # YES, IT'S MASTER AND ONLY WILL BE MASTER 2026-01-24 14:17:09 +01:00
.gitignore added underlay directory 2026-01-25 20:07:51 +01:00
auto.setup added underlay directory 2026-01-25 20:07:51 +01:00
docker-compose.yml added underlay directory 2026-01-25 20:07:51 +01:00
Dockerfile clean up 2026-02-05 11:32:22 +01:00
example_env first commit 2026-01-21 20:25:09 +01:00
ikiwiki.conf ikiwiki.cgi always protected 2026-01-21 22:02:58 +01:00
install.sh first commit 2026-01-21 20:25:09 +01:00
LICENSE readme and license added 2026-01-22 14:37:09 +01:00
post-update fixed critical problem with unbound variable in git hooks 2026-01-22 15:24:26 +01:00
pre-receive fixed critical problem with unbound variable in git hooks 2026-01-22 15:13:06 +01:00
README.org added underlay directory 2026-01-25 20:09:38 +01:00

IkiWiki-Docker is a Docker container with batteries included

This is an containerized version of IkiWiki, the wiki compiler/static site generator.

  • The container runs a web server (apache2), with

    • The wiki content at /
    • The CGI end point at /ikiwiki.cgi
    • Authentication to access /ikiwiki.cgi by default
    • There are git repositories at

      • /git/ikiwiki.git — the wiki source
      • /git/libdir.git — for custom plugins (default is empty)
      • /git/templates.git — for custom templates (default is empty)
  • The c-compiler is tcc, rather than gcc (saving about 100 MiB)
  • There is Python 3 in the container
  • the Markdown flavour is Discount
  • The various data/configuration locations are consolidated under /home/ikiwiki/, containing:
  • data/ikiwiki.setup, the ikiwiki configuration file
  • repos, the above-mentioned git repositories
  • htpasswd, for auth

The following changes are made from a default IkiWiki installation:

  • theme plugin enabled and actiontabs theme selected
  • httpauth enabled
  • Python plugins are available
  • Comments are disabled by default

    • why?

      • Just to note that authenticate is already enabled for /ikiwiki.cgi

        • I use Isso - (~20kB gzipped).

          • But of course you can enable it by adding comments and moderatedcomments to the add_plugins section of the auto.setup file.
  • Admonitions are enabled

The IkiWiki version used is normally the latest tagged release with some extra patches on top. See /fz0x1/ikiwiki-docker/src/branch/master/README.org for the details.

Usage example

First create a volume to store the wiki's state, configuration and data:

  docker volume create ikiwiki-repos

Run it:

  cp example_env .env
  # edit settings and set 'IKIWIKI_ADMIN_PASSWORD' 
  ./install.sh
  docker compose up -d

Then access your wiki at http://localhost:8080 or git pull/push to http://localhost:8080/git/ikiwiki.git

Adding users

This IkiWiki container relies upon the users and their passwords being defined in /home/ikiwiki/htpasswd. To add more users, modify that file using htpasswd from the apache2-utils Debian package, e.g.

  docker exec -i ikiwiki htpasswd /home/ikiwiki/htpasswd newuser
  # or by ssh
  ssh user@server "docker exec -i ikiwiki htpasswd -bB /home/ikiwiki/htpasswd newuser pass"

Once a user exists in the htpasswd file, you can grant them admin rights on the Wiki via "Preferences → Setup", or alternatively edit /home/ikiwiki/data/ikiwiki.setup within the container's data and then rebuild the wiki

Rebuilding the wiki

Sometimes you might want to trigger a full wiki rebuild, such as after hand-editing the /home/ikiwiki/data/ikiwiki.setup file:

  docker exec -i ikiwiki --setup /home/ikiwiki/data/ikiwiki.setup --rebuild --wrappers
  # or by ssh
  ssh user@server "docker exec -i ikiwiki --setup /home/ikiwiki/data/ikiwiki.setup --rebuild --wrappers"

Proxy

I proxy the container using Nginx and Let's Encrypt with this simple configuration:

certbot certonly --nginx -d ikiwiki.test.com
server {
    listen 127.0.0.1:80;
    server_name ikiwiki.test.com;
    return 301 https://ikiwiki.test.com$request_uri;
}

server {
    server_name ikiwiki.test.com;

    access_log /var/log/nginx/ikiwiki_access.log;
    error_log /var/log/nginx/ikiwiki_error.log;

    client_max_body_size 64M;

    location / {
  	    proxy_pass http://127.0.0.1:9191;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    listen 127.0.0.1:443 ssl http2; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/ikiwiki.test.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/ikiwiki.test.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

Who/License

IkiWiki is by Joey Hess and many others. IkiWiki-Docker is a fork of Opinionated IkiWiki by Jonathan Dowland (thank you very much!), and is maintained by fz0x1. The code bits in this repository are © 2026 fz0x1, and distributed under the terms of the GNU Public License, version 3 (see /fz0x1/ikiwiki-docker/src/branch/master/LICENSE).