For most Docker-based setups, we recommend deploying with Docker Compose. This page will walk you through deploying with Docker Compose or the Docker CLI.

Docker Compose

Caby ships a starter compose.yaml and config.yaml which we will use to deploy with Docker Compose.

Prerequisites

Before starting, ensure that you have:

  • Docker, and
  • Docker Compose

Steps

  1. Create a clean directory and fetch the starter compose.yaml and config.yaml:

    Terminal window
    mkdir caby && cd caby
    curl -fO "https://raw.githubusercontent.com/caby-io/caby/main/docker/{compose,config}.yaml"

    Your new directory should have two files:

    • caby
      • compose.yaml
      • config.yaml
  2. Open compose.yaml to review or modify any values for your setup. You can also reference the extended version for more options:

    compose.yaml
    services:
    # backend service
    caby-service:
    image: ghcr.io/caby-io/caby-service:0.2.1
    restart: unless-stopped
    ports:
    - "8080:8080"
    volumes:
    # everything (files, users, shares, ...) is saved here
    - cabynet:/app/cabynet
    # the main configuration. Caby only needs read access to this
    - ./config.yaml:/app/cabynet/config.yaml:ro
    # frontend service
    caby-web:
    image: ghcr.io/caby-io/caby-web:0.2.1
    restart: unless-stopped
    ports:
    - "3000:3000"
    environment:
    # needs to point to the API's public URL + /v0
    PUBLIC_API_BASE: http://localhost:8080/v0
    volumes:
    cabynet:
    compose.yaml
    services:
    # backend service
    caby-service:
    image: ghcr.io/caby-io/caby-service:0.2.1
    restart: unless-stopped
    ports:
    - "8080:8080"
    volumes:
    # this is pointing to a volume managed by Docker
    - cabynet:/app/cabynet
    # we could also just mount a local directory
    # - /srv/cabynet:/app/cabynet
    # or multiple
    # - /mnt/home:/app/cabynet/spaces/home
    # - /mnt/media:/app/cabynet/spaces/media
    - ./config.yaml:/app/cabynet/config.yaml:ro
    # frontend service
    caby-web:
    image: ghcr.io/caby-io/caby-web:0.2.1
    restart: unless-stopped
    ports:
    - "3000:3000"
    environment:
    # this should point to where caby-service is reachable from the browser
    # don't forget the /v0
    PUBLIC_API_BASE: https://files-api.my-domain.com/v0
    # if you mount /app/cabynet yourself you don't need this
    volumes:
    cabynet:
  3. Next, open config.yaml and review or modify the configuration for your setup:

    config.yaml
    urls:
    # Where your backend server is exposed (e.g. https://files-api.caby.net)
    backend: http://localhost:8080
    # Where your frontend server is exposed (e.g. https://files.caby.net)
    frontend: http://localhost:3000
    # A list of spaces or compartments
    spaces:
    - name: home
    display: "🏠 Home"
    - name: media
    display: "🎞️ Media"
    users:
    - name: caby_user
    # token for first-time login, generate with `openssl rand -hex 32`
    activation_token: REPLACE_ME
    spaces:
    - name: home
    permissions: "*"
    - name: media
    permissions: "*"

    For a full reference of Caby’s config please see the config file page.

  4. Open config.yaml and replace REPLACE_ME with a unique 64-character activation token. You can get one from the generator below:

    REPLACE_WITH_A_UNIQUE_64_CHARACTER_TOKEN

    Or replace it with a command:

    Terminal window
    sed -i "s/REPLACE_ME/$(openssl rand -hex 32)/" config.yaml
    Terminal window
    sed -i '' "s/REPLACE_ME/$(openssl rand -hex 32)/" config.yaml

    Keep your account’s activation token handy since we’ll need it to log in the first time.

  5. Deploy the stack:

    Terminal window
    docker compose up -d
  6. Watch the services come up:

    Terminal window
    docker compose ps

    If either service doesn’t reach a running state, check its logs with docker compose logs caby-service.

  7. Once both services are running, navigate to the activation page (e.g. http://localhost:3000/activate) and paste your activation token to activate your account.

Docker CLI

Caby can also be deployed with just the Docker CLI, using the same starter config.yaml.

Prerequisites

Before starting, ensure that you have:

  • Docker

Steps

  1. Create a clean directory and fetch the starter config.yaml:

    Terminal window
    mkdir caby && cd caby
    curl -fO https://raw.githubusercontent.com/caby-io/caby/main/docker/config.yaml

    Your new directory should have one file:

    • caby
      • config.yaml
  2. Next, open config.yaml and review or modify the configuration for your setup:

    config.yaml
    urls:
    # Where your backend server is exposed (e.g. https://files-api.caby.net)
    backend: http://localhost:8080
    # Where your frontend server is exposed (e.g. https://files.caby.net)
    frontend: http://localhost:3000
    # A list of spaces or compartments
    spaces:
    - name: home
    display: "🏠 Home"
    - name: media
    display: "🎞️ Media"
    users:
    - name: caby_user
    # token for first-time login, generate with `openssl rand -hex 32`
    activation_token: REPLACE_ME
    spaces:
    - name: home
    permissions: "*"
    - name: media
    permissions: "*"

    For a full reference of Caby’s config please see the config file page.

  3. Open config.yaml and replace REPLACE_ME with a unique 64-character activation token. You can get one from the generator below:

    REPLACE_WITH_A_UNIQUE_64_CHARACTER_TOKEN

    Or replace it with a command:

    Terminal window
    sed -i "s/REPLACE_ME/$(openssl rand -hex 32)/" config.yaml
    Terminal window
    sed -i '' "s/REPLACE_ME/$(openssl rand -hex 32)/" config.yaml

    Keep your account’s activation token handy since we’ll need it to log in the first time.

  4. Create the volume where everything (files, users, shares, …) is saved:

    Terminal window
    docker volume create cabynet
  5. Run the backend service in the background:

    Terminal window
    docker run -d \
    --name caby-service \
    -p 8080:8080 \
    -v cabynet:/app/cabynet \
    -v "$(pwd)/config.yaml:/app/cabynet/config.yaml:ro" \
    --restart unless-stopped \
    ghcr.io/caby-io/caby-service:0.2.1
  6. Run the frontend service in the background:

    Terminal window
    docker run -d \
    --name caby-web \
    -p 3000:3000 \
    -e PUBLIC_API_BASE=http://localhost:8080/v0 \
    --restart unless-stopped \
    ghcr.io/caby-io/caby-web:0.2.1
  7. Watch the services come up:

    Terminal window
    docker ps

    If either service doesn’t reach a running state, check its logs with docker logs caby-service.

  8. Once both services are running, navigate to the activation page (e.g. http://localhost:3000/activate) and paste your activation token to activate your account.

Values reference

Below are the most commonly overridden values for Docker setups. For everything the config file supports, see the config file page.

Backend (caby-service)

SettingDefaultDescription
Imageghcr.io/caby-io/caby-service:0.2.1The backend service image and tag. Set to edge for the latest dev build.
Port8080Serves the API, versioned under /v0.
Data volumecabynet:/app/cabynetEverything Caby stores: files, users, and shares.
Config mount./config.yaml:/app/cabynet/config.yaml:roThe main config. Caby only needs read access to it.

Frontend (caby-web)

SettingDefaultDescription
Imageghcr.io/caby-io/caby-web:0.2.1The frontend web app image and tag. Should always match the backend tag.
PORT3000The port the frontend web app listens on.
PUBLIC_API_BASEhttp://localhost:8080/v0The API URL as the browser reaches it. Must include the API version, unlike urls.backend.