In this project, we will show you how to install and run Wiki.JS on a Raspberry Pi.
Wiki.JS is a powerful, free, and self-hosted wiki that you can run on your Raspberry Pi.
Using a self-hosted wiki solution such as Wiki.JS allows you to organize and store information easily.
One of the benefits of this particular Wiki clone is that it boasts a considerable number of features and has support for a visual editor, markdown, and more. It even boasts support for 2-factor authentication, allowing you to improve the security of your setup.
To get Wiki.JS running on the Raspberry Pi, we will use Docker. Docker allows us to get this software up and running quickly without fighting dependencies.
Equipment
Below is a list of the equipment we used when setting up Wiki.JS on our Raspberry Pi.
Recommended
- Raspberry Pi ( Amazon | SunFounder )
- Micro SD Card ( Amazon | SunFounder )
- Power Supply ( Amazon | SunFounder )
- Ethernet Cable ( Amazon ) or Wi-Fi ( Amazon | SunFounder )
Optional
- Raspberry Pi Case ( Amazon | SunFounder )
- USB Mouse ( Amazon | SunFounder )
- USB Keyboard ( Amazon | SunFounder )
- HDMI Cable ( Amazon | SunFounder )
- Monitor ( Amazon | SunFounder )
This tutorial was last tested on a Raspberry Pi 400 running the latest version of Raspberry Pi OS Bullseye.
Installing Wiki.JS on the Raspberry Pi
Over these following steps, we will walk you through the process of getting Docker on your Raspberry Pi and setting it up to run Wiki.JS.
One of the most significant advantages of using Docker is that we can easily install the database server Wiki.JS relies on.
Preparing your Raspberry Pi for Wiki.JS
1. Before installing Wiki.JS, we need to update our Raspberry Pi’s operating system.
Update the package list and any out-of-date packages using the following commands within the terminal.
sudo apt update
sudo apt upgrade -y
2. Once the update completes, you will now want to install Docker to your Raspberry Pi.
Please follow the guide we have linked above before returning to this tutorial. That guide will show you how to install Docker and have it configured to work properly on your device.
3. We must also create a directory to store our Docker compose file.
Create this directory in your current user’s home directory by using the command below.
mkdir ~/wikijs
4. Once the directory is created, we must change to it by using the cd command.
cd ~/wikijs
Writing the Docker Compose file for Wiki.JS
5. After following our Docker installation guide, we can now write a Docker compose file for our Wiki.JS installation.
This compose file will set up the Wiki.JS and PostgreSQL container on our Raspberry Pi.
Start writing this compose file by using the following command in the terminal.
sudo nano ~/wikijs/docker-compose.yml
6. Within this file, you will want to enter the following lines.
While typing in these lines, replace “<WIKIJSPASSWORD>
” with a password of your choosing. Keep this password secure, as Wiki.JS will store its data on this database server.
version: "3"
services:
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: wiki
POSTGRES_PASSWORD: <WIKIJSPASSWORD>
POSTGRES_USER: wikijs
logging:
driver: "none"
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data
wiki:
image: ghcr.io/requarks/wiki:2
depends_on:
- db
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: wikijs
DB_PASS: <WIKIJSPASSWORD>
DB_NAME: wiki
restart: unless-stopped
ports:
- "80:3000"
volumes:
db-data:
7. After entering these lines, you can save and quit by pressing CTRL + X, Y, then the ENTER key.
Starting up WikiJS on your Raspberry Pi
8. We are finally at a point where we can start up WikiJS on the Raspberry Pi.
To start this software on your Pi, run the following command within the terminal.
docker compose up -d
During its initial startup, Docker will pull the latest versions of both Wiki.JS and PostgreSQL to your Pi. This process can take a few minutes, so be patient before proceeding.
Accessing the Wiki.JS Web Interface
9. Once the container starts, you can access the Wiki.JS web interface using your favourite web browser.
All you need to do is know your Pi’s local IP address. The easiest way to get this is to use the hostname command.
hostname -I
10. After getting your IP address you will want to go straight to the following address.
Ensure you replace “<IPADDRESS>
” with your Pi’s IP.
http://<IPADDRESS>
First Run of Wiki.JS on the Rasberry Pi
11. When you first access the Wiki.JS web interface, you will be asked to enter some information.
First, specify an email for your administrator account (1.). This is the email you will use to log in to your account.
Next, you need to set a password that you will use to access this account (2.).
Finally, you must also set a URL for your site (3.). If you are using a domain name, this is the place that you will want to enter it.
Once everything is filled out, click the “Install
” button (4.) at the bottom of the dialog box.
12. Wiki.JS will now finish setting itself up on your Raspberry Pi.
This process can take a couple of minutes, so don’t worry if it appears to have stopped doing anything.
13. After the installation process, you will need to log in using the information you set previously (1.).
Once you have filled out your email and password, click the “Log In
” button (2.).
14. You are finally at the point where you can start setting up Wiki.JS to your liking.
You can now browse its administration page or immediately begin creating a home page for your new self-hosted wiki.
Conclusion
Hopefully, at this stage, you will now have Wiki.JS running on your Raspberry Pi.
This software is a powerful self-hosted wiki that allows you to store and document information easily.
Please feel free to comment below if you have questions about using this software on your Pi.
We have numerous other projects for the Raspberry Pi that are well worth checking out.