Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

2.3 KB
Raw Blame

title: Self-hosting description: Run Alexandrie on your own server with Docker Compose. navigation: icon: i-lucide-shield-check

Self-hosting with Docker Compose

To self-host Alexandrie, you can use Docker Compose to run the frontend, backend, and database services. This is the recommended approach for most users.

You can find the docker-compose.yml file in the root of the Alexandrie repository. It defines the services and their configurations: https://github.com/Smaug6739/Alexandrie/blob/main/docker-compose.yml

You can also download the .env.example file from the repository and copy it to .env. This file contains the default environment variables used by the services. You can edit this file to customize your deployment: https://github.com/Smaug6739/Alexandrie/blob/main/.env.example

::note For local testing, you have nothing to configure. Just run docker compose up in the directory containing the docker-compose.yml file. ::

Recommended minimum configuration

FRONTEND_URL=https://wiki.example.com
API_URL=https://api.example.com
CDN_URL=https://files.example.com

COOKIE_DOMAIN=example.com
JWT_SECRET=replace-with-a-long-random-value

Generate secrets with openssl rand -hex 32. Also change MYSQL_PASSWORD, MYSQL_ROOT_PASSWORD, RUSTFS_ACCESS_KEY, and RUSTFS_SECRET_KEY before the first launch in production.

It is also recommended to not modify the docker-compose.yml file and instead use environment variables to configure the services. This makes it easier to update the deployment in the future.

Exposure rules

  • Publish the frontend at FRONTEND_URL.
  • Publish the API at API_URL, or adapt your proxy to serve it on a path compatible with the frontend configuration.
  • Publish object storage only when browser clients must directly read files; otherwise use an internal endpoint suited to your architecture.
  • Do not publish MySQL ports or unnecessary RustFS administration interfaces on the public network.

Updating

Back up MySQL and S3 storage first. Then pull new images and recreate services:

docker compose pull
docker compose up -d
docker compose logs -f --tail=100

Changing JWT_SECRET invalidates existing sessions. A change to the public URL or cookie domain requires a new login test in the browser.