News
Seven days of Black Friday madness — great deal from Serverspace!
Serverspace Black Friday
VB
October 3, 2022
Updated June 7, 2023

Install WikiJS on Ubuntu 20.04

Linux Ubuntu

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:

  • Server with at least 1Gb RAM and 10Gb disk space;
  • Actual Linux OS (Ubuntu 20.04 in this article);
  • Privileged user access;
  • Domain name with A-records, "pointed" to the server's IP (optional).

Installation procedure

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

  • Authorize on the server, update exist software and reboot machine to apply changes;
apt-get update; apt upgrade -y && reboot

pic1

  • Set up utilities to earn other necessary tools and scripts;
apt install wget curl -y

pic2

 

  • Earn, then setup nodejs;
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.

  • Add additional repository and install database service e.g. MariaDB;
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

pic4

  • Enable, then launch MariaDB, then check the status;
systemctl enable mariadb; service mariadb start

systemctl status mariadb

pic5

  • Make necessary database service settings. Set password you want, other settings - up to you, default is enough;
mysql_secure_installation

pic6

  • For convenient experience in future, create authentication data and put section with your credentials inside;
nano ~/.my.cnf

 

[client]
user=root
password=<your_password>

pic7

  • Enter into Mariadb console, create database and user for WikiJS;
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

pic8

  • The best way is run WikiJS engine in dedicated userspace. Let's create account and directory:
adduser --home /wikijs --disabled-password wikijs

pic9

  • Switch user to wikijs, download and unpack the archive;
su wikijs

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

pic10

  • Rename template config and edit it. Set database type and credentials;
cp config.sample.yml config.yml; nano config.yml

pic11

  • Return back to the root console and create wiki service via text editor. Just run this command:
exit

nano /etc/systemd/system/wiki.service

pic12

  • Insert code below into the file and save it;

[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

pic13

  • Then create start.sh script with followed content:

#/bin/bash

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

  • Reload system configuration, enable and run service you've made. Then check service status;
systemctl daemon-reload; systemctl enable wiki; systemctl start wiki

service wiki status

pic14

Final configuration

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

  • Open address http://<server_IP>:3000 (or http://<your_domain>:3000) in browser, fill all necessary data add click to the INSTALL button;

pic15

  • System will apply settings. When finished, you should see WikiJS welcome screen. Congratulations!

pic16

Conclusion

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

Vote:
4 out of 5
Аverage rating : 4.8
Rated by: 32
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
ITGLOBAL.COM NL
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.