$selfhostrecipes.com
·9 min read

Alexandrie: A Self-Hosted Markdown Knowledge Base with Docker Compose

A practical walkthrough of Alexandrie, an open-source, offline-first knowledge base with a Markdown editor, teams, OIDC login and S3 storage, and how to run it behind a reverse proxy with Docker Compose.

self-hostingdocker-composeopen-sourcessosaas-alternatives

01What Alexandrie Is and Who It's For

I keep a short list of self-hosted note and wiki tools, and Alexandrie is a recent addition worth a look. It's an open-source knowledge base built around an extended Markdown editor, aimed at both individuals and small teams. The project positions itself as an alternative to Notion, Obsidian and Confluence, and it is released under the MIT license. The feature list is what makes it interesting for a homelab. The editor is built on CodeMirror 6 and supports LaTeX, custom containers, interactive checkboxes, snippets and diagrams. Content is organized into teams, workspaces, categories and nested documents. Access has five levels: none, read, write, admin and owner. Every workspace includes Kanban boards, there is a Ctrl + K command center, and full-text search is built in. It is also a PWA you can install on desktop or mobile, with offline support and synchronization. On the operations side, it supports OpenID Connect providers for SSO, S3-compatible object storage for media, and ZIP import and export for moving content in and out. This post is my own take on how I would deploy it.

If you only want a single-user notes app, check whether you need a multi-tenant stack at all. Alexandrie runs four containers, which is reasonable for a team wiki and heavier than a plain-files notes tool.

02The Four Services in the Stack

The setup docs describe a stack of four services defined in a single docker-compose.yml file: - MySQL stores user data and metadata. - RustFS is the S3-compatible object storage used for files and media. - The backend is a Go API server that handles authentication, storage and access control. - The frontend is a Nuxt 4 web app that talks to the backend over a REST API. All four sit on a dedicated Docker network called alexandrie-network. For local testing, the frontend answers on port 8200, the backend API on 8201, and RustFS on 9000. The split between three public endpoints matters later. Your browser talks to the frontend, to the API, and to the object store directly for files. When you put this behind a reverse proxy, each of those URLs has to be reachable from the browser, and the environment variables have to describe them accurately. Most first-run problems with this kind of stack come from a mismatch there.

Per the docs, don't expose MySQL or RustFS directly in production. Put a reverse proxy such as Nginx, Traefik or Caddy in front and terminate HTTPS there.

03Quick Start: Running It Locally

The upstream quick start is three steps: download the example env file and the compose file, copy the env file to .env, and bring the stack up. I would do this on a throwaway machine or a local workstation first, just to see the interface and confirm all four containers start cleanly. Once it is up, open http://localhost:8200. No default account is created, so the first thing you do is register a user from the frontend. If you want that account to be an application admin, add its ID to the ADMIN_ACCOUNTS variable. That variable takes a comma-separated list of user IDs. Look at the downloaded compose file before running it for real. I always read a third-party compose file before starting it, mainly to see which ports are published, which volumes are mounted and which variables it reads from .env.
[quick-start.sh]
1# 1. Download the example env file and the compose file
2curl -O https://raw.githubusercontent.com/Smaug6739/Alexandrie/main/.env.example
3curl -O https://raw.githubusercontent.com/Smaug6739/Alexandrie/main/docker-compose.yml
4
5# 2. Create your own env file
6cp .env.example .env
7
8# 3. Start the stack
9docker compose up -d
10
11# Then open http://localhost:8200 and register the first account

04Configuring It for a Real Domain

For production, the docs point you at a .env file next to docker-compose.yml, and only variables from .env.example are officially supported. These are the ones I would change first. FRONTEND_URL, API_URL and CDN_URL are the public URLs your browser uses to reach the frontend, the API and the object storage. CDN_ENDPOINT is a path prefix that should match the bucket name, so you usually leave it as /alexandrie/. File URLs are built as CDN_URL plus CDN_ENDPOINT plus the object path. If images or attachments fail to load, open your browser's devtools, look at the URL actually requested, and adjust these variables. COOKIE_DOMAIN is the important one. It must be the highest common domain shared by the frontend and the backend, with no protocol. If the frontend is on one subdomain and the API on another, use the parent domain. The docs warn that if it is wrong, login appears to work but you get logged out immediately. ALLOW_UNSECURE should be false in production so HTTPS is enforced. JWT_SECRET signs your tokens, so generate a long random string with openssl or similar. Changing it later invalidates all existing sessions. The example below uses placeholder domains and placeholder secrets. Replace every one of them.
[.env]
1FRONTEND_URL=https://notes.example.com
2API_URL=https://api.notes.example.com
3CDN_URL=https://cdn.notes.example.com
4CDN_ENDPOINT=/alexandrie/
5
6COOKIE_DOMAIN=example.com
7ALLOW_UNSECURE=false
8JWT_SECRET=replace-with-a-long-random-string
9ADMIN_ACCOUNTS=1
10
11MYSQL_DATABASE=alexandrie
12MYSQL_USER=alexandrie
13MYSQL_PASSWORD=replace-with-a-strong-password
14MYSQL_ROOT_PASSWORD=replace-with-another-strong-password
15
16RUSTFS_ACCESS_KEY=replace-with-an-access-key
17RUSTFS_SECRET_KEY=replace-with-a-secret-key
18MINIO_BUCKET=alexandrie

