Cloudrive

Getting started

Run Postgres, the Go API and the web app on your machine.

Prerequisites

  • Bun 1.4+ (the repo pins packageManager: bun@1.4.4).
  • Go 1.26+.
  • PostgreSQL 18 (the schema uses uuidv7()).
  • The migrate CLI (golang-migrate) only if you create new migrations; applying them goes through cmd/migrate.

Install

bun install

The root install also runs go mod tidy for apps/api (its install script) and generates the docs collections for apps/docs.

Configure the API

cp apps/api/.env.example apps/api/.env

Fill in at least:

VariableWhy
MACHINE_IDRequired, non-zero.
APP_SECRETSigns Authula tokens and the provider OAuth state.
DB_DSNPostgres connection string.
WEB_URL, AUTH_BASE_URLWhere the SPA and the API are reachable (Authula & OAuth redirects are built from these).
RESEND_*Required at boot; sign-up, password reset and magic-link mails go through Resend.
STORAGE_CREDENTIALS_KEYSThe credential vault key, v1:<base64 32 bytes>. Generate with openssl rand -base64 32.
SEED_ON_BOOTSet true to run the idempotent seeders (provider catalog + SUPER_USER) on boot.
SUPER_USERemail:password (8–128 chars); required when SEED_ON_BOOT=true to seed the super_user account.

Fail closed

The server refuses to start without STORAGE_CREDENTIALS_KEYS, so provider credentials can never be written in plaintext.

All variables are described in Configuration.

Create the schema

cd apps/api
make db/migrations/up        # or db/migrations/up/seed to also seed the provider catalog

The provider catalog (google_drive, onedrive, dropbox, s3_compatible) comes from the provider seeder; without it GET /v1/providers is empty.

Run

bun run dev:api    # API on :8080, S3 gateway on :9000
bun run dev:web    # dashboard SPA on :3000, proxies /v1 to the API
bun run dev:main   # marketing site (vinext)
bun run dev:docs   # this site on :3001

bun run dev runs all of them in parallel.

Dashboard without a backend

In development, /preview renders the dashboard shell with mock data and no API calls. Add ?content=settings&view=providers to preview a settings panel. Production builds answer 404 there.

Checks

bun run build                  # every package; also the pre-push hook
bun run lint && bun run format:check
cd apps/api && go test ./...   # the S3 gateway integration test needs Docker

On this page