Skip to content
flexcal Documentation

From source

Use this path when you do not want to run containers. For a development environment with hot reload and seeded users, see Development setup instead.

Terminal window
git clone https://codefloe.com/flexcal/flexcal.git
cd flexcal

On Windows, clone from Git Bash with admin privileges so symlinks are created:

Terminal window
git clone -c core.symlinks=true https://codefloe.com/flexcal/flexcal.git
Terminal window
bun install

Bun is the only supported package manager. npm, yarn and pnpm are not.

Terminal window
cp .env.example .env
cp .env.appStore.example .env.appStore

Generate the two mandatory secrets:

Terminal window
# NEXTAUTH_SECRET
openssl rand -base64 32
# CALENDSO_ENCRYPTION_KEY, must be 32 bytes for AES256
openssl rand -base64 24

Point DATABASE_URL at your PostgreSQL instance and copy the same value into .env.appStore:

DATABASE_URL='postgresql://<user>:<pass>@<db-host>:<db-port>/<db-name>'

Set NEXT_PUBLIC_WEBAPP_URL to the public URL of the instance, with no trailing slash. See Configuration for the rest.

The schema lives in packages/prisma/schema.prisma.

Terminal window
bun run --cwd packages/prisma db-deploy

db-deploy applies existing migrations and never generates new ones, which is what you want in production. db-migrate is the development counterpart and can drop data.

Terminal window
bun run build
bun run start

Open the instance in a browser. The setup wizard creates the first user with the ADMIN role. It only works while the User table is empty.

Alternatively, use Prisma Studio:

Terminal window
bun run db-studio

Open the User model, add a record with email, username, a BCrypt-hashed password, and metadata set to {}.

A few features depend on scheduled requests to the endpoints under apps/web/app/api/cron. Wire these up with whatever scheduler your platform provides (systemd timers, Kubernetes CronJobs, or a platform feature such as Vercel Cron).

flexcal is a plain Next.js application, so generic Next.js guidance applies to reverse proxies, TLS termination and hosting platforms. See Troubleshooting for the proxy header settings that matter to NextAuth.