DokuWiki Installation and Setup — Server Requirements and Install Guide
In this tutorial, you'll install DokuWiki on your web server, walk through the web-based install.php wizard, and perform post-installation security steps to protect your wiki.
What You'll Learn
- System requirements for running DokuWiki (PHP version, extensions, web server)
- Downloading and extracting the latest DokuWiki release
- Setting correct file permissions for the web server user
- Running the install.php setup wizard
- Configuring the initial wiki name, admin user, and ACL settings
- Post-installation security: deleting install.php and locking down permissions
Why It Matters
DokuWiki installation is famously simple, but skipping steps creates security holes. The most common DokuWiki compromise starts with leaving install.php accessible. Understanding each step of the process ensures your wiki is secure from day one. The entire setup takes under five minutes when done correctly.
Real-World Use
A small business owner sets up DokuWiki for internal IT documentation. They download the latest release, upload it to their shared hosting account, run the installer, and delete install.php. Total time: 4 minutes. No database setup, no configuration file editing, no support tickets. Their wiki is live and they are writing documentation before MediaWiki would even finish its database Migration.
Learning Path
flowchart LR A[What is DokuWiki] --> B[Installation] B --> C[Folder Structure] C --> D[First Wiki Page] D --> E[Syntax] E --> F[Links and Images]
System Requirements
Before installing DokuWiki, verify that your server meets these requirements:
| Component | Requirement |
|---|---|
| PHP | 7.4 or later (PHP 8.0+ recommended) |
| PHP Extensions | standard PHP build (no special extensions needed) |
| Web server | Apache, Nginx, IIS, or any PHP-capable server |
| Disk space | 100 MB for base installation (more for media files) |
| Permissions | Write access to data/, conf/, and lib/plugins/ |
No database is required. No MySQL, PostgreSQL, or SQLite. This is the defining feature of DokuWiki.
To check your PHP version, run:
php --version
Downloading DokuWiki
Download the latest stable release from the official site:
# Download the latest stable release
wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
# Extract the archive
tar -xzf dokuwiki-stable.tgz
# Move to your web directory
mv dokuwiki-*/ /var/www/html/wiki
# Navigate into the installation
cd /var/www/html/wiki
After extraction, you will see the following top-level items:
dokuwiki/
├── bin/ # CLI scripts
├── conf/ # Configuration files
├── data/ # Pages, media, cache, index
├── inc/ # Core PHP files
├── lib/ # Plugins, templates, scripts
├── vendor/ # Third-party dependencies
├── index.php # Entry point
├── install.php # Installer (DELETE after use)
└── doku.php # Legacy entry point
Setting Permissions
DokuWiki needs write access to data/, conf/, and lib/plugins/. The web server user (typically www-data on Debian/Ubuntu or apache on RHEL) must own or have write permission on these directories.
# Set ownership to web server user
chown -R www-data:www-data /var/www/html/wiki
# Set directory permissions
chmod -R 755 /var/www/html/wiki
# Ensure writable directories
chmod -R 777 /var/www/html/wiki/data
chmod -R 777 /var/www/html/wiki/conf
chmod -R 777 /var/www/html/wiki/lib/plugins
On shared hosting, you may not have chown access. In that case, set permissions to 777 for these directories.
Running the Installer
Navigate to your wiki's URL in a browser:
http://yourserver/wiki/install.php
The installer walks through four sections:
1. Wiki Name
Enter a name for your wiki. This appears in the page title and the sitenotice area.
2. Admin User
Create the initial admin account:
- Username: Choose a username (avoid "admin" for security)
- Real name: Your full name (optional)
- Email: A valid email address
- Password: Choose a strong password (12+ characters, mixed case, numbers, symbols)
- Password (again): Confirm
3. ACL Policy
Choose an initial ACL policy:
- Open wiki: Anyone can read and edit (not recommended for production)
- Public wiki: Anyone can read, only registered users can edit
- Closed wiki: Only registered users can read and edit
For most use cases, choose "Public wiki" — this allows visitors to read without logging in but requires authentication for editing.
4. Run Installer
Click "Run installer." The installer creates the initial configuration files and the admin user account.
Post-Installation Steps
Delete install.php
This is the most important step:
rm /var/www/html/wiki/install.php
If you leave install.php accessible, anyone can rerun the installer and change your configuration or create a new admin account.
Verify ACL Configuration
Check that ACL is working by logging out and trying to edit a page. You should be prompted to log in.
Test Media Upload
Upload an image through the Media Manager to verify file upload permissions are working.
Configuring the Web Server
Apache
If using Apache with mod_rewrite, create an .htaccess file in the DokuWiki root (DokuWiki includes one by default). Enable clean URLs:
# conf/.htaccess (DokuWiki ships with this)
RewriteEngine on
RewriteRule ^doku.php/(.*)$ doku.php?id=$1 [QSA,L]
To enable .htaccess files, ensure Apache configuration has:
<Directory /var/www/html/wiki>
AllowOverride All
</Directory>
Nginx
For Nginx, use a configuration like this:
server {
listen 80;
server_name wiki.example.com;
root /var/www/html/wiki;
location / {
try_files $uri $uri/ @dokuwiki;
}
location @dokuwiki {
rewrite ^(.*)$ /doku.php?id=$1 last;
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /(data|conf|bin|inc)/ {
deny all;
}
}
Verifying Installation
Create a test page to verify everything works:
- Log in as the admin user
- Navigate to
http://yourserver/wiki/start - Click "Create this page"
- Type some content and save
If the page saves and displays correctly, your installation is working.
Common Mistakes
- Leaving install.php accessible: This is the most common and most dangerous mistake. Delete install.php immediately after setup.
- Incorrect file permissions: If the web server cannot write to
data/, pages will not save and media uploads will fail. Always verify write permissions. - Not setting an ACL policy: Leaving the wiki completely open invites spam and vandalism. Even for internal wikis, set a minimum ACL policy.
- Using a weak admin password: DokuWiki's admin account has full control. Use a password manager to generate a strong, unique password.
- Running on an unsupported PHP version: DokuWiki 2022+ requires PHP 7.4+. Older PHP versions have known security vulnerabilities.
Practice Questions
- What are the minimum system requirements for running DokuWiki, and how do they differ from MediaWiki's requirements?
- Why must you delete install.php after the installation is complete? What could an attacker do if it remains?
- What is the difference between the "Open wiki," "Public wiki," and "Closed wiki" ACL policies during installation?
- Challenge: Write a bash script that automates the entire DokuWiki installation process: download the latest release, extract it, set permissions, run the installer via CLI (simulate the POST request), and clean up install.php. The script should accept a site name, admin username, and admin password as parameters.
FAQ
Mini Project
Goal: Install DokuWiki on your local machine or server.
- Download the latest DokuWiki release
- Extract and place it in your web server directory
- Set file permissions for the web server user
- Run the installer and create an admin account
- Choose "Public wiki" ACL policy
- Delete install.php
- Create a test page with the content "Hello, Wiki World!"
- Verify the page displays correctly
- Document any issues you encountered and how you resolved them
What's Next
With DokuWiki installed, explore the folder structure to understand how DokuWiki organizes files on disk. Then create your first wiki page.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro