How to Install Wiki.js on CentOS 7

Wiki.js is a free and open source, modern wiki application built on Node.js, MongoDB, Git and Markdown. Wiki.js source code is publicly hosted on Github. This guide will show you how to install Wiki.js on a fresh CentOS 7 Vultr instance using Node.js, MongoDB, PM2, Nginx, Git and


Requirements to run Wiki.js are the following:

  • Node.js version 6.9.0 or later
  • MongoDB version 3.2 or later
  • Nginx
  • Git version 2.7.4 or later
  • A Git-compliant repository (public or private) (optional)
  • Minimum of 768MB RAM
  • Domain name with A/AAAA records set up

Check the CentOS version.

cat /etc/centos-release
# CentOS Linux release 7.5.1804 (Core)

Create a new non-root user account with sudo access and switch to it.

useradd -c "John Doe" johndoe && passwd johndoe
usermod -aG wheel johndoe
su - johndoe

NOTE: Replace johndoe with your username.

Set up the timezone.

timedatectl list-timezones
sudo timedatectl set-timezone 'Region/City'

Ensure that your system is up to date.

sudo yum update -y

Install necessary packages to finish this tutorial.

sudo yum install -y wget curl vim zip unzip bash-completion

Disable SELinux and Firewall.

sudo setenforce 0
sudo systemctl stop firewalld
sudo systemctl disable firewalld

Enable the EPEL repository.

sudo rpm -Uvh

Install Git

CentOS repositories provide a very outdated version of Git, so we will need to build Git from source.

Install Git by building it from the source code.

# Remove existing git package if installed: 
sudo yum remove -y git
sudo yum groupinstall -y "Development Tools"
sudo yum install -y gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel curl-devel
wget && tar zxvf git-2.17.1.tar.gz
rm git-2.17.1.tar.gz
cd git-2.17.1
make configure
make prefix=/usr/local all
sudo make prefix=/usr/local install
cd ~

# Confirm this command returns /usr/local/bin/git:
which git

Verify the version.

git --version
# git version 2.17.1

Install Node.js

Wiki.js requires Node.js 6.9.0 or later, so we will first need to install Node.js.

Install Node.js by utilizing the NodeSource YUM repository for Node.js.

curl --silent --location | sudo bash -
sudo yum install -y nodejs

Check the Node.js and NPM versions.

node -v && npm -v
# v8.11.2
# 5.6.0

Install MongoDB

Wiki.js uses MongoDB as a database engine. We will use the official MongoDB repositories, which contain the most recent major and minor MongoDB releases.

Install MongoDB Community Edition.

sudo vim /etc/yum.repos.d/mongodb-org-3.6.repo

# Copy/paste this
name=MongoDB Repository

sudo yum install -y mongodb-org

Check the version.

mongo --version | head -n 1 && mongod --version | head -n 1
# MongoDB shell version v3.6.5
# db version v3.6.5

Enable and start MongoDB.

sudo systemctl enable mongod.service
sudo systemctl start mongod.service

Install and configure Nginx

It is highly recommended to put a standard web server in front of Wiki.js. This ensures you can use features like SSL, multiple websites, caching and more.

Install Nginx.

sudo vim /etc/yum.repos.d/nginx_mainline.repo

# Copy/paste this
name=nginx repo

sudo rpm --import nginx_signing.key
rm nginx_signing.key

sudo yum install -y nginx

Check the version.

nginx -v
# nginx version: nginx/1.15.0

Enable and start Nginx.

sudo systemctl enable nginx.service
sudo systemctl start nginx.service

Configure Nginx as an HTTP or HTTPS reverse proxy for Wiki.js.

Run sudo vim /etc/nginx/conf.d/wiki.js.conf and populate it with the basic reverse proxy configuration below.

server {

    listen [::]:80;
    listen 80;


    root /usr/share/nginx/html;

    charset utf-8;
    client_max_body_size 50M;

    location /.well-known/acme-challenge/ {
        allow all;

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_next_upstream error timeout http_502 http_503 http_504;


The only thing you need to change in the above configuration is server_name directive, and potentially proxy_pass directive if you decide to configure any other port than 3000. Wiki.js uses port 3000 by default.

Check the configuration.

sudo nginx -t

Reload Nginx.

sudo systemctl reload nginx.service

Install the client and obtain a Let's Encrypt certificate (optional)

Securing your wiki with HTTPS is not necessary, but it is a good practice to secure your site traffic. In order to obtain an SSL certificate from Let's Encrypt, we will use client. is a pure UNIX shell script for obtaining SSL certificates from Let's Encrypt with zero dependencies. That makes it very lightweight in comparison to some other Acme protocol clients that require a lot of dependencies to run successfully.

Download and install

sudo mkdir /etc/letsencrypt
git clone
sudo ./ --install --home /etc/letsencrypt --accountemail
cd ~

Check the version.

/etc/letsencrypt/ --version
# v2.7.9

Obtain RSA and ECDSA certificates for your domain/hostname.

# RSA 2048
sudo /etc/letsencrypt/ --issue --home /etc/letsencrypt -d --webroot /usr/share/nginx/html --reloadcmd "sudo systemctl reload nginx.service" --accountemail --ocsp-must-staple --keylength 2048
sudo /etc/letsencrypt/ --issue --home /etc/letsencrypt -d --webroot /usr/share/nginx/html --reloadcmd "sudo systemctl reload nginx.service" --accountemail --ocsp-must-staple --keylength ec-256 

After running the above commands, your certificates and keys will be in the following directories:

  • For RSA: /etc/letsencrypt/
  • For ECC/ECDSA: /etc/letsencrypt/wiki.example.com_ecc

NOTE: Don't forget to replace with your domain name.

After obtaining certificates from Let's Encrypt, we need to configure Nginx to take advantage of them.

Run sudo vim /etc/nginx/conf.d/wiki.js.conf again and configure Nginx as an HTTPS reverse proxy.

server {

    listen [::]:443 ssl http2;
    listen 443 ssl http2;
    listen [::]:80;
    listen 80;


    root /usr/share/nginx/html;

    charset utf-8;
    client_max_body_size 50M;

    location /.well-known/acme-challenge/ {
        allow all;

    # RSA
    ssl_certificate /etc/letsencrypt/;
    ssl_certificate_key /etc/letsencrypt/;
    # ECDSA
    ssl_certificate /etc/letsencrypt/wiki.example.com_ecc/fullchain.cer;
    ssl_certificate_key /etc/letsencrypt/wiki.example.com_ecc/;

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_next_upstream error timeout http_502 http_503 http_504;


Check the configuration.

sudo nginx -t

Reload Nginx.

sudo systemctl reload nginx.service

Install Wiki.js

Create an empty document root folder where Wiki.js should be installed.

sudo mkdir -p /var/www/

Navigate to the document root folder.

cd /var/www/

Change ownership of the /var/www/ folder to user johndoe.

sudo chown -R johndoe:johndoe /var/www/

From the /var/www/ folder, run the following command to download and install Wiki.js.

curl -sSo- | bash

You can run the following command in order to view the currently installed version of Wiki.js.

node wiki --version
# 1.0.78

Once the installation is complete, you'll be prompted to run the configuration wizard.

Start the configuration wizard.

node wiki configure

This will notify you to navigate to http://localhost:3000 to configure Wiki.js. If you have Nginx in front of Wiki.js, you can open your domain name (e.g. instead of going to localhost.

Using your web browser, navigate to and follow the on-screen instructions. All of the settings that were entered during the configuration wizard have been saved in the config.yml file. The configuration wizard will automatically start Wiki.js for you.

Setup PM2

By default, Wiki.js will not start automatically after a system reboot. In order to make it start on boot, we need to setup the PM2 process manager.

Tell PM2 to configure itself as a startup service.

/var/www/ startup

Finally, save the current PM2 configuration by running the command.

/var/www/ save

Your Wiki.js instance runs as a background process, using PM2 as its process manager. You can reboot your OS with sudo reboot and ensure that Wiki.js starts after a reboot.

Cómo instalar Multicraft en Windows

Introducción Multicraft es un panel de control de administración de servidores de Minecraft que se usa para administrar su servidor de Minecraft. En este tutorial, vamos a instalar

Proteja el acceso SSH usando Spiped en OpenBSD

Dado que el acceso SSH es el punto de entrada más importante para administrar su servidor, se ha convertido en un vector de ataque ampliamente utilizado. Pasos básicos para asegurar SS

Cómo instalar el CMS de octubre 1.0 en un VPS LAMP Debian 9

¿Usando un sistema diferente? October 1.0 CMS es un sistema de gestión de contenido (CMS) simple y confiable, gratuito y de código abierto creado en el marco de Laravel

Cómo instalar XCache en Ubuntu 15.04

XCache es un cacher de código abierto de código abierto para PHP. En este tutorial, explicaré cómo instalar y configurar XCache. Supongo que ya tienes un servicio web

How to Install MongoDB 4.0 on Arch Linux

Prerequisites A Vultr server running up to date Arch Linux (see this article) Sudo access: Commands required to be ran as root are prefixed by #, and one

How to Install RainLoop Webmail on Debian 9

Using a Different System? RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on Github. This guide will show you ho

Configure la seguridad y el servidor de seguridad de ConfigServer (CSF) en CentOS 7

ConfigServer Security & Firewall (CSF) es un firewall de inspección de paquetes con estado (SPI), detección de inicio de sesión / intrusión y aplicación de seguridad para servidores Linux

Soluciones de monitoreo para su VPS

En este artículo, aprenderá sobre una selección de las soluciones de monitoreo disponibles para su servidor Vultr. Dependiendo de su elección de sistema operativo, hay

How to Install Sylius eCommerce Platform on CentOS 7

Using a Different System? Sylius is a modern e-commerce platform for PHP, based on the Symfony Framework. Sylius source code is hosted on GitHub. This guid

Older Posts >