Docker
A Caby deployment can be broken into three basic parts:
- The backend service,
- The frontend service, and
- A valid config file
There are several ways to deploy Caby using Docker. If you’re not sure which to use we recommend going with Docker Compose.
Docker Compose
Section titled “Docker Compose”Prerequisites
Section titled “Prerequisites”Before starting, ensure that you have:
- Docker, and
- Docker Compose
-
Create the two files Caby needs in an empty working directory:
Terminal window touch config.yaml compose.yamlYou should now have both files side by side:
- compose.yaml
- config.yaml
-
Decide where Caby stores its files.
In most cases you’ll want to share the files Caby manages with other applications, so they need to live somewhere other containers can reach. You could bind-mount a local directory to the backend:
services:caby-service:volumes:- /srv/cabynet-files:/app/cabynetFor this guide we’ll use a named volume that any other container can mount. Create it:
Terminal window docker volume create cabynet -
Define the backend and frontend services in
compose.yaml:compose.yaml services:# backend servicecaby-service:image: ghcr.io/caby-io/caby-service:edge# keep the backend in a startup loop while we prep the configrestart: 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:edgerestart: unless-stoppedports:- "3000:3000"environment:# needs to point to the API's public URLPUBLIC_API_BASE: https://files-api.my-domain.com/v0volumes:cabynet:external: true -
Fill in
config.yaml.See the config file page for the available options. Here’s an example of a starter setup with two spaces and a single user:
config.yaml urls:backend: https://files-api.my-domain.comfrontend: https://files.my-domain.comspaces:- name: homedisplay: "🏠 Home"- name: mediadisplay: "🎞️ Media"users:- name: caby_guyemail: caby_guy@caby.io# a unique 64-character token for first-time loginactivation_token: REPLACE_WITH_A_UNIQUE_64_CHARACTER_TOKENspaces:- name: homepermissions: "*"- name: mediapermissions: "*" -
Deploy the stack:
Terminal window docker compose up
Docker CLI
Section titled “Docker CLI”You can also run Caby with just Docker, without Docker Compose:
Prerequisites
Section titled “Prerequisites”Before starting, ensure that you have:
- Docker
-
Create Caby’s configuration file. You should reference the config file page to see what values you can set. Here’s an example of a starter setup with two spaces and a single user:
config.yaml urls:backend: https://files-api.my-domain.comfrontend: https://files.my-domain.comspaces:- name: homedisplay: "🏠 Home"- name: mediadisplay: "🎞️ Media"users:- name: caby_guyemail: caby_guy@caby.io# a unique 64-character token for first-time loginactivation_token: REPLACE_WITH_A_UNIQUE_64_CHARACTER_TOKENspaces:- name: homepermissions: "*"- name: mediapermissions: "*"You should now have this file saved in your working directory:
- config.yaml
-
Run the backend service in the background:
Terminal window docker run -d \--name caby-service \-p 8080:8080 \-v "$(pwd)/cabynet:/app/cabynet" \-v "$(pwd)/config.yaml:/app/cabynet/config.yaml:ro" \--restart unless-stopped \ghcr.io/caby-io/caby-service:edge -
Run the frontend service in the background:
Terminal window docker run -d \--name caby-web \-p 3000:3000 \-e PUBLIC_API_BASE=https://files-api.my-domain.com/v0 \--restart unless-stopped \ghcr.io/caby-io/caby-web:edge