What is DokuWiki? — Flat-File Wiki Engine Explained for Beginners
In this tutorial, you'll learn what DokuWiki is, how its flat-file architecture eliminates the need for a database, and why it is the go-to choice for lightweight documentation and knowledge bases.
What You'll Learn
- What a flat-file wiki is and how it differs from database-driven systems
- DokuWiki's history and why it was created
- Key differences between DokuWiki, MediaWiki, and WordPress
- The types of projects DokuWiki is best suited for
- DokuWiki's architecture overview and extension ecosystem
Why It Matters
Choosing the right wiki platform can save you months of maintenance. DokuWiki's flat-file approach means no database to install, no SQL to optimize, and no complex server requirements. You can back up your entire wiki by copying a folder. You can version control it with Git. You can run it on a $5 shared hosting plan. Understanding when and why to choose DokuWiki prevents over-engineering simple documentation needs.
Real-World Use
A development team of 12 engineers maintains internal project documentation in DokuWiki. They store the entire wiki in a Git Repository. When a new developer joins, they clone the repo, run DokuWiki locally with PHP's built-in server, and have the full documentation offline. Changes are committed, reviewed, and deployed via Git hooks. No database dumps, no Migration scripts, no sync problems.
Learning Path
flowchart LR A[What is DokuWiki] --> B[Installation] B --> C[Folder Structure] C --> D[First Wiki Page] D --> E[DokuWiki Syntax] E --> F[Links and Images] F --> G[Tables] G --> H[Media Management] H --> I[Sidebar and Navigation] I --> J[Next: Namespaces]
What is a Flat-File Wiki?
A flat-file wiki stores every page as a text file on disk. No database queries, no connection pools, no schema migrations. Each page in DokuWiki is a .txt file in a directory structure that mirrors the wiki's namespace hierarchy.
When you visit a page in DokuWiki, PHP reads the .txt file directly from disk, parses the wiki syntax, renders it to HTML, and sends it to your browser. The entire operation takes a few milliseconds because there is no database layer.
Compare this to MediaWiki, which runs on MySQL. A single page view in MediaWiki can generate 10-20 database queries to fetch the page content, revision history, categories, templates, and user permissions.
History of DokuWiki
DokuWiki was created in 2004 by Andreas Gohr, a German software developer. He wanted a wiki that was simple to install, easy to maintain, and did not require a database. The first public release was in July 2004. Since then, DokuWiki has grown into one of the most popular wiki engines, with millions of installations worldwide.
The name "DokuWiki" comes from "documentation" — it was designed from the start for project documentation, not encyclopedia-scale content.
DokuWiki vs MediaWiki vs WordPress
Here is a comparison of the three platforms:
| Feature | DokuWiki | MediaWiki | WordPress |
|---|---|---|---|
| Database | None (flat files) | MySQL required | MySQL required |
| Setup time | 5 minutes | 30 minutes | 10 minutes |
| Backup | Copy folder | Database dump | Database + files |
| Version control | Git-friendly | Difficult | Difficult |
| Revision history | Built-in, file-based | Built-in, DB-based | Plugin required |
| ACL permissions | Per-namespace, per-page | Group-based | Role-based |
| Plugin ecosystem | 1,000+ plugins | 2,000+ extensions | 60,000+ plugins |
| Best for | Doc sites, small wikis | Wikipedia-scale | Blogs, marketing |
What You Can Build with DokuWiki
- Project documentation: API docs, architecture guides, onboarding manuals
- Internal knowledge base: Company policies, HR guides, IT procedures
- Personal wiki: Notes, bookmarks, research collection
- Team collaboration: Meeting notes, sprint planning, decision logs
- Product documentation: User manuals, FAQs, troubleshooting guides
- Developer docs: Code references, setup guides, deployment runbooks
Architecture Overview
DokuWiki's architecture is simple:
request -> index.php -> action dispatcher -> syntax parser -> cache -> response
|
read .txt file from data/pages/
The index.php file is the entry point. It loads the core libraries, dispatches the requested action (view, edit, save), and renders the output through a template.
Extension Ecosystem
DokuWiki extensions come in two flavors:
- Plugins: Add functionality. There are syntax plugins (extend wiki syntax), action plugins (hook into events), admin plugins (add admin pages), and helper plugins (provide reusable functions).
- Templates: Change the visual appearance. Templates live in
lib/tpl/and consist of PHP files that render the HTML.
Common Mistakes
- Treating DokuWiki like MediaWiki: Expecting DokuWiki to handle millions of pages like Wikipedia. DokuWiki is optimized for documentation-scale, not encyclopedia-scale.
- Ignoring the flat-file limitation: Every page is a file. If you have 100,000 pages in one namespace, the filesystem will slow down. Plan your namespace structure.
- Not using version control: Because DokuWiki uses files, you can put it in Git. Many teams skip this and lose the benefits of code review and change tracking.
- Choosing DokuWiki for unsuitable projects: If you need a blog with comments, e-commerce, or user-generated content, WordPress or a framework might be better.
- Overlooking PHP version requirements: DokuWiki requires PHP 7.4 or later. Some shared hosts still run PHP 5.6. Check before installing.
Practice Questions
- What is the biggest advantage of DokuWiki's flat-file architecture over database-driven wikis like MediaWiki?
- List three types of projects where DokuWiki is a better choice than WordPress.
- How does DokuWiki's backup Process differ from MediaWiki's, and why does this matter for disaster recovery?
- Challenge: Create a decision matrix comparing DokuWiki, MediaWiki, and WordPress for a team of 10 developers who need internal documentation. Consider factors: setup time, backup complexity, search capabilities, permission granularity, maintenance overhead, and cost. Recommend one platform and justify your choice.
FAQ
{{< faq "What programming language is DokuWiki written in?" "DokuWiki is written in {{< ilink "PHP" >}}. It requires no database — all content, configuration, and revision history is stored as text files. It runs on any web server that supports PHP 7.4 or later." >}}
Mini Project
Goal: Analyze an existing wiki to understand its architecture.
- Find any DokuWiki-based site (many open-source projects use it — look for the DokuWiki logo or "Powered by DokuWiki" footer)
- Explore the site structure: what namespaces do you see in the URLs?
- Note the features available: search, sidebar, page revisions, user login
- Check the page URL format — do you see
?id=namespace:pagenamein the URL? - Write a paragraph explaining why that project chose DokuWiki based on what you observe about the content type and audience
What's Next
Now that you understand what DokuWiki is, proceed to installing DokuWiki on your server. After installation, explore the folder structure to understand how DokuWiki organizes its files.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro