DokuWiki on a USB Stick in 2021

0
125

If you want to run DokuWiki from a portable device like an USB stick on any Windows computer without installing anything on the computer itself – this guide is for you!

First of all download DocuWiki distro from it official website https://download.dokuwiki.org/

I prefer to use “Stable” version. Do not check “MicroApache” box. We don’t need it because it will not work in Windows 10 “out of the box”, we will use the server that comes with the php instead. You can add plug-ins of you choice if you want to.

Next step is to download PHP for Windows (it have build-in webserver) – https://windows.php.net/download/

Download the non-thread-safe version!

That’s all we need for success 🙂

Next steps:

  1. In your personal storage space or on your USB stick, create a folder called “Wiki” or whatever you want to call it.
  2. Create this Windows batch file docuwiki.cmd in the new “Wiki” folder:
    @echo off
     
    set app_root=%~dp0
    set PATH=%app_root%\php;%PATH%
     
    set ext_path=%app_root%\php\ext
    set ini_path=%app_root%\php\php.ini
     
    cd /d "%app_root%\dokuwiki"
     
    php -c "%ini_path%" -d extension_dir="%ext_path%" -S 127.0.0.1:900
  3. Extract the dokuwiki folder from that archive to your “Wiki” folder. If the “dokuwiki” folder has a version number in it, rename it to just “dokuwiki”.
  4. Extract the downloaded PHP for Windows Zip file to a new “php” folder under your “Wiki” folder. (example: copy All php-8.0.1-nts-Win32-vs16-x64 content to php folder)
  5. Download this php.ini file, extract it from Zip archive and put it in your “Wiki\php” folder.
  6. Now you should have a “Wiki” folder like this:
    Wiki
    ├── dokuwiki.cmd
    ├── php
    │   └── [PHP system]
    │   └── php.ini
    └── dokuwiki
        └── [DokuWiki installation]
  7. Run docuwiki.cmd
    It will start PHP’s built-in web server running on port 9003. In your browser, go to http://127.0.0.1:9003/install.php.
    Complete the setup wizard with your desired settings. I prefer to set it up as a “closed” wiki requiring me to login, just to be safe.
  8. Your wiki home page now is http://127.0.0.1:9003/doku.php
  9. Here are some more optional things you can do to configure a nice wiki setup:Go to your Extension Manager page on the Admin screen and install the indexmenu extension.Go to the the Configuration Settings page on the Admin screen and set the following options:
    breadcrumbs = 0
    youarehere = true
    useheading = Always
    userewrite = DokuWiki internal
    useslash = true
    plugin → indexmenu → skip_index = /(^wiki$|^playground$)/
    plugin → indexmenu → skip_file = /(^sidebar$)/

    Create a page called “sidebar” in the root namespace with this code in it:

    {{indexmenu>..#1|js navbar nocookie id#random}}

    If you’re not sure how to create a page, one way would be to type “sidebar” in the search box, click “Search” and then click the “Create this page” button on the right.

    If you’re new to DokuWiki, please take the time to read the manual or watch the intro videos.

  10. Enjoy!

LEAVE A REPLY

Please enter your comment!
Please enter your name here