This guide will walk you through setting up a lightweight, file-based wiki on your Raspberry Pi. The wiki runs from a single Python script using the Flask framework, making it very easy to manage.
Open a terminal on your Raspberry Pi and navigate to the directory where pi_wiki.py is located.
venv that will hold your project’s libraries. You only need to do this once.
python3 -m venv venv
source venv/bin/activate
Your prompt will change to show (venv).
pip to install Flask and Markdown. They will be installed inside the venv folder, not globally.
pip install Flask markdown
The script pi_wiki.py has been created for you. It contains everything needed to run the wiki.
.md) from a folder named wiki_pages, converts them to HTML on-the-fly, and displays them. It also provides a web interface for creating and editing these files.wiki_pages folder. This makes it incredibly easy to backup or manually edit your content.hostname -I
Your IP address is the first set of numbers that appears (e.g., 192.168.1.35).
pi_wiki.py is saved.source venv/bin/activate
python pi_wiki.py
<your_pi_ip> with the address you found in step 1:
http://<your_pi_ip>:8080
http://<your_pi_ip>:8080/view/Shopping_List
Since the page doesn’t exist, you will be taken directly to the edit screen. Write your content, save it, and the page will be created.
Running the script from the terminal is fine for testing, but if you want your wiki to always be available (even after a reboot), you should run it as a systemd service.
nano to create a new service file.
sudo nano /etc/systemd/system/pi-wiki.service
User and the paths to match your setup.
whoami.pwd (run this in the same folder as pi_wiki.py).[Unit]
Description=Pi Wiki Server
After=network.target
[Service]
User=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME/path/to/your/project
ExecStart=/home/YOUR_USERNAME/path/to/your/project/venv/bin/python /home/YOUR_USERNAME/path/to/your/project/pi_wiki.py
Restart=always
[Install]
WantedBy=multi-user.target
CRITICAL: The ExecStart path must point to the python executable inside your venv folder.
sudo systemctl daemon-reload
sudo systemctl enable pi-wiki.service
sudo systemctl start pi-wiki.service
Your wiki is now running as a background service. You can check its status anytime with sudo systemctl status pi-wiki.service.