DokuWiki is a free and open source wiki software written in PHP. DokuWiki is highly versatile and doesn’t require a database since it works on plain text files. It has a syntax similar to the one used by MediaWiki. This guide will cover the steps to install DokuWiki on Ubuntu 22.04|20.04|18.04 with Nginx and Letsencrypt SSL certificate for encryption.

DokuWiki installation pre-requisites:

  • Updated system
  • PHP and php-fpm
  • Nginx or Apache web server
  • certbot-auto for requesting a Certbot certificate

Let’s kick off by making sure all software requirements are installed.

Step 1: Update system packages

Make sure your apt index and all software packages are updated.

sudo apt update

After rebooting the system, set system hostname and proceed to install php and all required modules:

sudo hostnamectl set-hostname wiki.example.com

Step 2: Install php and required modules

We now need to install php and some php modules required by DokuWiki. Run the following commands to get everything installed.

sudo apt -y install php php-curl php-apcu php-fpm php-bcmath php-gd php-intl php-pear php-imap php-memcache libapache2-mod-php php-pspell php-tidy php-xmlrpc php-mbstring php-gmp php-json php-xml php-common

Confirm the version of PHP on your system.

$ php -v
PHP 8.1.2 (cli) (built: Aug  8 2022 07:28:23) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies

To get a list of php extensions installed on your system, use php -m command:

php -m

Step 3: Install Nginx and certbot-auto

Let’s install nginx webserver and certbotwhich we’ll later use to get a certificate for DokuWiki site.

sudo apt update
sudo apt install wget nginx certbot

Step 4: Download and Install DokuWiki

Before downloading any version of DokuWiki, check Downloads page for the latest stable release.