
Setting up a DokuWiki instance on Ubuntu 20.04 involves a series of steps to prepare your server environment, download the wiki software, and configure it correctly. This process ensures you have a functional and accessible wiki for documentation or collaboration.
First, begin by ensuring your Ubuntu system is up-to-date. Open your terminal and run the commands sudo apt update
followed by sudo apt upgrade
. This fetches the latest package lists and upgrades existing packages to their newest versions, which is crucial for security and compatibility.
Next, you need to install the necessary web server software. Apache is a common choice for serving web content. Install Apache along with PHP and several required PHP extensions that DokuWiki depends on. Execute a command similar to sudo apt install apache2 php libapache2-mod-php php-gd php-xml php-zip
. This installs the Apache web server, the core PHP engine, the Apache PHP module, and essential extensions for image handling, XML parsing, and archive management needed by DokuWiki. After installation, ensure Apache is running using sudo systemctl status apache2
.
Now, you need to download DokuWiki. Visit the official DokuWiki website to get the URL for the latest stable release archive (usually a .tgz file). Use the wget
command in your terminal to download this file directly to your server, perhaps in a temporary directory like /tmp
.
Once downloaded, you need to extract the DokuWiki files to your web server’s document root. For Apache on Ubuntu, the default document root is typically /var/www/html
. Use the tar
command to extract the downloaded archive. For example, if the file is in /tmp
, navigate there and run sudo tar xzf dokuwiki-stable.tgz -C /var/www/html/
. This extracts the contents into a new directory within /var/www/html
. It’s good practice to rename this directory to something simpler, like wiki
, using sudo mv /var/www/html/dokuwiki-stable /var/www/html/wiki
.
Setting correct file permissions is a critical step for DokuWiki to function properly and securely. The web server process (usually www-data
user and group on Ubuntu) needs write access to certain directories for configuration and data storage. Use commands like sudo chown -R www-data:www-data /var/www/html/wiki
to change the ownership of the DokuWiki directory and its contents to the web server user. Specific directories (data
, conf
, media
, index
) might need more precise permissions, often granted implicitly by the ownership change, but check DokuWiki’s documentation for fine-grained settings if needed.
With the files in place and permissions set, you can now access the web-based installer. Open a web browser and navigate to the URL corresponding to your server’s IP address or domain name, followed by the directory name where you extracted DokuWiki (e.g., http://your_server_ip/wiki/install.php
). The installer will guide you through setting up your wiki name, creating an administrator user account (including setting a strong password), choosing the license, and configuring basic settings.
Complete the installation via the web interface. Crucially, after the installation is finished, you must remove or rename the install.php
file from your DokuWiki directory for security reasons. You can do this via the terminal using sudo rm /var/www/html/wiki/install.php
.
Your DokuWiki instance should now be accessible at http://your_server_ip/wiki/
. You can log in with the administrator account you created and begin populating your wiki content. Remember to keep your server, Apache, PHP, and DokuWiki installations updated regularly to maintain security and stability.
Source: https://kifarunix.com/install-and-setup-dokuwiki-on-ubuntu-20-04/