A few days ago I discovered a nice Notion alternative called “Outline“. It seemed to provide a nice feature set while also being self-hosted. The setup was somewhat cumbersome, as it needs an S3 Object storage, auth provider, postgres DB and Redis server. After setting up Keycloak for auth and MinIO for S3 Object storage I was ready to go.
But there was one thing missing I knew from Notion—multiple workspaces and switching between them. The UI looked like it supported context switching, though no “Create New Workspace” can be found. Digging through the web demo I found the function. The hosted version seems to support it while the self-hosted doesn’t weird. After looking through Outline’s Github issues I discovered someone complaining about a semi-working “Create workspace” button.
Configuration options to get Outline working
Most configuration is done using the
.env file. One option which caused the semi-working button to show up was
DEPLOYMENT=hosted. And I was able to confirm this aforementioned behaviour. Indeed a “Create Workspace”-button showed up. Creating a new Workspace, however, caused weird behaviour where I was trapped in the new Workspace, unable to switch.
Looking through the source code there was another interesting option SUBDOMAINS_ENABLED=true. Huh, I wonder what this does I thought while flicking it on.
Upon visiting the outline subdomain I was greeted with a redirect to a subdomain <workspace>.outline.domain.tld. This felt like the final stretch. I made a new certificate for *.outline subdomains and set up nginx to point them to the application as well.
And boom – I got a “hosted-only” feature working on a self-hosted instance.
Cool – but how do I do it?
First, add these lines to your configuration:
Now make sure you have SSL certificates for the subdomain you want to use. In my case *.outline.domain.tld. You can use certbot with the cloudflare-dns-challenge plugin to request fitting certificates.
Next, you need to configure your nginx webserver to properly handle the new request.
This is the config I’m using. This might not be perfect for your installation but should probably also work.
I hope this helps someone out there and saves them at least a little time!