In doing all this cool stuff, It got to the point where there was so much of it that I had done so quickly I was starting to forget what I did, and how I did it. Add to that the fact that stuff falls out of my brain too quickly these days. I needs somewhere to keep it. I was thinking of options, I use OneNote to keep a lot of my work notes, but I wanted to keep it “online” and also leverage the infrastructure that I had built. That’s when I thought of a wiki. Last time I had a wiki setup was about 2014, and I used DocuWiki. It was great at the time, easy to edit and use (as most wiki’s are) but I wanted to have a bit more abstraction of the content from the wiki. I was seeing so much wiki like stuff in GitHub, that I thought that was a way to go, and that go me to investigating alternatives.
The Criteria that I wanted for a wiki was,
- Pages stored in gitlab and version controlled
- Authentication via SAML / OAUTH so I can SSO
- Deployment via Docker so its fast and easy.
The winner was wiki.js! Not only does it tick all the boxes above it looks really nice too! here’s how I setup it up
Initial Setup
There was a docker-compose.yaml, so I could deploy it as a stack in portainer.
version: '2'
services:
db:
image: postgres:11-alpine
environment:
POSTGRES_DB: wiki
POSTGRES_PASSWORD: wikijsrocks
POSTGRES_USER: wikijs
logging:
driver: "none"
restart: unless-stopped
volumes:
- db-data:/var/lib/postgresql/data
wiki:
image: requarks/wiki:2
depends_on:
- db
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: wikijs
DB_PASS: wikijsrocks
DB_NAME: wiki
restart: unless-stopped
ports:
- "80:3000"
volumes:
db-data:
Once that was setup, I added it to NPM to give it a fully functional SSL and proper DNS Name. I also added it to the cloudflare-tunnel network, so If I want to open it to the world I can, and I used that range for the Forward IP. I used the letsencrypt wildcard Cert, and I was good to go!

Authentication
Once that was setup, the next thing was setting up the Authentication. I wanted to use OATH, as that has served me well on other internal resources, and I have found it easier than SAML.
In the settings of wiki.js, go to authentication, and add a strategy, and from here I chose Generic OpenID Connect / OAuth2. In another browser tab, logged in to Authentik as admin, I created the application, and the provider, and copied the details in. it worked first time, without any troubleshooting required. It has been the easiest app to date to get up and running AND get SSO working on.
Backend Storage
I wanted to have version control, but also have the ability to change wiki / documentation system if I ever wanted to. So I have setup gitlab in my environment, and I am using that as external storage for pages.
It took many attempts to get it work, but in the end I am using basic auth, and its over SSL (through NPM) and its working great! There are just a few pages that I slammed in there before I setup gitlab, so I need to manually convert them over the markup, then they will store to gitlab under the wiki project.
Overall I am very happy with how this is setup, While researching this article I found another home lab user who is using wiki.js as their publishing tool too. I have set it up just to be a dump of information for now, but maybe when I am bored I will set it up for public browsing.