Skip to content

Wikijs

Installation des paquets

apt-get install curl wget make gcc g++ python3-pip sudo postgresql
curl -sL https://deb.nodesource.com/setup_current.x | bash -
apt-get install -y nodejs

Création de la base et de l'utilisteur wikijs

sudo -u postgres psql
create database wikijsdb;
create user wikijs with encrypted password 'MONMOTDEPASSE';
grant all privileges on database wikijsdb to wikijs;
\c wikijsdb
CREATE EXTENSION pg_trgm;
quit;

On télécharge la dernière version de wikijs

wget https://github.com/Requarks/wiki/releases/download/2.5.191/wiki-js.tar.gz

Extract the package to the final destination of your choice

mkdir -pv /opt/wiki/app
tar xzf wiki-js.tar.gz -C /opt/wiki/app

création des liens symboliques pour plus de souplesse lors des mises à jour

mv /opt/wiki/app/config.sample.yml /opt/wiki/config.yml
ln -s /opt/wiki/config.yml /opt/wiki/app/config.yml

Edit the config file and fill in your database, redis and port settings

vim /opt/wiki/app/config.yml

For SQLite installations only: (skip this step otherwise) Fetch native bindings for SQLite3

npm rebuild sqlite3
Run Wiki.js
node server

Run as service

  • Create a new file named wiki.service inside directory /etc/systemd/system.
vim /etc/systemd/system/wiki.service
  • Paste the following contents (assuming your wiki is installed at /opt/wiki/app):
[Unit]
Description=Wiki.js
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/node server
Restart=always
User=root
Environment=NODE_ENV=production
WorkingDirectory=/opt/wiki/app

[Install]
WantedBy=multi-user.target

Reload systemd

systemctl daemon-reload

Run the service:

systemctl start wiki

Enable the service on system boot.

systemctl enable wiki

Note: You can see the logs of the service using journalctl -u wiki

Note postfix

Pour les mails :

  • vim /etc/postfix/master.cf
-o smtpd_recipient_restrictions=check_relay_domains