We use DokuWiki and it’s awesome. Our team has an internal knowledgebase and we use DokuWiki to store all our reviews, tutorials etc. It’s simple, easy to install and easy to use. Most importantly, it’s not resource-heavy. In this post, we’re going to show you how to install DokuWiki on an Ubuntu 16.04 server.
Requirements
DokuWiki doesn’t need much since it doesn’t need a database. Here are the requirements of DokuWiki:
- PHP 5.3.4 or newer (PHP 7+ recommended)
- A web server (Apache/Nginx/Any other)
- A VPS. Get a cheap managed VPS and you won’t have to do any of this. Just contact the support team and they will install it for you.
Instructions
Before you do anything, you should upgrade your system. Run the following command:
sudo apt-get update && sudo apt-get upgrade
Install Apache
We are going to need a web server for our wiki. We’ll be using Apache for our tutorial, but you can also use Nginx or any other web server. Install apache with:
apt-get install apache2
Install PHP7 and modules
Next, you should install PHP if you don’t already have it installed. In this tutorial, we’ll be using PHP7. So, install PHP7 and a few other PHP modules with the following command:
apt-get install php7.0-fpm php7.0-cli php-apcu php7.0-gd php7.0-xml php7.0-curl php7.0-json php7.0-mcrypt php7.0-cgi php7.0 libapache2-mod-php7.0
Download and install DokuWiki
Here comes the main part – the actual installation of DokuWiki.
First, create a directory for your DokuWiki:
mkdir -p /var/www/thrwiki
Navigate to the directory you just created:
cd /var/www/thrwiki
Run the following command to download the latest (stable) version of DokuWiki:
wget http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
Unpack the .tgz file:
tar xvf dokuwiki-stable.tgz
Change some file/folder permissions:
www-data:www-data -R /var/www/thrwiki chmod -R 707 /var/www/thrwiki
Configure Apache for DokuWiki
Create a .conf file for your DokuWiki (we’ll name it thrwiki.conf, but you can name it however you want) and open it with your favorite text editor. We’ll be using nano:
touch /etc/apache2/sites-available/thrwiki.conf ln -s /etc/apache2/sites-available/thrwiki.conf /etc/apache2/sites-enabled/thrwiki.conf nano /etc/apache2/sites-available/thrwiki.conf
<VirtualHost yourServerIP:80> ServerAdmin wikiadmin@thishosting.rocks DocumentRoot /var/www/thrwiki/ ServerName wiki.thishosting.rocks ServerAlias www.wiki.thishosting.rocks <Directory /var/www/thrwiki/> Options FollowSymLinks AllowOverride All Order allow,deny allow from all </Directory> ErrorLog /var/log/apache2/wiki.thishosting.rocks-error_log CustomLog /var/log/apache2/wiki.thishosting.rocks-access_log common </VirtualHost>
systemctl restart apache2.service
rm -f /var/www/html/thrwiki/install.php
Feel free to leave a comment below if you need any help.
5 thoughts on “Build your own wiki on Ubuntu with DokuWiki”
I guess to change folder owner and group you should write:
chown www-data:www-data -R /var/www/thrwiki
Also, I use a Docker image to deploy very fast a DokuWiki.
can you explain in detail how you build and deploy a docker image with dokuwiki please?
I’m new to servers and linux, and you say: “Edit the lines to correspond with your server setup. Replace wikiadmin@thishosting.rocks, wiki.thishosting.rocks etc with your own data” how do I get my own information for my own server? I have a server that I program with, not sure if that’s the same thing, but I’m not sure that I have an address that corresponds with it? I hope you can make sense of my question. Thanks.
You’ll first need to own a domain name. You can get one from Namecheap https://thishosting.rocks/neamcheap-review-cheap-domains-cool-names/
After that, you’ll need to configure your domain name’s DNS settings to correspond with your server’s IP.
And finally you’ll need to replace each email and domain mentioned in this post with your own domain name.
For install PHP 7.4
sudo apt update
sudo apt install php php-cli php-fpm php-json php-common php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath
BR