Download the latest version of Wiki.js:
wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz
Extract the package to the final destination of your choice:
mkdir wiki
tar xzf wiki-js.tar.gz -C ./wiki
mv ./wiki /var/wiki
cd ./wiki
Rename the sample config file to config.yml:
mv config.sample.yml config.yml
Install Nodejs:
sudo apt install -y nodejs
Install MariaDB with the following configuration:
db:
type: mariadb
host: localhost
port: 3306
user: wikijs
pass:
db: wiki
Edit the config file and fill in your database and port settings, use the configuration of the database but set the host to 127.0.0.1 instead (wiki.js binds to IPv6 otherwise):
nvim config.yml
Run Wiki.js:
node server
Wait until you are invited to open to the setup page in your browser.
Complete the setup wizard to finish the installation.
Create a new file named wiki.service inside directory /etc/systemd/system.
nvim /etc/systemd/system/wiki.service
Paste the following contents (assuming your wiki is installed at /var/wiki):
[Unit]
Description=Wiki.js
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/node server
Restart=always
# Consider creating a dedicated user for Wiki.js here:
User=wiki
Environment=NODE_ENV=production
WorkingDirectory=/var/wiki
[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