Prerequisites
Before you begin, ensure you have the following installed:- .NET SDK 8.0 - The server is built with .NET 8.0
- Docker - For running local dependencies (databases, mail catcher)
- Docker Compose - For orchestrating development containers
- Git - For version control
- PowerShell (optional) - For running setup scripts on Windows
The recommended .NET version is 8.0.100 or later. Check
global.json in the repository root for the exact version.Development Container Setup
Bitwarden Server includes development container configurations for easy setup.Choose your dev container
There are multiple dev container configurations available in
.devcontainer/:- community_dev - For community contributors (recommended)
- internal_dev - For Bitwarden team members
- bitwarden_common - Base configuration shared by others
Set up secrets and certificates
Run the post-create setup script:You’ll be prompted for:
- Installation ID - Get from https://bitwarden.com/host
- Installation Key - Get from https://bitwarden.com/host
- Installation ID:
00000000-0000-0000-0000-000000000001 - Installation Key: (leave empty for local dev)
Manual Setup (Without Dev Container)
If you prefer not to use dev containers:Start required services
Using Docker Compose:This starts:
- SQL Server 2022 - Main database (port 1433)
- MailCatcher - Email testing (port 1080)
Run migrations
See the Database Migrations guide for details.
IDE Configuration
Visual Studio Code
Recommended extensions are configured in.vscode/extensions.json:
- C# Dev Kit - For C# development
- EditorConfig - For consistent code formatting
JetBrains Rider / Visual Studio
Open the solution file:Running the API
To run the API project locally:https://localhost:4000.
The API uses settings from
appsettings.Development.json when running in development mode.Running the Identity Service
https://localhost:33656.
Running Tests
See the Testing Guide for comprehensive testing instructions.Port Configuration
The development environment uses these ports:| Service | Port | Description |
|---|---|---|
| API | 4000 | Main API server |
| Identity | 33656 | Authentication service |
| SQL Server | 1433 | Microsoft SQL Server |
| MySQL | 3306 | MySQL (optional) |
| PostgreSQL | 5432 | PostgreSQL (optional) |
| MailCatcher | 1080 | Email testing UI |
Git Hooks
Bitwarden uses git hooks for automatic code formatting:dotnet format automatically.
Troubleshooting
Database Connection Issues
-
Ensure SQL Server is running:
-
Verify your connection string in
dev/secrets.json -
Check SQL Server logs:
Build Errors
-
Clean and restore:
-
Verify .NET SDK version:
Port Conflicts
If ports are already in use, update the port mappings in:.devcontainer/community_dev/devcontainer.json- forwardPorts sectiondocker-compose.yml- ports section
Next Steps
- Database Migrations - Learn how to create and run migrations
- Testing Guide - Run and write tests
- Project Structure - Understand the codebase organization
- Contribution Guide - Submit your first contribution