Dd
Applications AWS

DokuWiki on AWS User Guide

| Product: DokuWiki on AWS

Overview

This image runs DokuWiki, the open source database-less wiki - a lightweight platform for documentation, knowledge bases, intranets and team collaboration. DokuWiki's defining feature is that it stores everything - pages, page history, uploaded media, metadata and the full-text search index - as plain files on disk, so there is no database server to install, tune or back up.

DokuWiki runs as a PHP application. nginx answers on port 80 (and 443 once you add TLS) and passes requests to php-fpm over a local socket; DokuWiki reads and writes its content directly on disk. The wiki content - the DokuWiki savedir holding pages, media, metadata, cache and the search index - lives on a dedicated EBS data volume mounted at /var/lib/dokuwiki, independently resizable and separate from the operating system disk. The program code itself lives at /var/www/dokuwiki.

On the first boot of every deployed instance, a one-shot service generates a single administrator account with a per-instance password, seeds it into DokuWiki's flat-file user store, and writes the login to /root/dokuwiki-credentials.txt with mode 0600. No shared or default credentials ship in the image.

Prerequisites

Before you deploy this image you need:

  • An Amazon Web Services account where you can launch EC2 instances
  • IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
  • An EC2 key pair in the target Region for SSH access to the instance
  • A VPC and subnet in the target Region, with a security group allowing inbound port 22 from your management network and inbound ports 80 and 443 from the networks your wiki users will reach DokuWiki on
  • The AWS CLI (version 2) installed locally if you plan to deploy from the command line

Step 1: Launch the Instance from the AWS Marketplace

Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images choose AWS Marketplace AMIs and search for DokuWiki. Select the cloudimg listing and choose Select, then Continue on the subscription summary.

Pick an instance type of t3.small or larger. Choose your EC2 key pair under Key pair (login). Under Network settings select your VPC and subnet, and either create or select a security group that allows inbound port 22 from your management network and inbound ports 80 and 443 from the networks your users use. Leave the root volume at the default size or larger; the image adds a separate data volume for the wiki content automatically.

Select Launch instance. First boot initialisation takes only a few seconds after the instance state becomes Running and the status checks pass.

Step 2: Launch the Instance from the AWS CLI

The following block launches an instance from the cloudimg DokuWiki Marketplace AMI into an existing subnet and security group. Replace <ami-id> with the AMI ID shown on the Marketplace listing, <key-name> with your EC2 key pair name, <subnet-id> with your subnet ID, and <security-group-id> with a security group that opens ports 22, 80, and 443 as described above.

aws ec2 run-instances \
  --image-id <ami-id> \
  --instance-type t3.small \
  --key-name <key-name> \
  --subnet-id <subnet-id> \
  --security-group-ids <security-group-id> \
  --block-device-mappings '[{"DeviceName":"/dev/sda1","Ebs":{"VolumeSize":20,"VolumeType":"gp3"}}]' \
  --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=dokuwiki-01}]'

The command prints a JSON document on success. Note the instance ID, then retrieve its public address once it is running with aws ec2 describe-instances --instance-ids <instance-id> --query "Reservations[].Instances[].PublicIpAddress" --output text.

Step 3: Connect and Retrieve the Administrator Login

Connect over SSH with the key pair you selected and the public IP address from step 2. The SSH login user depends on the operating system of the AMI variant you launched:

AMI variant SSH login user
DokuWiki on Ubuntu 24.04 ubuntu
ssh -i /path/to/your-key.pem ubuntu@<public-ip>

The per-instance administrator password is written on first boot to a root-only file. Read it with:

sudo cat /root/dokuwiki-credentials.txt

The file contains the wiki URL, the admin username (admin) and the generated DOKUWIKI_ADMIN_PASSWORD. These credentials are unique to this instance.

You can confirm the services are running and the wiki is answering locally:

