June 25, 2008

DokuWiki: An elegant and lightweight wiki engine

Author: Dmitri Popov

Created as a simple solution for managing documentation, DokuWiki has evolved into a powerful and flexible wiki suitable for most tasks involving collaborative editing. DokuWiki doesn't use a database back end (all pages are stored as plain text files), which makes it easy to install and maintain. Its access control list feature offers a user-friendly and flexible mechanism for restricting access to certain pages and namespaces. You can also extend DokuWiki's default functionality using plugins, and there are hundreds of plugins to choose from.

Since DokuWiki doesn't rely on a database back end, you need only a Web server with PHP to install and run the software. Download the latest release of DokuWiki, unpack the downloaded archive, and move the resulting folder (you might want to rename it to "dokuwiki") to your Web server. You can also install DokuWiki into the root of your server by moving the contents of the unpacked folder into the server's root directory. Make sure that the conf and data directories are writable by the server. To do this, use an FTP client to set permissions for both directories to 777. Then point your browser to http://yourserver/dokuwiki/install.php to start the DokuWiki installer. To install DokuWiki, you must give your wiki a name, enable access control lists, and choose the initial ACL policy for your wiki. Press then the Save button, and your wiki is ready to go.

Once DokuWiki is installed, you can start populating it with pages. The easiest way to do this is to create the start page (the default page you land at when you point your browser to http://yourserver/dokuwiki) by pressing the Create this page button. Like any wiki system, DokuWiki allows you to add links to non-existing pages, so you can "grow" your wiki as you go. To insert an empty link into the currently edited page, put the page name in double brackets: [[link_to_empty_page[[.

Although DokuWiki doesn't have a WYSIWYG editor, it does include a toolbar that contains buttons for frequently used formatting options such as bold, italics, headings, lists, links, and more. To make it easier to edit long pages, DokuWiki includes a nifty feature that automatically breaks a page into sections that can be edited separately. It does so by using page headings, and it breaks a page into sections only if the page contains more than three headings (this default value can be adjusted in the Configuration Settings section of the wiki). DokuWiki also automatically generates a table of contents (TOC) for any page that has more than three headings (this value can also be adjusted). This helps readers quickly locate sections in a long page. You can turn this feature off for individual pages by inserting the ~~NOTOC~~ flag somewhere in the page.


Each time you click the Save button, DokuWiki saves the previous version of the page you're working on. You can then use the Old revisions button to view a list of previous versions of the page and compare two or more versions. DokuWiki uses color codes to mark differences between compared page revisions, which makes it easier to track changes. Users can also keep track of changes made to wiki pages using RSS feeds automatically generated by DokuWiki. The Recent changes feed tracks modifications in all wiki pages, while the Current namespace feed monitors pages only in a particular namespace.

You can organize pages in your wiki by topic or any other criteria using so-called namespaces, which act as virtual folders. To create a new namespace, insert a link into the currently edited page using the format [[namespace:page[[. For example, if you want to create a page called "idioms" in a namespace called "english," the link would be [[english:idioms[[.

To keep tabs on pages and namespaces, DokuWiki offers an Index page that contains an expandable tree which you can use to browse through namespaces and pages. You can jump to it using the Index button at the bottom of every wiki page. The Search feature provides another way to quickly locate pages in your wiki. Start typing the name of the page you want to find, and DokuWiki automatically displays a list of matching pages and namespaces, narrowing the results as you continue to type. Pressing the Search button returns a list of found pages and highlights the search term in the page summaries.

DokuWiki supports page templates, which can come in handy in situations when every page must include static text such as a disclaimer or copyright notice. To set up a template, create a new wiki page (or use an existing one) and format it the way you want it. Then copy the contents of the page and paste it into a plain text file. Alternatively, you can use a text editor to create and format a template if you are familiar with DokuWiki's formatting options. Save the file as _template.txt and move it into the desired namespace using an FTP client. The system will then apply the template to any page created in that namespace. The clever part is that you can create different templates for different namespaces, so you can, for example, create one template for articles and another template for tips.

Administering and extending DokuWiki

The Admin button at the bottom of every wiki page provides access to DokuWiki's administrative features, including the Access Control List Management and Configuration Settings sections. The former allows you to control access privileges for individual pages and namespaces. The available tools allow you to grant granular privileges to specific users and groups. For example, you can allow a certain user to read and edit pages in a particular namespace while restricting the user's ability to create new pages, delete existing ones, and upload files.

The Configuration Settings section allows you to tweak virtually every aspect of your wiki. The Authentication section contains the Disable DokuWiki actions option, which lets you turn DokuWiki's features on and off. For example, if you want to disable the revisions feature, you can do so by ticking the Old Revisions check box. The Advanced Settings section contains another useful option called Hide matching pages. It allows you to hide pages that match a specific regular expression. For example, if you want to hide all pages that contain the "hidden" string in their names, you can do so by specifying the regular expression ^.*?:hidden$. You can also use pipes to specify multiple page names; for example, ^.*?:hidden$|temporary$. Keep in mind, though, that this feature only hides pages from DokuWiki's search and RSS feeds, and it's not designed to protect confidential information in wiki pages.

The Administration part of DokuWiki contains the Manage Plugins section, which lets you install and manage plugins to extend the default functionality. To install a plugin, enter its link into the URL field and press the Download button. Since the plugin manager requires write access to the plugins folder, it may not always work on your particular DokuWiki installation. In that case, you can install plugins manually. Download the plugin package in zip or tar.gz format, unpack it, and upload the resulting folder to the lib/plugins directory in your DokuWiki installation.

The official plugin page contains more than 100 useful plugins, and which one you choose to install depends, of course, on your needs. There are, however, a few must-have plugins for any DokuWiki installation. The ODT Export plugin, for example, allows you to save any page in DokuWiki as an OpenOffice.org Writer document. With this plugin installed, you can add an ODF export button to any wiki page by inserting the ~~ODT~~ flag somewhere in it. Tag is another plugin worth installing. It adds tagging capabilities to DokuWiki. The plugin lets you tag wiki pages using simple markup like {{tag>tag1 tag2 tag3}}; for example, {{tag>english language idioms}}. You can then generate a list of all pages containing a certain tag or tags using the syntax {{topic>tag1 tag2}}; for example, {{topic>idioms}}.

Final word

Behind DokuWiki's lightweight and elegant appearance hides a powerful and flexible wiki engine that can help you to publish information and collaborate with consummate ease. Moreover, using the available plugins, you can beef up DokuWiki's default functionality and even transform it into a blog, a database, or a task manager. Finally, if you decide to go with DokuWiki, check the DokuWiki Manual and Tips and Tricks pages, which can help you get the most out of this excellent wiki engine.


  • Internet & WWW
  • Enterprise Applications
Click Here!