In this tutorial, we will show you how to install DokuWiki on Debian 11. For those of you who didn’t know, DokuWiki is a free open source wiki application written completely in the PHP programming language and often deployed in Linux under the LAMP stack. It offers very useful features such as multiple language support, SEO, authentication, spam blacklist, autosave, read-only pages, simple and lightweight architecture, and more.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you through the step-by-step installation of the DokuWiki on a Debian 11 (Bullseye).
Prerequisites
- A server running one of the following operating systems: Debian 11 (Bullseye).
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install DokuWiki on Debian 11 Bullseye
Step 1. Before we install any software, it’s important to make sure your system is up to date by running the following apt
commands in the terminal:
sudo apt update sudo apt upgrade
Step 2. Installing the LAMP stack.
A Debian 11 LAMP server is required. If you do not have LAMP installed, Please read our previous tutorial to install LAMP Server on Debian 11.
Step 3. Installing DokuWiki on Debian 11.
Now we download the latest version of DokuWiki from the official page using wget
command:
wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
Next, extract the downloaded file using the below command:
mkdir /var/www/html/dokuwiki tar -xvzf dokuwiki-stable.tgz -C /var/www/html/dokuwiki/ --strip-components=1
Then, copy some necessary files using the following command:
cp /var/www/html/dokuwiki/.htaccess{.dist,}
We will need to change some folder permissions:
chown -R www-data:www-data /var/www/html/dokuwiki
Step 4. Configure Apache Virtual Host for DokuWiki.
Now we create an Apache virtual host configuration file to host DokuWiki:
nano /etc/apache2/sites-available/dokuwiki.conf
Add the following lines:
<VirtualHost *:80> ServerName dokuwiki.your-domain.com DocumentRoot /var/www/html/dokuwiki <Directory ~ "/var/www/html/dokuwiki/(bin/|conf/|data/|inc/)"> <IfModule mod_authz_core.c> AllowOverride All Require all denied </IfModule> <IfModule !mod_authz_core.c> Order allow,deny Deny from all </IfModule> </Directory> ErrorLog /var/log/apache2/dokuwiki_error.log CustomLog /var/log/apache2/dokuwiki_access.log combined </VirtualHost>
Save and close, then restart the Apache webserver so that the changes take place:
sudo a2ensite dokuwiki.conf sudo a2enmod rewrite sudo systemctl reload apache2
Step 5. Configure DokuWiki with Let’s Encrypt SSL.
First, install Certbot to your Debian system using the following command below:
sudo apt install certbot python3-certbot-apache
Once the Certbot client has been installed successfully, run the following command below to install the Let’s Encrypt SSL:
certbot --apache -d dokuwiki.your-domain.com
You will then be prompted to enter an email address for the certificate. After you have entered that you must agree to the T&C’s and decide if you want to share your email address with the Electronic Frontier Foundation.
Output:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations! You have successfully enabled https://dokuwiki.your-domain.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=dokuwiki.your-domain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/dokuwiki.your-domain.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/dokuwiki.your-domain.com/privkey.pem Your cert will expire on 2021-01-25. To obtain a new or tweaked version of this certificate in the future, simply run certbot again with the "certonly" option. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-le
Next, we set up a cron job to auto-renew the SSL certificate:
certbot renew --dry-run
You can set up a cron job to auto-renew SSL certificate every day at 12:00 AM by editing the following file:
crontab -e
Add the following line:
00 12 * * * root /usr/bin/certbot renew >/dev/null 2>&1
Step 6. Accessing DokuWiki Web Interface.
Once successfully installed, open your web browser and type the URL https://dokuwiki.your-domian.com/install.php
. You should see the DokuWiki installation screen:
Congratulations! You have successfully installed DokuWiki. Thanks for using this tutorial for installing the latest version of DokuWiki on the Debian system. For additional help or useful information, we recommend you check the official DokuWiki website.