07.06.2023

Install WikiJS on Ubuntu 20.04

What is WikiJS

WikiJS is well-known wiki-based engine. Its popularity is growing today due to such advantages as open-source code which supported by big developers community, easy-to-install, small system requirements and well-readable documents markup by default.

Necessary server specs

To install WikiJS you need:

Installation procedure

WikiJS setup process is very simple, possible for everybody. Just do followed step-by-step instruction:

apt-get update; apt upgrade -y && reboot

apt install wget curl -y

 

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - && apt -y install nodejs

IMPORTANT: NodeJS v18 is not compatible with WikiJS now! You shuldn't use it.

apt install -y software-properties-common; curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | /bin/bash; apt-get update; apt install -y mariadb-server mariadb-client

systemctl enable mariadb; service mariadb start

systemctl status mariadb

mysql_secure_installation

nano ~/.my.cnf

 

[client]
user=root
password=<your_password>

create database <database_name>;
create user '<database_username>'@'localhost' identified by '<your_database_password>';
grant all on <database_name>.* to '<database_username>'@'localhost' with grant option;
flush privileges;
exit

adduser --home /wikijs --disabled-password wikijs

su wikijs

cd ~; wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz; tar -xf *.tar.gz

cp config.sample.yml config.yml; nano config.yml

exit

nano /etc/systemd/system/wiki.service

[Unit]
Description=Wiki
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/node server
Restart=always

User=wikijs
Environment=NODE_ENV=production
WorkingDirectory=/wikijs

[Install]
WantedBy=multi-user.target

#/bin/bash

sleep 5
/usr/bin/node /wikijs/server

systemctl daemon-reload; systemctl enable wiki; systemctl start wiki

service wiki status

Final configuration

Now WikiJS is working, so, it's time to finalize installation.

Conclusion

Now you knew what is WikiJS, what its system requirements and how to install this platform on your own Ubuntu 20.04 server.