Overview
Bitwarden Server can be deployed using Docker containers on Windows, macOS, and Linux. The official Docker images are available on GitHub Container Registry.Prerequisites
Docker
Docker Engine 20.10+ or Docker Desktop
Docker Compose
Docker Compose v2.0+ (included with Docker Desktop)
System Resources
Minimum: 2 CPU cores, 4GB RAM, 20GB disk
Domain Name
Domain with SSL certificate for production
For production deployments, ensure your system meets the recommended specifications: 4+ CPU cores, 8GB+ RAM, and SSD storage.
Quick Start
Use the official installation scripts for the fastest setup:- Linux / macOS
- Windows
- Installation directory
- Domain name
- SSL certificate configuration
- Database password
- Admin email
Docker Compose Configuration
Development Setup
For local development and testing, use this minimaldocker-compose.yml:
docker-compose.yml
Production Setup
For production deployments with all services:docker-compose.prod.yml
Environment Variables
Create a.env file in the same directory as docker-compose.yml:
.env
Container Management
Starting Services
Stopping Services
Updating Images
Database Initialization
Run database migrations before first use:Health Checks
Verify services are running:Resource Limits
Set resource limits indocker-compose.yml for production:
Logging
Log Configuration
View Logs
Troubleshooting
Containers won't start
Containers won't start
Symptoms: Services exit immediately or fail to startSolutions:
- Check logs:
docker compose logs <service> - Verify environment variables are set
- Ensure ports are not already in use
- Check database connectivity
- Verify certificate configuration
Database connection errors
Database connection errors
Symptoms: “Cannot connect to SQL Server” errorsSolutions:
- Verify MSSQL container is running:
docker compose ps mssql - Check password complexity requirements
- Ensure connection string is correct
- Verify network connectivity:
docker network ls - Check SQL Server logs:
docker compose logs mssql
Certificate errors
Certificate errors
Symptoms: SSL/TLS handshake failuresSolutions:
- Verify certificate files are mounted correctly
- Check certificate permissions
- Ensure certificate is valid (not expired)
- Verify certificate thumbprint matches
- See SSL Certificates
Out of memory errors
Out of memory errors
Symptoms: Containers restarting, OOM killedSolutions:
- Increase Docker memory limit
- Add resource limits to services
- Check for memory leaks in logs
- Scale horizontally with multiple instances
Production Checklist
1
SSL Certificates
Configure valid SSL certificates for HTTPS. Self-signed certificates are not recommended.
2
Strong Passwords
Use strong, randomly generated passwords for database and Redis.
3
Firewall Rules
Configure firewall to only expose necessary ports (80, 443).
4
Backups
Set up automated database backups and test restore procedures.
5
Monitoring
Configure health checks and monitoring for all services.
6
Resource Limits
Set appropriate CPU and memory limits for all containers.
7
Log Rotation
Configure log rotation to prevent disk space issues.
8
Updates
Plan for regular updates and test update procedures.
Next Steps
Configuration
Configure services using appsettings.json
Database Setup
Initialize and configure the database
SSL Certificates
Set up SSL/TLS certificates
Environment Variables
Complete environment variable reference