systemctl is-active nginx php8.3-fpm
curl -s -o /dev/null -w 'healthz %{http_code}\n' http://127.0.0.1/healthz
curl -s -o /dev/null -w 'start   %{http_code}\n' 'http://127.0.0.1/doku.php?id=start'

nginx and php8.3-fpm report active, and both HTTP checks return 200. The /healthz endpoint is unauthenticated and is ideal for a load balancer or uptime monitor.

Step 4: First Sign-in

Open the wiki in your browser at http://<instance-public-ip>/. The welcome start page loads immediately - no installer, no database setup.

DokuWiki welcome start page

Select Log In at the top right. Enter the username admin and the password from /root/dokuwiki-credentials.txt, then select Log In.

DokuWiki admin sign in

Once signed in you will see Logged in as: Administrator in the top bar, with Admin and Log Out links.

Step 5: Create and Edit Pages

DokuWiki pages are written in a simple, readable markup. To change the current page, select Edit this page; the editor opens with a formatting toolbar for headings, bold, italics, links, lists, tables and image embeds.

Editing a wiki page in DokuWiki

To create a new page, visit a URL for a page that does not exist yet - for example http://<instance-public-ip>/doku.php?id=team:onboarding - and select Create this page. The colon in the page id creates a namespace (team), which is how DokuWiki organises pages into a hierarchy. Upload images and other files through Media Manager, and use the search box to find content across the wiki; DokuWiki maintains a full-text index automatically.

Every edit is versioned. The Old revisions control on each page lets you compare any two revisions and roll back to an earlier one.

Step 6: Administration - Users, ACLs and Plugins

Select Admin in the top bar to open the administration area.

DokuWiki administration area

From here you can:

  • User Manager - add developer, editor and reader accounts, and place users into groups.
  • Access Control List Management - grant or restrict read, edit, create, upload and delete permission per namespace and per user or group. The image ships with ACLs on: anonymous visitors can read, and signed-in users in the user group can edit and upload. The admin account is a superuser and bypasses ACLs.
  • Extension Manager - browse and install DokuWiki plugins and templates to extend the wiki, directly from the admin UI.
  • Configuration Settings - change the wiki title, licence, interface language and hundreds of other options.

The wiki title, savedir and ACL policy for this image are defined in /var/www/dokuwiki/conf/local.php; you can inspect it with:

sudo cat /var/www/dokuwiki/conf/local.php

Step 7: Where the Content Lives

All wiki content is on the dedicated data volume mounted at /var/lib/dokuwiki. You can confirm the mount and see the DokuWiki savedir layout:

findmnt /var/lib/dokuwiki
sudo ls /var/lib/dokuwiki

The pages, media, meta, index, attic (page history) and cache directories are all here. Because this is a separate EBS volume you can resize it independently of the operating system disk, and snapshot it on its own schedule.

Step 8: Configure HTTPS (Recommended)

For production use, put DokuWiki behind TLS. Point a DNS record at the instance, ensure inbound port 443 is open, and install a certificate with Certbot's nginx plugin. Replace your-dokuwiki-host.example.com with your fully qualified domain name.

sudo apt-get update
sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d your-dokuwiki-host.example.com

Certbot obtains and installs the certificate, updates the nginx server block to listen on 443, and sets up automatic renewal.

Backup and Maintenance

Because DokuWiki is database-less, a backup is simply a copy of the savedir. Snapshot the /var/lib/dokuwiki EBS volume on a schedule, or archive the directory:

sudo tar czf /var/tmp/dokuwiki-backup-$(date +%F).tgz -C /var/lib/dokuwiki .

Keep the operating system patched with sudo apt-get update && sudo apt-get upgrade, and update DokuWiki itself by following the DokuWiki upgrade documentation - the flat-file store is preserved across upgrades. To install additional functionality, use the Extension Manager in the admin area.

Support

This image is provided by cloudimg with 24/7 technical support by email and chat. We can help with deployment, namespace and access-control design, plugin and template selection, storage and search-index maintenance, backup and upgrade planning. Contact details are on the cloudimg website.

All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.