Install and Configure DokuWiki on Alibaba Cloud ECS


  1. You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get a free account in your Alibaba Cloud account. If you don’t know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  2. A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  3. Domain name must be pointed to your Alibaba Cloud ECS’s IP address
  4. Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  5. Set up your server’s hostname and create user with root privileges.

Update Your Ubuntu System

# sudo apt update && sudo apt upgrade

Install PHP

# sudo apt-get install software-properties-common python-software-properties
# sudo add-apt-repository ppa:ondrej/php
# sudo apt update
# sudo apt install -y php7.2

Install Required PHP Extensions

  1. php7.2-cli
  2. php7.2-fpm
  3. php7.2-gd
  4. php7.2-zip
  5. php7.2-xml
# sudo apt install -y php7.2-cli php7.2-fpm php7.2-xml php7.2-gd php7.2-zip
# php --version

Install Nginx Server

# sudo systemctl stop apache2
# sudo apt-get install nginx
# sudo systemctl start nginx
# sudo nginx -v
# sudo nano /etc/nginx/sites-available/doku.conf
server {
listen 80;
listen [::]:80;
return 301 https://$server_name$request_uri;

server {
listen [::]:443 ssl;
listen 443 ssl;

ssl_certificate /etc/letsencrypt/live/; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot

# Maximum file upload size is 4MB - change accordingly if needed
client_max_body_size 4M;
client_body_buffer_size 128k;

root /var/www/dokuwiki;
index doku.php index.html index.htm index.php;

#Remember to comment the below out when you're installing, and uncomment it when done.
location ~ /(data/|conf/|bin/|inc/|install.php) { deny all; }
# Uncomment this prevents images being displayed !
# location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
# expires 31536000s;
# add_header Pragma "public";
# add_header Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate";
# log_not_found off;
# }

location / { try_files $uri $uri/ @dokuwiki; }

location @dokuwiki {
# rewrites "doku.php/" out of the URLs if you set the userewrite setting to .htaccess in dokuwiki config page
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
rewrite ^/(.*) /doku.php?id=$1&$args last;

location ~ \.php$ {
try_files $uri $uri/ /doku.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
# sudo ln -s /etc/nginx/sites-available/doku.conf /etc/nginx/sites-enabled/
# sudo nginx -t
# sudo systemctl reload nginx

Install and Configure DokuWiki

# cd /var/www
# sudo wget
# sudo tar xvf dokuwiki-stable.tgz
# sudo mv /var/www/dokuwiki-2018-04-22a /var/www/dokuwiki
# cd dokuwiki
# sudo chown -R www-data:www-data /var/www/dokuwiki

Install SSL Certificate

# sudo apt-get update
# sudo apt-get install software-properties-common
# sudo add-apt-repository ppa:certbot/certbot
# sudo apt-get update
# sudo apt-get install python-certbot-nginx
# sudo certbot --nginx -d
# sudo systemctl restart php7.2-fpm.service
# sudo systemctl reload nginx

Remove install.php File

# cd /var/www/dokuwiki
# ls -li
# sudo rm install.php
# ls -li




Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Straightforward Method of Sending A Triggered Email via AMPscript

How to Build the Most Effective Backup System — A Conversation with the Expert

Speed Up Mobile Apps and Websites with AMP

MNN Kit: An Out-of-the-Box Algorithms Kit from Alibaba

Ubuntu 22.04 LTS - UI/UX Changes!

Tutorial about Setting Up Server Manager on Ubuntu 18.04

Day 1 of My GameDev Journey

Breaking the Coder Stereotype: My Storytelling Journey

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:

More from Medium

How to Analysis or Audit your Elasticsearch Requests #

The decision process on provisioning your web application to Google Cloud

Analysis of different cloud based MongoDB solutions

Use Serverless to deploy Sample Google Cloud Functions