As a Debian user, you will learn how to install DokuWiki on Debian 11. DokuWiki is a free and open-source wiki software which runs without a database. DokuWiki is platform independent software written in PHP and it is easy to install and use.
Features of DokuWiki
- High usability
- Access Control and Anti-Spam Measures
- Multiple language support
- Fast: full text search and page caching
- Extensible with multiple layout templates, plugins and community support
- Easy integration: No database, syndication and backend integration
Continue with the article to install DokuWiki on Debian 11.
Prerequisites
Because DokuWiki is written in PHP, you will need to have PHP and a web server installed. A stable internet for downloading packages and root privileges for installation are also needed.
Install PHP
- Update system packages to prevent dependency issues
sudo apt update && sudo apt upgrade -y
- Install PHP 7.4 and required modules because PHP 8 is not full supported and minimum supported version is PHP 5.6.
sudo apt install php7.4 php7.4-gd php7.4-xml php7.4-json libapache2-mod-php7.4 -y
Install Apache Web Server
- Apache2 comes already installed on Debian 11. You can confirm if it is installed by running the command.
which apache2
- If a path is printed, it is installed, otherwise, it is not. So install it:
sudo apt install apache2 -y
- Start and enable apache2 server
sudo systemctl enable --now apache2
Install DokuWiki on Debian 11
There is DokuWiki package make it easy for installation. Download the latest version from DokuWiki download’s page.
- Alternatively, get the package using
wget
command.
wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
- Create a folder to store DokuWiki files
sudo mkdir -p /var/www/html/dokuwiki
- Unpack the files to the folder you have created
sudo tar xzf dokuwiki-stable.tgz -C /var/www/html/dokuwiki/ --strip-components=1
- Now copy required files for running DokuWiki
sudo cp /var/www/html/dokuwiki/.htaccess{.dist,}
- Grant DokuWiki ownership to the DokuWiki directory
sudo chown -R www-data: /var/www/html/dokuwiki
Secure DokuWiki with Let’s Encrypt SSL- optional
To secure your wiki site using Let’s Encrypt SSL certificate, install Certbot client.
- You can install the Certbot with the following command:
sudo apt-get install certbot python3-certbot-apache -y
- After installing Certbot, run the following command to install the Let’s Encrypt SSL for your site, for instance
localhost
sudo certbot --apache -d localhost
Create Apache VirtualHost for DokuWiki
- Create a new file in
/etc/apache2/sites-available
directory.
sudo nano /etc/apache2/sites-available/apache2-dokuwiki.conf
- Copy the content below and replace localhost with the your server name
<VirtualHost *:80> ServerName localhost 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>
- Enable the virtual host configuration
sudo a2ensite apache2-dokuwiki
- Restart apache2 server
sudo service apache2 reload
Finish DokuWiki installation
In your browser, type in the URL http://your-server-name/install.php
i.e. http://localhost/install.php
Input the details to access DokuWiki. Select the correct ACL policy and click save.
Once the installation is complete, click on continue to your new DokuWiki.
You will be greeted with the welcome screen. Click on log in to access the admin interface.
Login page loads as shown below. Enter your credentials
Your will be directed to the dashboard. Click on admin to open the page below.
You can now delete the install.php file.
sudo rm /var/www/dokuwiki/install.php
Conclusion
That is it. You have managed to install DokuWiki in Debian 11 and configure it. Find more advanced features on DokuWiki documentation
Other interesting articles
Install DHCP Server on Debian 11
Install CapRover on Debian 11
Install Hestia Control Panel on Debian 11