Miru

Docker Compose

This guide shows you the steps to deploy a self-hosted instance of Miru using Docker Compose.

Prerequisites

Before we start, you need to make sure you have a VPS or on-prem machine with:

Installation

By far, the easiest way to get started with Miru is to use Docker Compose. The Miru repository comes with a docker-compose.yml file that you can use as a template.

Create a new docker-compose.yml file:

volumes:
    database:
    garage-meta:
    garage-data:

services:
    database:
        container_name: database
        image: postgres:17.3
        ports:
            - "5432:5432"
        volumes:
            - database:/var/lib/postgresql/data
        environment:
            POSTGRES_PASSWORD: VerySecurePassword123
            POSTGRES_USER: miru
            POSTGRES_DB: miru

    garage:
        container_name: garage
        image: dxflrs/garage:v2.3.0
        command: ["/garage", "server", "--single-node", "--default-bucket"]
        ports:
            - "3900:3900"
        volumes:
            - ./garage.toml:/etc/garage.toml:ro
            - garage-meta:/var/lib/garage/meta
            - garage-data:/var/lib/garage/data
        environment:
            - GARAGE_RPC_SECRET=${GARAGE_RPC_SECRET}
            - GARAGE_DEFAULT_ACCESS_KEY=${S3_ACCESS_KEY}
            - GARAGE_DEFAULT_SECRET_KEY=${S3_SECRET_KEY}
            - GARAGE_DEFAULT_BUCKET=public

    monitor:
        container_name: monitor
        image: git.nordstud.io/nord-studio/miru/monitor:latest
        volumes:
            - ./config.toml/:/config.toml
        environment:
            - DATABASE_URL=postgresql://miru:${POSTGRES_PASSWORD}@database:5432/miru
            - DATABASE_SSL=false
            - AGENT_TOKEN=${AGENT_TOKEN}
        depends_on:
            - database
            - web

    web:
        container_name: web
        image: git.nordstud.io/nord-studio/miru/web:latest
        volumes:
            - ./config.toml/:/app/apps/web/config.toml
        ports:
            - "3000:3000"
        environment:
            - DATABASE_URL=postgresql://miru:${POSTGRES_PASSWORD}@database:5432/miru
            - DATABASE_SSL=false
            - S3_ENDPOINT=garage
            - S3_PORT=3900
            - S3_SECURE=false
            - S3_ACCESS_KEY=${S3_ACCESS_KEY}
            - S3_SECRET_KEY=${S3_SECRET_KEY}
            - AUTH_SECRET=${AUTH_SECRET}
            - AGENT_TOKEN=${AGENT_TOKEN}
            - APP_DOMAIN=status.example.com
            - MONITOR_URL=http://monitor:8080
            - ENABLE_EMAIL=false
            - EMAIL_VERIFICATION=false
            - SMTP_HOST=
            - SMTP_PORT=
            - SMTP_SECURE=
            - SMTP_USER=
            - SMTP_PASSWORD=
            - SMTP_FROM=
        depends_on:
            - database
            - garage

Create a garage.toml file next to your docker-compose.yml. This is the Garage object storage configuration that the garage service mounts:

metadata_dir = "/var/lib/garage/meta"
data_dir = "/var/lib/garage/data"
db_engine = "lmdb"

# Single node, so nothing to replicate.
replication_factor = 1

rpc_bind_addr = "[::]:3901"
rpc_public_addr = "127.0.0.1:3901"
# rpc_secret is passed in via the GARAGE_RPC_SECRET env var in docker-compose.yml

[s3_api]
# Left as us-east-1 (rather than Garage's "garage" default) so the S3 client works without having to pin a region on its side.
s3_region = "us-east-1"
api_bind_addr = "[::]:3900"
root_domain = ".s3.garage.localhost"

Create a .env file next to your docker-compose.yml. Compose reads it automatically, and refuses to start while any of these are empty.

Generate a fresh set of values:

{
  echo "POSTGRES_PASSWORD=$(openssl rand -hex 32)"
  echo "BETTER_AUTH_SECRET=$(openssl rand -hex 32)"
  echo "GARAGE_RPC_SECRET=$(openssl rand -hex 32)"
  echo "S3_ACCESS_KEY=GK$(openssl rand -hex 12)"
  echo "S3_SECRET_KEY=$(openssl rand -hex 32)"
  echo "AGENT_TOKEN=$(openssl rand -hex 32)"
} > .env

Garage creates the S3 key from S3_ACCESS_KEY and S3_SECRET_KEY on first boot and the web service authenticates with the same pair.

Create a new config.toml file in the same directory as your docker-compose.yml file. This file is used to configure various features that Miru supports. You can start with the following content:

[email]
enabled = false
verification = false

[incidents.auto]
enabled = true
pings_threshold = 3

[storage]
max_size = 12582912

[users]
delete_on_empty = false

[workspace]
creation = true

Run the following command to spin up the containers:

docker compose up -d

Navigate to your servers IP on port 3000 in your browser to access the Miru dashboard. You should see the welcome screen as seen below. Welcome Screen

On this page