Prerequisites
Before you begin, ensure you have the following installed:- .NET 8.0 SDK
- Docker Desktop
- Git
- A code editor (VS Code, Visual Studio, or JetBrains Rider recommended)
Quick Start with Docker
The fastest way to get started is using Docker Compose for the development environment.Start the Development Environment
Start the required infrastructure services (database, storage, mail):This starts:
- SQL Server on port 1433
- Azure Storage Emulator (Azurite) on ports 10000-10002
- MailCatcher on port 1080 (web UI) and 1025 (SMTP)
Wait about 30 seconds for SQL Server to initialize before proceeding.
Initialize the Database
Apply database migrations:You should see output indicating successful migration application.
Run the API Service
Start the main API service:The API will start on
https://localhost:4000 and http://localhost:5000.Your Bitwarden Server is now running! The API is available at
https://localhost:4000.Verify Installation
Test the API with a health check:200 OK response.
Next Steps
Local Setup Guide
Configure your development environment for full-featured development
Architecture
Understand the microservices architecture and service relationships
API Reference
Explore the REST API endpoints and authentication flows
Deploy with Docker
Deploy a production-ready instance with Docker
Alternative: Run All Services
To run all services at once, use the docker-compose configuration:- All infrastructure services
- Test identity provider (SimpleSAMLphp) on port 8090
Troubleshooting
SQL Server connection failed
SQL Server connection failed
If you see database connection errors:
- Ensure SQL Server is running:
docker ps - Wait 30-60 seconds for SQL Server to fully initialize
- Check the connection string in
dev/.envorsrc/Api/appsettings.json - Try restarting the SQL Server container:
Port already in use
Port already in use
If ports are already in use:
- Check what’s using the port:
lsof -i :4000(Linux/Mac) ornetstat -ano | findstr :4000(Windows) - Either stop the conflicting service or modify the port in
launchSettings.json - Common conflicting ports: 4000 (API), 33656 (Identity), 1433 (SQL Server)
Certificate errors
Certificate errors
If you encounter HTTPS certificate warnings:On Linux, you may need to accept the certificate in your browser.
Environment Variables
For local development, create adev/.env file with your configuration:
Development Workflow
Once your environment is set up:- Make changes to the code in
src/ - Run tests:
dotnet testfrom the solution root - Build:
dotnet build - Debug: Use your IDE’s debugging features with breakpoints
Docker Compose Profiles
The development docker-compose configuration supports multiple profiles:cloud- Core infrastructure (SQL, Azurite, MailCatcher)mssql- SQL Server onlypostgres- PostgreSQL (alternative to SQL Server)mysql- MySQL (alternative to SQL Server)idp- SimpleSAMLphp test identity providerstorage- Azurite storage emulator
Need Help?
Contributing Guide
Learn how to contribute to Bitwarden Server
Community Forums
Get help from the community
GitHub Issues
Report bugs or request features
Security
Report security vulnerabilities