Skip to main content

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:
The script will prompt you for:
  • Installation directory
  • Domain name
  • SSL certificate configuration
  • Database password
  • Admin email

Docker Compose Configuration

Development Setup

For local development and testing, use this minimal docker-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
Security: Never commit .env files to version control. Use .gitignore to exclude them.

Container Management

Starting Services

Stopping Services

Updating Images

Database Initialization

Run database migrations before first use:
See Database Setup for detailed migration instructions.

Health Checks

Verify services are running:

Resource Limits

Set resource limits in docker-compose.yml for production:

Logging

Log Configuration

View Logs

Troubleshooting

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
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
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
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