Prerequisites
Before you begin, ensure you have the following installed:- Node.js (v18 or later)
- Bun (recommended package manager)
- Docker and Docker Compose
Docker is optional but recommended for running the local database and Redis services. If you only want to work on frontend features, you can skip the Docker setup.
Installation
Fork and clone the repository
Fork the OpenCut repository to your GitHub account, then clone it locally:
Configure environment variables
Open Or use an online generator: generate-secret.vercel.app/32
apps/web/.env.local and configure the required variables:Generate authentication secret
Generate a secureBETTER_AUTH_SECRET using one of these methods:The
.env.example file has sensible defaults that match the Docker Compose configuration. For basic development, you only need to set BETTER_AUTH_SECRET.Start Docker services
Start the PostgreSQL database and Redis services:This starts:
- PostgreSQL on port 5432
- Redis on port 6379
- Serverless Redis HTTP on port 8079 (Upstash-compatible REST API)
Start the development server
Start the Next.js development server from the project root:The application will be available at http://localhost:3000.
Optional services
The following environment variables are optional and can be configured for additional features:Blog integration
Audio library
Auto-captions (transcription)
Self-hosting with Docker
To run a complete production build in Docker:The Docker production build includes all services: database, Redis, and the Next.js application.
Available scripts
From the project root:bun dev:web- Start the web development serverbun build:web- Build the web application for productionbun test- Run all testsbun lint:web- Check for linting issuesbun lint:web:fix- Fix linting issues automaticallybun format:web- Format code with Biome
apps/web/:
bun run dev- Start development server with Turbopackbun run build- Build for productionbun run lint- Check linting with Biomebun run lint:fix- Fix linting issuesbun run format- Format codebun run db:generate- Generate database migrationsbun run db:migrate- Run database migrationsbun run db:push:local- Push schema changes to local databasebun run db:push:prod- Push schema changes to production
Troubleshooting
Docker services not starting
If Docker services fail to start, check that ports 5432, 6379, and 8079 are not already in use:Database connection errors
Ensure theDATABASE_URL in .env.local matches the Docker Compose configuration:
Package manager issues
If you encounter workspace protocol errors with npm, either:- Upgrade to npm v9 or later:
npm install -g npm@latest - Use Bun or pnpm instead
Next steps
Architecture
Learn about OpenCut’s system architecture
Contributing
Start contributing to the project