DokuWiki Folder Structure — Data, Config, and File Permissions Explained
In this tutorial, you'll learn the DokuWiki folder structure in detail — where pages are stored, how configuration files work, how plugins and templates are organized, and the correct file permissions for each directory.
What You'll Learn
- The top-level directory layout of a DokuWiki installation
- How
data/pages/maps to wiki namespaces and page IDs - How configuration files in
conf/control every aspect of DokuWiki - The plugin and template organization in
lib/ - Required file permissions for each directory
- How to safely change permissions for security
Why It Matters
Understanding the folder structure is essential for troubleshooting, backups, security hardening, and custom development. When something breaks — a page won't save, a plugin won't install, a template won't render — the error is almost always related to file permissions or a misplaced file. Knowing which directory does what saves hours of debugging.
Real-World Use
A system administrator needs to migrate a DokuWiki installation to a new server. Because they understand the folder structure, they know exactly which directories to copy: data/ for all content and media, conf/ for configuration, and lib/plugins/ and lib/tpl/ for extensions. They skip inc/ and vendor/ because those are DokuWiki core files that will be replaced by the new version. The Migration takes 10 minutes instead of an hour.
Learning Path
flowchart LR A[Installation] --> B[Folder Structure] B --> C[First Wiki Page] C --> D[Syntax] D --> E[Links and Images] E --> F[Tables] F --> G[Media Management]
Top-Level Directory Layout
When you list the contents of your DokuWiki installation, you see:
dokuwiki/
├── bin/ # CLI scripts (indexer, upgrade, plugin manager)
├── conf/ # Configuration files (acl.auth.php, local.php, users.auth.php)
├── data/ # User-generated content (pages, media, cache, index, meta)
├── inc/ # DokuWiki core PHP files (do not modify)
├── lib/ # Extensions (plugins, templates, third-party scripts)
├── vendor/ # Composer dependencies (do not modify)
├── index.php # Main entry point
├── doku.php # Legacy entry point
└── install.php # Installer (delete after installation)
Each of these directories has a specific purpose. Let's go through them.
The data/ Directory (User Content)
The data/ directory is where all user-generated content lives. This is the most important directory for backups.
data/
├── attic/ # Old revisions of pages (compressed)
├── cache/ # Rendered HTML cache files
├── index/ # Full-text search index files
├── locks/ # Page lock files (prevent concurrent edits)
├── media/ # Uploaded images and files
├── meta/ # Metadata (change log, permissions, references)
├── pages/ # Wiki page .txt files
├── tmp/ # Temporary files
└── changes.log # Full change history (all revisions)
data/pages/ (Page Content)
Each wiki page is a .txt file. Namespaces become subdirectories:
data/pages/
├── start.txt # Main start page (namespace:")
├── sidebar.txt # Sidebar content (namespace:")
├── wiki/
│ ├── welcome.txt # wiki:welcome
│ └── syntax.txt # wiki:syntax (built-in syntax reference)
├── projects/
│ ├── start.txt # projects:start (namespace start page)
│ └── roadmap.txt # projects:roadmap
└── development/
├── start.txt # development:start
└── api/
├── start.txt # development:api:start
└── authentication.txt # development:api:authentication
The colon (:) in page IDs maps to directory separators. projects:roadmap means the file data/pages/projects/roadmap.txt.
data/media/ (Uploaded Files)
Uploaded images and files are stored in data/media/:
data/media/
├── wiki/ # Default namespace for wiki images
│ ├── logo.png
│ └── screenshot.jpg
├── projects/
│ ├── diagram.png
│ └── report.pdf
└── development/
└── architecture.svg
data/attic/ (Old Revisions)
When you save a page, the previous version is compressed and moved to attic/. The filename includes a timestamp:
data/attic/
└── projects/
└── roadmap.20260628.123456.txt.gz
This file is the version of projects:roadmap.txt saved on 2026-06-28 at 12:34:56.
data/meta/ (Metadata)
Each page has a corresponding .meta file and .changes file:
data/meta/
└── projects/
├── roadmap.changes # Change log (date, editor, summary, type)
└── roadmap.meta # Metadata (permissions, date, editor)
The conf/ Directory (Configuration)
The conf/ directory contains all configuration files:
conf/
├── acl.auth.php # Access control list rules
├── doku.php # Default configuration values (do not edit)
├── local.php # User-defined configuration overrides
├── local.php.dist # Template for local.php
├── users.auth.php # User accounts (username:hash:name:email:groups)
├── users.auth.php.dist # Template for users.auth.php
└── preload.php # Optional preload configuration
local.php
This is the main configuration file. Settings here override the defaults in conf/doku.php:
<?php
$conf['title'] = 'My Wiki';
$conf['lang'] = 'en';
$conf['template'] = 'bootstrap3';
$conf['useacl'] = 1;
$conf['superuser'] = '@admin';
Do not edit conf/doku.php directly — your changes will be lost on upgrade. Use local.php instead.
acl.auth.php
Defines access control rules for users and groups:
* @ALL @1 # Everyone can read
* @user @8 # Users can edit
@admin @user @16 # Admins have full access
@projects @admin @16 # Admin-only namespace
users.auth.php
Stores user account information in a text file format:
admin:$2y$10$...hash...:Admin User:admin@example.com:admin,@group1
jdoe:$2y$10$...hash...:John Doe:john@example.com:user
The lib/ Directory (Extensions)
lib/
├── plugins/ # Installed plugins (each in its own folder)
├── tpl/ # Installed templates (each in its own folder)
└── scripts/ # JavaScript and third-party libraries
Plugins
Each plugin is a subdirectory under lib/plugins/:
lib/plugins/
├── acl/ # ACL admin plugin (built-in)
├── authplain/ # Plain text authentication (built-in)
├── blog/ # Blog plugin (optional, install separately)
├── gallery/ # Gallery plugin (optional)
└── tag/ # Tag plugin (optional)
Templates
Each template is a subdirectory under lib/tpl/:
lib/tpl/
├── dokuwiki/ # Default template
└── bootstrap3/ # Bootstrap3 template (optional, install separately)
The inc/ Directory (Core)
The inc/ directory contains all DokuWiki core PHP files:
inc/
├── actions/ # Action handler classes
├── auth/ # Authentication backend classes
├── lang/ # Language files
├── parser/ # Syntax parser
├── template/ # Template functions
├── init.php # Bootstrap initialization
├── common.php # Common utility functions
└── pageutils.php # Page manipulation functions
Never modify files in inc/. Your changes will be overwritten on the next update, and they can cause security issues.
File Permissions Reference
Here is the correct permission scheme for a production DokuWiki:
| Directory | Permissions | Owner | Notes |
|---|---|---|---|
| conf/ | 755 (dirs), 644 (files) | www-data | Read for web server, write only on config changes |
| data/ | 777 (dirs), 666 (files) | www-data | Must be writable for page creation and editing |
| data/pages/ | 777 | www-data | Page file creation and editing |
| data/media/ | 777 | www-data | File uploads |
| data/attic/ | 777 | www-data | Revision storage |
| data/cache/ | 777 | www-data | Cache file creation |
| data/index/ | 777 | www-data | Search index updates |
| data/locks/ | 777 | www-data | Page locking |
| data/meta/ | 777 | www-data | Metadata updates |
| lib/plugins/ | 755 (dirs), 644 (files) | www-data | Write only when installing plugins |
| lib/tpl/ | 755 (dirs), 644 (files) | www-data | Write only when installing templates |
| inc/ | 755 (dirs), 644 (files) | root | Read-only |
| vendor/ | 755 (dirs), 644 (files) | root | Read-only |
The most permissive setting is 777 for data/ and all its subdirectories. On production servers with strict security requirements, you can use 775 with the web server group owner.
Common Mistakes
- Editing conf/doku.php instead of conf/local.php: The file
doku.phpcontains defaults. Custom settings go inlocal.php. If you editdoku.php, your changes are lost on upgrade. - Setting overly restrictive permissions on data/: If the web server cannot write to
data/, pages will not save. The error message "Failed to save page" usually means a permissions problem. - Modifying files in inc/: Core files should never be edited. Use plugins or configuration overrides instead. Core modifications break on updates.
- Not backing up data/ separately: The
data/directory is the only directory you need for backups. Backing up the entire installation wastes space on core files that can be re-downloaded. - Leaving files world-writable unnecessarily: While
data/needs permissive access, other directories likeconf/should be restricted after initial setup.
Practice Questions
- Which directory contains all wiki page content, and what is the relationship between page IDs and the file system?
- What is the difference between
conf/doku.phpandconf/local.php, and why should you never edit the former? - Where are old page revisions stored, and what naming convention do they follow?
- Challenge: Create a script that analyzes a DokuWiki installation and reports: total page count by namespace, total media files by type, total revision count, total cache size, and a list of files with incorrect permissions. The script should output a summary table.
FAQ
Mini Project
Goal: Map your DokuWiki installation's folder structure.
- List the top-level directories of your DokuWiki installation
- Navigate to
data/pages/and identify all existing pages and namespaces - Navigate to
data/media/and identify uploaded files - View the contents of
conf/local.php— what settings are configured? - View the contents of
conf/acl.auth.php— what rules are defined? - Check the permissions on
data/pages/and note the owner, group, and permission bits - Create a diagram (using Mermaid or a text-based tree) showing your DokuWiki's folder structure
What's Next
Now you know where everything lives. Create your first wiki page and learn the basics of DokuWiki syntax.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro