In this guide, we are going to look at how to install wiki.js on debian 10 (Buster). Wiki.js is a free and opensource wiki app built on Node.js, MongoDB, Git and Markdown. It is modern and powerful and optimized to conserve CPU resources. With wiki.js all content is written in markdown format, saved into markdown files and automatically synced to your remote Git repository.

Some Wiki.js features include the following:

  • Free and opensource
  • Beautiful design for modern web
  • Access control integration
  • Lightweight and powerful
  • Inbuilt fast Node.js engine
  • Markdown editing
  • Intuitive assets management

Step 1: Update and install Required Packages

Update your Debian to packages first with the below commands

sudo apt-get update
sudo apt-get upgrade
sudo reboot

The following are requirements for the installation of Wiki.js:

  • Node.js 6.11.1 to 10.x is required.
  • MongoDB version 3.2 or later.
  • Git version 2.7.4 or later.
  • Web Server software such as NGINX, Apache, Caddy, H2O…
  • An empty Git repository (optional).

Run the below command to install the necessary packages required for Debian OS basic administration.

sudo apt install -y curl wget vim git unzip socat sudo bash-completion apt-transport-https build-essential dirmngr

Step 2: Install Node.js and NPM

Since Wiki.js is built on Node.js, we are going to install the latest version as below:

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - 
sudo apt install -y nodejs

Step 3: Install MongoDB Database Server

Wiki.js supports MongoDB database for storing information. Run the following command to install MongoDB on Debian 10. Run the following commands to install MongoDB on Debian 10.

sudo apt -y install gnupg2
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-org.list
sudo apt update
sudo apt -y install mongodb-org

Then start and enable MongoDB

sudo systemctl enable --now mongod

Confirm MongoDB status

$ sudo systemctl status mongod 
● mongod.service - MongoDB Database Server 
  Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled) 
  Active: active (running) since Thu 2021-01-14 10:29:41 EAT; 31s ago 
    Docs: https://docs.mongodb.org/manual 
Main PID: 10451 (mongod) 
  Memory: 77.5M 
  CGroup: /system.slice/mongod.service 
          └─10451 /usr/bin/mongod --config /etc/mongod.conf

Step 4: Install Nginx Web Server

We are going to be using Nginx as a webserver for Wiki.js. Run the following commands to install:

wget https://nginx.org/keys/nginx_signing.key 
sudo apt-key add nginx_signing.key 
rm nginx_signing.key 
sudo -s 
printf "deb https://nginx.org/packages/mainline/debian/ $(lsb_release -sc) nginx\ndeb-src https://nginx.org/packages/mainline/debian/ $(lsb_release -sc) nginx\n" >> /etc/apt/sources.list.d/nginx_mainline.list 
exit 
sudo apt update 
sudo apt install -y nginx

Step 5: Install Let’s Encrypt for Wiki.js (Optional)

Install Acme.sh to use in obtaining Let’s Encrypt certificate

sudo su -
git clone https://github.com/Neilpang/acme.sh.git 
cd acme.sh  
./acme.sh --install --accountemail [email protected] 
source ~/.bashrc 
cd ~

Obtain RSA and ECC/ECDSA certificates for your hostname

# RSA 2048 
acme.sh --issue --standalone -d wiki.example.com --keylength 2048 
# ECDSA 
acme.sh --issue --standalone -d wiki.example.com --keylength ec-256

Create folders to store your certificates

mkdir -p /etc/letsencrypt/wiki.example.com 
mkdir -p /etc/letsencrypt/wiki.example.com_ecc

Copy/install the certificates to the created directories

# RSA 
acme.sh --install-cert -d example.com \ 
       --cert-file /etc/letsencrypt/wiki.example.com/cert.pem \ 
       --key-file /etc/letsencrypt/wiki.example.com/private.key \ 
       --fullchain-file /etc/letsencrypt/wiki.example.com/fullchain.pem \ 


# ECC/ECDSA 
acme.sh --install-cert -d example.com --ecc \ 
       --cert-file /etc/letsencrypt/wiki.example.com_ecc/cert.pem \ 
       --key-file /etc/letsencrypt/wiki.example.com_ecc/private.key \ 
       --fullchain-file /etc/letsencrypt/wiki.example.com_ecc/fullchain.pem

# Exit root
exit

Now start and enable Nginx service with the following commands:

sudo systemctl start nginx
sudo systemctl enable nginx

Step 6: Download and Install Wiki.js

Create a project directory and navigate to the created directory. Also update ownership of the directory to your user

sudo mkdir /var/www/wiki.js
cd /var/www/wiki.js
sudo chown -R [your_user]:[your_user] /var/www/wiki.js

While in Wiki.js directory, run the below command to download and install Wiki.js

$ curl -sSo- https://wiki.js.org/install.sh | bash
__    __ _ _    _    _      
/ / /\ \ (_) | _(_)  (_)___  
\ \/  \/ / | |/ / |  | / __|  
\  /\  /| |   <| |_ | \__ \  
 \/  \/ |_|_|\_\_(_)/ |___/  
                  |__/ 
  < INSTALL > 

[1/3] Fetching latest build... 
[2/3] Fetching dependencies... 
[3/3] Creating config file... 
-> Installation Complete 

Thank you for installing Wiki.js! 
Please consider donating to our open collective to help maintain this project: 
https://opencollective.com/wikijs/donate 

- Launch configuration wizard: node wiki configure 
- Start Wiki.js server: node wiki start

Start configuration wizard using the below command:

node wiki configure

You will be prompted to open wiki.js from your browser to continue configuration. Visit http://<your-server-ip>:3000. Ensure to have allowed port 3000 on the firewall if you have an active firewall. On your browser, you should see a page as below:

Click on ‘Start’. It will perform system check and gives a report as below

Click on ‘CONTINUE’. Configure your general settings preferences

Click ‘CONTINUE’. You should see the following screenshot. Click on ‘CONTINUE’

Connect to Database by clicking ‘CONNECT’

It should connect successfully as below:

Click ‘CONTINUE’. Configure paths and click ‘CONTINUE’

You can set up git repository if you wish to

Configure administrator account and click ‘CONTINUE’

After filing the details, click ‘CONTINUE’ to get the below:

When you click on ‘START’, You will prompted with a login page. Provide the admin credentials you set above to login. You will then be prompted with a page to create home page.

Click on ‘CREATE HOME PAGE’ to begin

We have successfully set up Wiki.js on Debian 10 (Buster) with Nginx as a reverse proxy and Let’s Encrypt SSL certificate. I trust the guide has been useful. Enjoy using Wiki.js.

More articles available in our website:

How To Install Invoice Ninja on Debian

Install Julia Programming Language on CentOS

Install and Configure Kitty Terminal Emulator on Linux | macOS

LEAVE A REPLY

Please enter your comment!
Please enter your name here