Skip to content

Self-Hosting

Musubi is designed to be self-hosted. If you want your calendar data on your own infrastructure, this is the path.

  • A server with Docker and Docker Compose installed
  • A domain name (optional but recommended for HTTPS)
Terminal window
git clone https://github.com/f-tuma/musubi.git
cd musubi
Terminal window
cp .env.example .env

Edit .env with your production values. Key variables:

VariableDescription
DATABASE_URLPostgreSQL connection string
BETTER_AUTH_SECRETLong random secret — generate with openssl rand -base64 32
BETTER_AUTH_URLThe public URL of your API, e.g. https://musubi.yourdomain.com
ENVIRONMENTSet to anything other than dev for production

For password reset emails to work, also set SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASS, and FROM_EMAIL.

Terminal window
docker compose up -d

This starts the API server, the PostgreSQL database, and runs migrations automatically.

When users open Musubi for the first time, they can enter a custom server URL on the welcome screen. Give them your server’s address — e.g. https://musubi.yourdomain.com.


To pull the latest version:

Terminal window
git pull
docker compose down
docker compose up -d --build

Migrations run automatically on startup.


The only stateful piece is the PostgreSQL database. Back it up with:

Terminal window
docker exec musubi-db pg_dump -U postgres musubi > backup.sql

Restore with:

Terminal window
cat backup.sql | docker exec -i musubi-db psql -U postgres musubi