Install DokuWiki Inside Docker Container in Linux

Install DokuWiki Inside Docker Container in Linux

DokuWiki is a web-based wiki application written in the PHP programming language. The DokuWiki is an open-source software that released under the GPLv2 license.

This tutorial explains how to install DokuWiki inside a Docker container in the Linux. Commands have been tested on Ubuntu.

Prepare environment

Make sure you have installed Docker in your system. If you are using Ubuntu, installation instructions can be found in the post.

Install DokuWiki

Before starting, create directory for data:

sudo mkdir -p /opt/dokuwiki/data

Set user, which ID is 1001 as owner for newly created directory:

sudo chown -R 1001:1001 /opt/dokuwiki

Note: it doesn't matter that user (ID: 1001) doesn't exist on host system. This user will be created in the container.

  • Host network

Run the following command to create a container for DokuWiki that uses host network:

docker run -d --name=dokuwiki --restart=always --network=host \
    -v /opt/dokuwiki/data:/bitnami/dokuwiki \
    -e DOKUWIKI_USERNAME=admin \
    -e DOKUWIKI_PASSWORD=pwd123 \
    bitnami/dokuwiki
  • User-defined bridge network

User-defined bridge network can be used for listening on different port. By default, DokuWiki service is listening on port 8080. It can be changed with -p option.

docker network create app-net
docker run -d --name=dokuwiki --restart=always --network=app-net \
    -p 8081:8080 \
    -v /opt/dokuwiki/data:/bitnami/dokuwiki \
    -e DOKUWIKI_USERNAME=admin \
    -e DOKUWIKI_PASSWORD=pwd123 \
    bitnami/dokuwiki

Note: don't forget to change user password.

Testing DokuWiki

Open a web browser and go to http://<IP_ADDRESS>:8080, where <IP_ADDRESS> is the IP address of the system. Log in to the web interface using username and password.

DokuWiki Inside Docker Container in Linux

Uninstall DokuWiki

To completely remove DokuWiki, remove its container:

docker rm --force dokuwiki

Remove DokuWiki image:

docker rmi bitnami/dokuwiki

You can also remove DokuWiki data:

sudo rm -rf /opt/dokuwiki

If a user-defined bridge network was created, you can delete it as follows:

docker network rm app-net

Leave a Comment

Cancel reply

Your email address will not be published.