Wiki.js is a modern and powerful open-source Wiki platform built on Node.js and MongoDB. It provides an easy-to-use interface for creating, editing, and organizing content, making it a great choice for documentation and collaboration. In this article, we will go over how to install Wiki.js on Rocky Linux 9.
Prerequisites
Before we begin, there are a few things that you need to have in place in order to install Wiki.js on Rocky Linux 9:
- A computer running Rocky Linux 9.
- A user account with sudo privileges.
- A working internet connection.
- Git and Node.js installed on your system. If you don’t have these installed, you can install them by running the following commands:
sudo yum install git nodejs
Installing MongoDB
Wiki.js requires a MongoDB database to store its data. If you don’t already have MongoDB installed, you can follow these steps to install it:
Import the MongoDB public GPG key using the following command:
sudo rpm --import <https://www.mongodb.org/static/pgp/server-4.4.asc>
Add the MongoDB repository to your system by creating a new file called mongodb-org-4.4.repo
in the /etc/yum.repos.d
directory:
sudo nano /etc/yum.repos.d/mongodb-org-4.4.repo
Add the following contents to the file:
[mongodb-org-4.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
Save the file and exit the editor.
Install the MongoDB package by running the following command:
sudo yum install mongodb-org
Once the installation is complete, start the MongoDB service using the following command:
sudo systemctl start mongod
Verify that the MongoDB service is running by checking its status:
sudo systemctl status mongod
The output should look something like this:
● mongod.service - MongoDB Database Server
Loaded: loaded (/usr/lib/systemd/system/mongod.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2021-09-07 15:33:31 UTC; 3min ago
Docs: <https://docs.mongodb.org/manual>
Main PID: 10243 (mongod)
Tasks: 23 (limit: 4752)
Memory: 66.4M
CGroup: /system.slice/mongod.service
└─10243 /usr/bin/mongod --config /etc/mongod.conf
Installing Wiki.js
To install Wiki.js, you can follow these steps:
Clone the Wiki.js repository from GitHub using the following command:
git clone <https://github.com/Requarks/wiki.git>
Navigate to the wiki
directory that was created by the Git clone:
cd wiki
Install the required Node.js dependencies for Wiki.js by running the following command:
npm install
Create a configuration file for Wiki.js by copying the sample configuration file:
cp config.sample.yml config.yml
Edit the configuration file using your preferred text editor:
nano config.yml
Make any necessary changes to the configuration, such as setting the database connection details and the URL at which the Wiki will be accessible.
Save the file and exit the editor.
- Start the Wiki.js service by running the following command:
node server
Open a web browser and navigate to the URL at which you configured Wiki.js to be accessible. You should see the Wiki.js setup page, where you can complete the setup by providing the necessary information and creating an admin user.
Conclusion
In this article, we have gone over how to install Wiki.js on Rocky Linux 9. We first installed MongoDB, which is required by Wiki.js, and then installed Wiki.js itself. With these steps, you should now have a working installation of Wiki.js on your Rocky Linux 9 system.