Wiki-style documentation has grown in popularity over the past decade. Community-editable documentation projects offer a system that can distribute the workload among contributors, can be made publicly or privately accessible, and can scale easily.

There are many different wiki applications that each have their strengths depending on your needs. One choice is DokuWiki, which is a very light-weight wiki that can be set up easily. DokuWiki uses a simple file format to store its data, so it does not require you to maintain a database. This makes migrating and scaling trivial.

In this guide, we will discuss how to install DokuWiki with an Nginx server on an Ubuntu VPS.

Step 1 – Update the system and install necessary packages

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

How To Install DokuWiki with Nginx on an Ubuntu VPS

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

How To Install DokuWiki with Nginx on an Ubuntu VPS 2

Step 2 – Install and configure PHP and required PHP modules

DokuWiki is written in PHP, so we will need to install some components to get this to work well. Unlike Apache, Nginx does not include a module that can handle PHP processing, so instead, it offloads that work onto a separate, dedicated component. To install the latest stable version of PHP version 7 and all necessary modules, run:

How To Install DokuWiki with Nginx on an Ubuntu VPS 3

We need to tighten up some security on the service so that when a request is made for a PHP file that does not exist, the processor does not simply execute other files that may be similar. Open up the configuration file with root privileges:

How To Install DokuWiki with Nginx on an Ubuntu VPS 4

Search for and adjust the cgi.fix_pathinf=o parameter. Save and close the file when you are done.

Create a new PHP-FPM pool for your user:

How To Install DokuWiki with Nginx on an Ubuntu VPS 5

Do not forget to change your_user with your username. Save and close the file.

Now, configuration on the PHP side is complete. Restart the service to implement the changes we made:

How To Install DokuWiki with Nginx on an Ubuntu VPS 6

Step 3 – Install Nginx and Certbot-Auto

Let’s install nginx webserver and certbot-auto which we’ll later use to get a certificate for DokuWiki site.

How To Install DokuWiki with Nginx on an Ubuntu VPS 7

Step 4 – Install and Configure DokuWiki

Open https://myDokuWiki.org/install.php in your favorite web browser and you should see the DokuWiki install screen. On this page you’ll need to enter your Wiki name, enable ACL and create a superuser. In your user’s home directory, we can download the latest stable version of DokuWiki by typing these commands:

Extract DokuWiki archive using tar

How To Install DokuWiki with Nginx on an Ubuntu VPS 9

Let’s change the name of the directory to whatever path we’d like to access our wiki from.

We should move our directory into our web root. This will allow us to access our server by typing our domain followed by /wiki. Move the directory now:

Before we continue, we need to do some additional security steps, or the installer will complain that it cannot access certain areas. Change to the directory you just moved:

The web process needs to have certain access to some files and directories within the wiki structure.

How To Install DokuWiki with Nginx on an Ubuntu VPS 13

Now, we are ready to install DokuWiki through the web browser using an installer script.

Step 5 – Configure DokuWiki on Ubuntu

Start DokuWiki configuration by opening the link: https://wiki.mydomain/install.php, you will get installation page like below:

Provide admin user details, under,Initial ACL policy choose your policy from one of:

Open Wiki – Open for everyone
Public Wiki – read for all, uploads and edits for registered users
Closed Wiki – Access only for registered users

Click on the “Save” button at the bottom when you are finished. When done, click Save. The wiki page should now be ready.

Step 6 – Adding users to DokuWiki

If you had selected “Closed Wiki | Public” as your ACL policy, you will be given login page for edits. Log in with admin account you created earlier to start adding other users to the system:

Click “Admin” icon at the top of the page, this will take you to admin page:

How To Install DokuWiki with Nginx on an Ubuntu VPS 17

Click on “User Manager” and add user on page:

Add User details and click “Add” button. After adding a user, you can assign ACL on “Access Control List Management” page and select from given Permissions.

You should now have a wiki set up and running on your system. DokuWiki can be easily extended and themed using plugins and templates respectively. Adding content and configuring your site is easy by logging into an administrative account and implementing changes through the interface.

Leave a Reply

Your email address will not be published. Required fields are marked *