Installation
Docker
Deploy Caby with Docker and Docker Compose.
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
-
Create a clean directory and fetch the starter
compose.yamlandconfig.yaml:Terminal window mkdir caby && cd cabycurl -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
- caby
-
Open
compose.yamlto review or modify any values for your setup. You can also reference the extended version for more options:compose.yaml services:# backend servicecaby-service:image: ghcr.io/caby-io/caby-service:0.2.1restart: unless-stoppedports:- "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 servicecaby-web:image: ghcr.io/caby-io/caby-web:0.2.1restart: unless-stoppedports:- "3000:3000"environment:# needs to point to the API's public URL + /v0PUBLIC_API_BASE: http://localhost:8080/v0volumes:cabynet:compose.yaml services:# backend servicecaby-service:image: ghcr.io/caby-io/caby-service:0.2.1restart: unless-stoppedports:- "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 servicecaby-web:image: ghcr.io/caby-io/caby-web:0.2.1restart: unless-stoppedports:- "3000:3000"environment:# this should point to where caby-service is reachable from the browser# don't forget the /v0PUBLIC_API_BASE: https://files-api.my-domain.com/v0# if you mount /app/cabynet yourself you don't need thisvolumes:cabynet: -
Next, open
config.yamland 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 compartmentsspaces:- name: homedisplay: "🏠 Home"- name: mediadisplay: "🎞️ Media"users:- name: caby_user# token for first-time login, generate with `openssl rand -hex 32`activation_token: REPLACE_MEspaces:- name: homepermissions: "*"- name: mediapermissions: "*"For a full reference of Caby’s config please see the config file page.
-
Open
config.yamland replaceREPLACE_MEwith a unique 64-character activation token. You can get one from the generator below:REPLACE_WITH_A_UNIQUE_64_CHARACTER_TOKENOr replace it with a command:
Terminal window sed -i "s/REPLACE_ME/$(openssl rand -hex 32)/" config.yamlTerminal window sed -i '' "s/REPLACE_ME/$(openssl rand -hex 32)/" config.yamlKeep your account’s activation token handy since we’ll need it to log in the first time.
-
Deploy the stack:
Terminal window docker compose up -d -
Watch the services come up:
Terminal window docker compose psIf either service doesn’t reach a running state, check its logs with
docker compose logs caby-service. -
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
-
Create a clean directory and fetch the starter
config.yaml:Terminal window mkdir caby && cd cabycurl -fO https://raw.githubusercontent.com/caby-io/caby/main/docker/config.yamlYour new directory should have one file:
- caby
- config.yaml
- caby
-
Next, open
config.yamland 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 compartmentsspaces:- name: homedisplay: "🏠 Home"- name: mediadisplay: "🎞️ Media"users:- name: caby_user# token for first-time login, generate with `openssl rand -hex 32`activation_token: REPLACE_MEspaces:- name: homepermissions: "*"- name: mediapermissions: "*"For a full reference of Caby’s config please see the config file page.
-
Open
config.yamland replaceREPLACE_MEwith a unique 64-character activation token. You can get one from the generator below:REPLACE_WITH_A_UNIQUE_64_CHARACTER_TOKENOr replace it with a command:
Terminal window sed -i "s/REPLACE_ME/$(openssl rand -hex 32)/" config.yamlTerminal window sed -i '' "s/REPLACE_ME/$(openssl rand -hex 32)/" config.yamlKeep your account’s activation token handy since we’ll need it to log in the first time.
-
Create the volume where everything (files, users, shares, …) is saved:
Terminal window docker volume create cabynet -
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 -
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 -
Watch the services come up:
Terminal window docker psIf either service doesn’t reach a running state, check its logs with
docker logs caby-service. -
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)
| Setting | Default | Description |
|---|---|---|
| Image | ghcr.io/caby-io/caby-service:0.2.1 | The backend service image and tag. Set to edge for the latest dev build. |
| Port | 8080 | Serves the API, versioned under /v0. |
| Data volume | cabynet:/app/cabynet | Everything Caby stores: files, users, and shares. |
| Config mount | ./config.yaml:/app/cabynet/config.yaml:ro | The main config. Caby only needs read access to it. |
Frontend (caby-web)
| Setting | Default | Description |
|---|---|---|
| Image | ghcr.io/caby-io/caby-web:0.2.1 | The frontend web app image and tag. Should always match the backend tag. |
PORT | 3000 | The port the frontend web app listens on. |
PUBLIC_API_BASE | http://localhost:8080/v0 | The API URL as the browser reaches it. Must include the API version, unlike urls.backend. |