It's better when it's simple

User Tools

Site Tools


Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community

Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy


This is an old revision of the document!

Custom Installation

:!: For Ubuntu 16.04 you will want to use libapache2-mod-php7.0 and make sure to install php7.0-xml, php7.0 with apt-get

This is an example for Ubuntu 14.04.

  1. Install Ubuntu Server 14.04 Step by step instructions with screenshots
  2. Update & Upgrade Ubuntu.
    sudo apt-get update && sudo apt-get upgrade
  3. Install Apache2 and PHP.
    sudo apt-get install apache2 libapache2-mod-php5
  4. Enable Apache Rewrite module.
    sudo a2enmod rewrite
  5. Download and uncompress the latest stable release.
    cd /var/www
    sudo wget
    sudo tar xvf dokuwiki-stable.tgz
    sudo mv dokuwiki-*/ dokuwiki
  6. Change permissions.
    sudo chown -R www-data:www-data /var/www/dokuwiki
  7. Change document root in Apache to point to /var/www/dokuwiki
    sudo nano /etc/apache2/sites-enabled/000*.conf

    DocumentRoot /var/www/html
    DocumentRoot /var/www/dokuwiki

    1. If you want to host a DokuWiki server on localhost for testing purposes do NOT change the content of /etc/apache2/sites-enabled/000*.conf, instead create a new file in
      sudo touch apache2-dokuwiki.conf

      with the following content:

              DocumentRoot /var/www/dokuwiki
       	ServerName localhost
    2. enable the new project by placing it into /etc/apache2/sites-enabled with
      sudo a2ensite apache2-dokuwiki
    3. and then reload apache2 service
      sudo service apache2 reload
  8. Change AllowOverrides setting in Apache2 to use .htaccess files for security.
    sudo nano /etc/apache2/apache2.conf
    1. For directory /var/www/ replace
      AllowOverride None
      AllowOverride All
  9. Restart Apache2 service.
    sudo service apache2 restart
  10. Visit http://IP-address-of-your-server/install.php to initially configure your DokuWiki.
    1. If you decided to host DokuWiki on localhost for testing purposes from point 7a-c, visit
  11. Delete the install.php file after finished installing.
    sudo rm /var/www/dokuwiki/install.php
  12. Needed for sending email (e.g. user registration): install sendmail program, e.g. postfix
    sudo apt-get install postfix

    and configure appropriately

  13. Enjoy your own DokuWiki server.

Additional Installation Information

For more information on installing and configuring Dokuwiki on Ubuntu, see debian_ubuntu_extras.

Ubuntu 12.04 Precise Pangolin

Ubuntu provides a dokuwiki package.

The package will install three categories of files:

  • immutable files in /usr/share/dokuwiki
  • configuration files in /etc/dokuwiki
  • data files and plugins in /var/lib/dokuwiki

Install it. I used Ubuntu 12.04.5.

sudo apt-get install -y dokuwiki

This will prompt you for which webserver to use, Apache 2 or lighttpd. Pick one. It will also prompt you for the admin password. Choose one and enter it.

If you're lucky, installation is done, and you can start using DokuWiki at http://localhost/dokuwiki.

If not, you will need to make further changes to your webserver configuration. I used Apache 2, and what the package does is add a symlink

/etc/apache2/conf.d/dokuwiki.conf -> /etc/dokuwiki/apache.conf

that maps the http://localhost/dokuwiki* URL space to DokuWiki and grants access only to localhost. I edited the file to provide wider access and also had to edit rewrite rules elsewhere in my Apache configuration that counteracted this.

After that, I could log in as admin and edit pages.

Note that running http://localhost/dokuwiki/install.php will report permission errors on directories that don't actually exist.

This is harmless - it is just install.php not being smart enough to detect that the directories in question are located elsewhere. You don't actually need to run install.php or fix these things like the text below suggests.

Apache configuration for running DokuWiki in ~/public_html

This works with Ubuntu 11.04 natty:

  1. Install apache2 and the php5 module:
    sudo apt-get install apache2 libapache2-mod-php5
  2. Enable the userdir and rewrite modules:
    sudo a2enmod userdir
    sudo a2enmod rewrite
  3. To make your .htaccess work, edit /etc/apache2/mods-enabled/userdir.conf and change the AllowOverride directive to All1)
  4. By default, php is disabled for user directories. To enable it, comment the lines as per instruction in /etc/apache2/mods-enabled/php5.conf
  5. Restart apache with
    sudo service apache2 restart

Ubuntu Server 14.04 and lighttpd

  1. Install lighttpd and php.
    sudo apt-get install lighttpd 
    sudo apt-get install php5-cgi 
  2. Download dokuwiki, and place in www directory. Change file name appropriately as your downloaded file is placed and named.
    tar xvfz dokuwiki.tgz 
    ls -l
    sudo cp -r dokuwiki/ /var/www/
    sudo chown -R www-data:www-data /var/www/dokuwiki
  3. Configure lighttpd for php.
    sudo lighttpd-enable-mod fastcgi-php
    sudo /etc/init.d/lighttpd force-reload
  4. That's it. Enjoy your own DokuWiki server. (Test if it works on your http://localhost/dokuwiki)
FIXME: someone with more apache savvy than me can probably suggest a “safer” setting for AllowOverride
install/ubuntu.1489346342.txt.gz · Last modified: 2017-03-12 20:19 by 2601:646:8c03:7dd0:b57e:fdfa:e891:913d