Remember that the browser fetches files straight from the object store URL. Your reverse proxy needs a route for CDN_URL as well, not just for the frontend and the API.

05OIDC Login and Locking Down Sign-Ups

If this is going to hold anything private, I would turn off open registration once your accounts exist. CONFIG_DISABLE_SIGNUP=true disables new registrations in both the frontend and the backend. CONFIG_DISABLE_LANDING=true sends visitors straight to the login page instead of the landing page. Alexandrie supports OpenID Connect, which the docs say is available since version 8.5.0, and you can configure up to ten providers. For each provider you set four variables, numbered from 1 to 10: a config URL pointing at the provider's .well-known/openid-configuration document, a client ID, a client secret, and a display name. In your identity provider, register the redirect URI as https://your-alexandrie-frontend/login/oidc/callback, replacing the host with your real frontend address. The docs note that these variables must also be wired into the backend service in docker-compose.yml, either as direct values or as references to your env file. The fragment below shows that pattern for the first provider. It goes inside the backend service's environment section. Once SSO works, you can set CONFIG_DISABLE_NATIVE_LOGIN=true to enforce it. If you would rather keep the native login available but hidden, use CONFIG_HIDE_NATIVE_LOGIN_FORM=true, or set CONFIG_OIDC_PROVIDER_AUTO_REDIRECT to a provider name so users are sent straight to that provider. Test your SSO login in a separate browser session before disabling native login, so you can't lock yourself out.
[docker-compose.yml (backend environment fragment)]
1OIDC_1_CONFIG_URL: ${OIDC_1_CONFIG_URL}
2OIDC_1_CLIENT_ID: ${OIDC_1_CLIENT_ID}
3OIDC_1_CLIENT_SECRET: ${OIDC_1_CLIENT_SECRET}
4OIDC_1_PROVIDER_NAME: ${OIDC_1_PROVIDER_NAME}

06Storage, Backups and Keeping It Updated

Storage is where I would spend the most planning time. Files and media live in the S3-compatible store. The docs say the backend creates two buckets by default, alexandrie and alexandrie-backups. I wouldn't treat a bucket living next to the database as a complete backup strategy, though. Copy your MySQL data and your object storage off the host as well, and test a restore. There is also a user-level safety net: ZIP import and export can back up selected nodes, metadata or the whole platform state in one action. That is handy for moving between instances. If your S3 endpoint is served over HTTPS with an internal certificate authority, the docs describe MINIO_SECURE to choose HTTPS or HTTP when the backend connects, and MINIO_CA_PATH to point at a PEM CA certificate that you must mount into the backend container. There is a MINIO_INSECURE_TLS option that skips certificate verification, but the docs mark it as not recommended outside debugging and local testing. The project ships releases frequently, so read the changelog before upgrading. The latest release I looked at was v8.14.4 from early November 2026. Recent releases include fixes around S3 startup when a bucket policy call is unsupported, aligning the default CDN_URL with RustFS on port 9000, and injecting environment variables into the service worker at runtime rather than build time. I would pin a version once you have a working setup and move deliberately instead of following latest.

Never set MINIO_INSECURE_TLS=true on a production instance. If you use a private CA, mount its certificate into the backend and set MINIO_CA_PATH instead.

07Should You Run It?

My take: Alexandrie is a good fit if you want a Markdown-first wiki with real team permissions, SSO and an offline-capable PWA, and you're comfortable running a multi-container stack. The deployment model is familiar: a Compose file, an env file, a reverse proxy, and an identity provider if you want one. It is a less obvious fit if you want plain Markdown files on disk, since your content lives in MySQL and an object store. That makes backups a bit more involved than copying a folder. My suggested path is to start with the local quick start, check that the editor and search suit your workflow, then move to a real domain. Get COOKIE_DOMAIN and the three public URLs right, add SSO, close registrations, and set up off-host backups. The upstream repository is at https://github.com/smaug6739/alexandrie, and the project's setup docs and release notes are the source of truth if anything here has drifted since I wrote it.

About the Author

Frank Pegasus

Pen name of the Selfhost Recipes editors. Guides are written for people running their own services with Docker Compose and are checked against the official documentation of the tools they cover.