Overview
This guide covers two installation scenarios:- Development setup — For contributing to OpenCut or running it locally
- Self-hosting with Docker — For running your own production instance
Development setup
Set up a local development environment
Self-hosting
Deploy your own production instance
Development setup
Prerequisites
Before you begin, ensure you have:Bun
Required — JavaScript runtime (v1.2.18+)Install Bun
Docker
Optional — For database and RedisInstall Docker
Node.js
Alternative — v18 or later if not using BunInstall Node.js
Git
Required — For cloning the repositoryInstall Git
Docker is optional but recommended. If you only want to work on frontend features, you can skip the Docker setup.
Step 1: Clone the repository
Fork and clone the OpenCut repository:Step 2: Environment configuration
Copy the example environment file and configure it:apps/web/.env.local with your configuration:
apps/web/.env.local
Generate BETTER_AUTH_SECRET
Generate BETTER_AUTH_SECRET
You need a secure secret for authentication. Generate one using any of these methods:Or use an online generator: generate-secret.vercel.app/32
The default values in
.env.example match the Docker Compose configuration and should work out of the box for local development.Step 3: Start services
If using Docker, start the database and Redis services:- PostgreSQL on
localhost:5432 - Redis on
localhost:6379 - Serverless Redis HTTP on
localhost:8079
View service status
View service status
Check if services are running:View logs:Stop services:
Step 4: Install dependencies
Install project dependencies:Step 5: Database setup
Run database migrations (only if using Docker):Database commands
Database commands
Available database commands:
Step 6: Start development server
Start the Next.js development server:Success! Your development environment is ready. Changes to the code will automatically reload thanks to hot module replacement.
Self-hosting with Docker
Run your own production instance of OpenCut using Docker Compose.Prerequisites
- Docker and Docker Compose
- A server or VPS with at least 2GB RAM
- (Optional) A domain name for public access
Quick deployment
The simplest way to run OpenCut in production:1
Clone the repository
2
Configure environment
Create a
.env file in the project root for production configuration:.env
3
Start all services
- OpenCut web application
- PostgreSQL database
- Redis cache
- Serverless Redis HTTP adapter
Docker Compose configuration
Thedocker-compose.yml includes all necessary services:
docker-compose.yml
Customize ports
Customize ports
To change the external port, edit the
ports mapping in docker-compose.yml:Production considerations
Reverse proxy setup
Reverse proxy setup
For production, use a reverse proxy like Nginx or Caddy:Nginx example:Caddy example:
SSL/TLS certificates
SSL/TLS certificates
Use Let’s Encrypt for free SSL certificates:Update
NEXT_PUBLIC_SITE_URL in your environment:Database backups
Database backups
Set up automated PostgreSQL backups:Consider using automated backup solutions like:
- pgBackRest
- Barman
- Cloud provider backup services
Monitoring and logs
Monitoring and logs
View logs:Consider adding monitoring:
- Prometheus + Grafana
- Sentry for error tracking
- Datadog or New Relic
Resource limits
Resource limits
Set resource limits in
docker-compose.yml:Project structure
Understanding the codebase structure:See AGENTS.md in the repository for detailed architecture documentation.
Troubleshooting
Port conflicts
Port conflicts
If ports are already in use:
Docker issues
Docker issues
Common Docker problems:
Build errors
Build errors
If the build fails:
Database connection errors
Database connection errors
Verify database connectivity:
Next steps
Contributing
Learn how to contribute to OpenCut
Architecture
Understand the editor architecture
Core concepts
Learn about the editor core system
API reference
Explore the API documentation