Sign inSign up

hwdsl2/whisper-server

By hwdsl2

Updated 9 days ago

Self-hosted Whisper speech-to-text server with an OpenAI-compatible API. Powered by faster-whisper.

Image
Machine learning & AI
Developer tools
Data science
4

100K+

hwdsl2/whisper-server repository overview

Whisper Speech-to-Text on Docker

Build Status  Docker Pulls  Open In Colab

GitHub: https://github.com/hwdsl2/docker-whisper

Part of the Self-Hosted AI Stack — deploy a complete self-hosted AI stack with a single command.

Docker image to run a Whisper speech-to-text server, powered by faster-whisper. Provides OpenAI-compatible audio transcription and translation APIs. Based on Debian (python:3.12-slim). Designed to be simple, private, and self-hosted.

Features:

  • OpenAI-compatible POST /v1/audio/transcriptions and POST /v1/audio/translations endpoints — any app using the OpenAI Whisper API switches with a one-line change
  • Supports all Whisper models: tiny, base, small, medium, large-v3, large-v3-turbo and more
  • Speaker diarization — identify who is speaking in each segment (optional local extension via sherpa-onnx)
  • Model management via a helper script (whisper_manage)
  • Audio stays on your server — no data sent to third parties
  • All major audio formats supported (mp3, m4a, wav, webm, ogg, flac, and all ffmpeg formats)
  • Multiple response formats: JSON, plain text, verbose JSON, SRT subtitles, WebVTT subtitles
  • Streaming transcription — add stream=true to receive segments via SSE as they are decoded, with no waiting for the full file
  • NVIDIA GPU (CUDA) acceleration for faster inference (:cuda image tag)
  • Offline/air-gapped mode — run without internet access using pre-cached models (WHISPER_LOCAL_ONLY)
  • Automatically built and published via GitHub Actions
  • Persistent model cache via a Docker volume
  • Multi-arch: linux/amd64, linux/arm64

📘 Kindle Countdown Deal: $0.99/£0.99 (US & UK). The Self-Hosted AI Builder’s Guide is a practical guide to building, securing, and operating your own private AI stack.

Also available:

When to use Whisper vs. WhisperLive

docker-whisperdocker-whisper-live
Use caseTranscribe complete audio filesLive microphone / real-time audio streaming
ProtocolHTTP RESTWebSocket (streaming) + HTTP REST
LatencyFull file, then responseNear-real-time, word by word
Best forMeeting recordings, uploaded audioBrowser capture, RTSP streams, live captions
Image size~190 MB (~3.1 GB for :cuda)~750 MB (~4.5 GB for :cuda)

Quick start

Use this command to set up a Whisper server:

docker run \
    --name whisper \
    --restart=always \
    -v whisper-data:/var/lib/whisper \
    -p 9000:9000 \
    -d hwdsl2/whisper-server
GPU quick start (NVIDIA CUDA)

If you have an NVIDIA GPU, use the :cuda image for hardware-accelerated inference:

docker run \
    --name whisper \
    --restart=always \
    --gpus=all \
    -v whisper-data:/var/lib/whisper \
    -p 9000:9000 \
    -d hwdsl2/whisper-server:cuda

Requirements: NVIDIA GPU, NVIDIA driver 575.57.08+ (Linux) or 576.57+ (Windows), and the NVIDIA Container Toolkit installed on the host. The :cuda image is linux/amd64 only.

Important: This image requires at least 700 MB of available RAM for the default base model. Systems with 512 MB or less of RAM are not supported.

Note: For internet-facing deployments, using a reverse proxy to add HTTPS is strongly recommended. In that case, also replace -p 9000:9000 with -p 127.0.0.1:9000:9000 in the docker run command above, to prevent direct access to the unencrypted port.

The Whisper base model (~145 MB) is downloaded and cached on first start. Check the logs to confirm the server is ready:

docker logs whisper

Once you see "Whisper speech-to-text server is ready", transcribe your first audio file:

curl http://your_server_ip:9000/v1/audio/transcriptions \
    -F [email protected] \
    -F model=whisper-1

Response:

{"text": "Your transcribed text appears here."}

Tip: Need a sample audio file to test? Download this English speech sample (WAV, MIT License) from the Azure Samples repository:

curl -L -o sample_speech.wav \
    "https://github.com/Azure-Samples/cognitive-services-speech-sdk/raw/master/sampledata/audiofiles/katiesteve.wav"

curl http://your_server_ip:9000/v1/audio/transcriptions \
    -F file=@sample_speech.wav \
    -F model=whisper-1

Alternatively, you may set up Whisper without Docker. To learn more about how to use this image, read the sections below.

Community

Self-hosted VPN & networking projects

Requirements

  • A Linux server (local or cloud) with Docker installed
  • Supported architectures: amd64 (x86_64), arm64 (e.g. Raspberry Pi 4/5, AWS Graviton)
  • Minimum RAM: ~700 MB free for the default base model (see model table)
  • Internet access for the initial model download (the model is cached locally afterwards). Not required if using WHISPER_LOCAL_ONLY=true with pre-cached models.

For GPU acceleration (:cuda image):

  • NVIDIA GPU with CUDA support (Compute Capability 6.0+)
  • NVIDIA driver 575.57.08+ (Linux) or 576.57+ (Windows) installed on the host
  • NVIDIA Container Toolkit installed
  • The :cuda image supports linux/amd64 only

For internet-facing deployments, see Using a reverse proxy to add HTTPS.

Download

Get the trusted build from the Docker Hub registry:

docker pull hwdsl2/whisper-server

For NVIDIA GPU acceleration, pull the :cuda tag instead:

docker pull hwdsl2/whisper-server:cuda

Alternatively, you may download from Quay.io:

docker pull quay.io/hwdsl2/whisper-server
docker image tag quay.io/hwdsl2/whisper-server hwdsl2/whisper-server

Supported platforms: linux/amd64 and linux/arm64. The :cuda tag supports linux/amd64 only.

Environment variables

All variables are optional. Fresh installs with a mounted /var/lib/whisper volume auto-generate a Bearer token. Existing installs without a key remain open for backward compatibility.

This Docker image uses the following variables, that can be declared in an env file (see example):

VariableDescriptionDefault
WHISPER_MODELWhisper model to use. See model table for options.base
WHISPER_LANGUAGEDefault transcription language. BCP-47 code (e.g. en, fr, de, zh, ja) or auto to autodetect.auto
WHISPER_PORTHTTP port for the API (1–65535).9000
WHISPER_DEVICECompute device: cpu, cuda, or auto. Use cuda with the :cuda image for GPU acceleration. auto detects GPU and falls back to CPU.cpu
WHISPER_COMPUTE_TYPEQuantization / compute type. int8 is recommended for CPU; float16 is recommended for CUDA.int8 (CPU) / float16 (CUDA)
WHISPER_THREADSCPU threads for inference. Set to the number of physical cores for best latency.2
WHISPER_API_KEYOptional Bearer token. Fresh persistent installs auto-generate one. If set, all API requests must include Authorization: Bearer <key>. Set explicitly empty to disable authentication.Auto-generated for fresh persistent installs
WHISPER_LOG_LEVELLog level: DEBUG, INFO, WARNING, ERROR, CRITICAL.INFO
WHISPER_BEAMBeam size for transcription and translation decoding. Higher values may improve accuracy at the cost of speed. Use 1 for fastest (greedy) decoding.5
WHISPER_MAX_REQUEST_BEAMMaximum beam size allowed for the per-request beam override. Set to 0 to disable this limit.10
WHISPER_MAX_UPLOAD_MBMaximum uploaded audio file size in MB. Requests above this limit return HTTP 413. Set to 0 to disable the limit.1024
WHISPER_LOCAL_ONLYWhen set to any non-empty value (e.g. true), disables all HuggingFace model downloads. For offline or air-gapped deployments with pre-cached models.(not set)
WHISPER_WORD_TIMESTAMPSWhen set to true, enables word-level timestamps globally for all requests. The verbose_json output will include a top-level words array with per-word timing and confidence. Can also be enabled per-request via timestamp_granularities[]=word.(not set)
WHISPER_DIARIZATIONSet to true to enable speaker diarization. Identifies who is speaking in each segment. Uses sherpa-onnx with pyannote segmentation-3.0 ONNX models (~45 MB, auto-downloaded on first use). Not supported in streaming mode.(not set)
WHISPER_DIARIZE_NUM_SPEAKERSExact number of speakers (if known). Improves clustering accuracy. Set to -1 or leave unset for auto-detection.-1
WHISPER_DIARIZE_THRESHOLDClustering threshold for auto-detection. Lower = more speakers detected, higher = fewer. Ignored when exact speaker count is set.0.5
WHISPER_DISABLE_USAGE_COUNTSSet to 1 to disable anonymous aggregate usage counts.(not set)

Note: In your env file, you may enclose values in single quotes, e.g. VAR='value'. Do not add spaces around =. If you change WHISPER_PORT, update the -p flag in the docker run command accordingly.

Example using an env file:

cp whisper.env.example whisper.env
# Edit whisper.env with your settings, then:
docker run \
    --name whisper \
    --restart=always \
    -v whisper-data:/var/lib/whisper \
    -v ./whisper.env:/whisper.env:ro \
    -p 9000:9000 \
    -d hwdsl2/whisper-server

The env file is bind-mounted into the container, so changes are picked up on every restart without recreating the container.

Alternatively, pass it with --env-file
docker run \
    --name whisper \
    --restart=always \
    -v whisper-data:/var/lib/whisper \
    -p 9000:9000 \
    --env-file=whisper.env \
    -d hwdsl2/whisper-server

Using docker-compose

cp whisper.env.example whisper.env
# Edit whisper.env as needed, then:
docker compose up -d
docker logs whisper

Example docker-compose.yml (already included):

services:
  whisper:
    image: hwdsl2/whisper-server
    container_name: whisper
    restart: always
    ports:
      - "9000:9000/tcp"  # For a host-based reverse proxy, change to "127.0.0.1:9000:9000/tcp"
    volumes:
      - whisper-data:/var/lib/whisper
      - ./whisper.env:/whisper.env:ro

volumes:
  whisper-data:
    name: whisper-data

Note: For internet-facing deployments, using a reverse proxy to add HTTPS is strongly recommended. In that case, also change "9000:9000/tcp" to "127.0.0.1:9000:9000/tcp" in docker-compose.yml, to prevent direct access to the unencrypted port.

Using docker-compose with GPU (NVIDIA CUDA)

A separate docker-compose.cuda.yml is provided for GPU deployments:

cp whisper.env.example whisper.env
# Edit whisper.env as needed, then:
docker compose -f docker-compose.cuda.yml up -d
docker logs whisper

Example docker-compose.cuda.yml (already included):

services:
  whisper:
    image: hwdsl2/whisper-server:cuda
    container_name: whisper
    restart: always
    ports:
      - "9000:9000/tcp"  # For a host-based reverse proxy, change to "127.0.0.1:9000:9000/tcp"
    volumes:
      - whisper-data:/var/lib/whisper
      - ./whisper.env:/whisper.env:ro
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]

volumes:
  whisper-data:
    name: whisper-data

API reference

The API is compatible with OpenAI's audio transcription and audio translation endpoints. Any application already calling https://api.openai.com/v1/audio/transcriptions can switch to self-hosted by setting:

Speaker diarization, when enabled, is a local sherpa-onnx extension and is not equivalent to OpenAI diarization models. OpenAI-only transcription options such as gpt-4o-transcribe-diarize, response_format=diarized_json, include=logprobs, chunking_strategy, known_speaker_names, and known_speaker_references are not supported and return 400.

OPENAI_BASE_URL=http://your_server_ip:9000
Transcribe audio
POST /v1/audio/transcriptions
Content-Type: multipart/form-data

Parameters:

ParameterTypeRequiredDescription
filefileAudio file. Supported formats: mp3, mp4, m4a, wav, webm, ogg, flac and all other formats supported by ffmpeg.
modelstringPass whisper-1 (value is accepted but the active model is always used).
languagestringBCP-47 language code. Overrides WHISPER_LANGUAGE for this request.
promptstringOptional text to guide the model's style or continue a previous segment.
response_formatstringOutput format. Default: json. See response formats. Ignored when stream=true. OpenAI-only diarized_json is not supported.
temperaturefloatSampling temperature (0–1). Default: 0.
streambooleanEnable SSE streaming. When true, segments are returned as text/event-stream events as they are decoded. Default: false.
timestamp_granularities[]arrayTimestamp granularities to populate. Values: word, segment. When word is included, verbose_json output includes a top-level words array. Default: ["segment"].

Local faster-whisper extension: You can set beam to override WHISPER_BEAM for a single transcription or translation request. This is not part of the OpenAI API schema, so do not send it to the hosted OpenAI API or strict OpenAI-compatible gateways. The default per-request cap is 10 (WHISPER_MAX_REQUEST_BEAM); set that variable to 0 to disable the cap. Beam search mainly affects deterministic decoding when temperature=0.

Example:

curl http://your_server_ip:9000/v1/audio/transcriptions \
    -F [email protected] \
    -F model=whisper-1 \
    -F language=en

With API key authentication:

curl http://your_server_ip:9000/v1/audio/transcriptions \
    -H "Authorization: Bearer your_api_key" \
    -F [email protected] \
    -F model=whisper-1
Response formats
response_formatDescription
json{"text": "..."} — default, matches OpenAI's basic response
textPlain text, no JSON wrapper
verbose_jsonFull JSON with language, duration, per-segment timestamps, log-probabilities
srtSubRip subtitle format (.srt)
vttWebVTT subtitle format (.vtt)

See Response formats for more details.

Translate audio
POST /v1/audio/translations
Content-Type: multipart/form-data

Translates audio in any language to English text. Compatible with OpenAI's audio translation endpoint. Accepts the common translation parameters. The output is always in English.

Note: Translation is not supported with English-only (.en) models. Use a multilingual model (e.g. base, small, large-v3-turbo).

Example:

curl http://your_server_ip:9000/v1/audio/translations \
    -F file=@french_audio.mp3 \
    -F model=whisper-1
List models
GET /v1/models

Returns the active model in OpenAI-compatible format.

curl http://your_server_ip:9000/v1/models
Interactive API docs

An interactive Swagger UI is available at:

http://your_server_ip:9000/docs

Persistent data

All server data is stored in the Docker volume (/var/lib/whisper inside the container):

/var/lib/whisper/
├── models--Systran--faster-whisper-*/   # Cached Whisper model files (downloaded from HuggingFace)
├── .port                 # Active port (used by whisper_manage)
├── .model                # Active model name (used by whisper_manage)
└── .server_addr          # Cached server IP (used by whisper_manage)

Back up the Docker volume to preserve downloaded models. Models are large (145 MB – 3 GB) and can take several minutes to download on first start; preserving the volume avoids re-downloading on container recreation.

Tip: The /var/lib/whisper volume uses the same HuggingFace cache layout as docker-whisper-live's /var/lib/whisper-live volume. If you have already downloaded a model with docker-whisper-live, you can bind-mount the same volume directory to avoid re-downloading.

Managing the server

Use whisper_manage inside the running container to inspect and manage the server.

Show server info:

docker exec whisper whisper_manage --showinfo

List available models:

docker exec whisper whisper_manage --listmodels

Pre-download a model:

docker exec whisper whisper_manage --downloadmodel large-v3-turbo

Switching models

To change the active model:

  1. (Optional but recommended) Pre-download the new model while the server is running:

    docker exec whisper whisper_manage --downloadmodel large-v3-turbo
    
  2. Update WHISPER_MODEL in your whisper.env file (or add -e WHISPER_MODEL=large-v3-turbo to your docker run command).

  3. Restart the container:

    docker restart whisper
    

Available models:

ModelDiskRAM (approx)Notes
tiny~75 MB~250 MBFastest; lower accuracy
tiny.en~75 MB~250 MBEnglish-only
base~145 MB~700 MBGood balance — default
base.en~145 MB~700 MBEnglish-only
small~465 MB~1.5 GBBetter accuracy
small.en~465 MB~1.5 GBEnglish-only
medium~1.5 GB~5 GBHigh accuracy
medium.en~1.5 GB~5 GBEnglish-only
large-v1~3 GB~10 GBOlder large model
large-v2~3 GB~10 GBVery high accuracy
large-v3~3 GB~10 GBBest accuracy
large-v3-turbo~1.6 GB~6 GBFast + high accuracy ⭐
turbo~1.6 GB~6 GBAlias for large-v3-turbo

Tip: large-v3-turbo offers accuracy close to large-v3 at roughly half the resource cost. It is the recommended upgrade path from base for most production deployments.

RAM figures are approximate and reflect INT8 quantization (default). Models are cached in the /var/lib/whisper Docker volume and only downloaded once.

Securing your server

See Securing your server.

Using a reverse proxy

For internet-facing deployments, place a reverse proxy in front of Whisper to handle HTTPS termination. The server works without HTTPS on a local or trusted network, but HTTPS is recommended when the API endpoint is exposed to the internet.

Use one of the following addresses to reach the Whisper container from your reverse proxy:

  • whisper:9000 — if your reverse proxy runs as a container in the same Docker network as Whisper (e.g. defined in the same docker-compose.yml).
  • 127.0.0.1:9000 — if your reverse proxy runs on the host and port 9000 is published (the default docker-compose.yml publishes it).

Example with Caddy (Docker image) (automatic TLS via Let's Encrypt, reverse proxy in the same Docker network):

Caddyfile:

whisper.example.com {
  reverse_proxy whisper:9000
}

Example with nginx (reverse proxy on the host):

See Using a reverse proxy.

Fresh persistent installs auto-generate a WHISPER_API_KEY. Display it with docker exec whisper whisper_manage --showkey, or use docker exec whisper whisper_manage --getkey in scripts. For existing installs without a key, set WHISPER_API_KEY in your env file to enable authentication.

Update Docker image

See Update Docker image.

Using with other AI services

See Using with other AI services.

Speaker diarization

Speaker diarization identifies who is speaking in each transcribed segment. It is a local extension powered by sherpa-onnx.

See Speaker diarization for setup, examples, output formats, and notes.

Usage counts

See Usage counts.

Technical details

See Technical details.

License

Note: The software components inside the pre-built image (such as faster-whisper and its dependencies) are under the licenses chosen by their copyright holders. As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.

Copyright (C) 2026 Lin Song
This work is licensed under the MIT License.

faster-whisper is Copyright (C) SYSTRAN, and is distributed under the MIT License.

This project is an independent Docker setup for Whisper and is not affiliated with, endorsed by, or sponsored by OpenAI or SYSTRAN.

Tag summary

Content type

Image

Digest

sha256:257302e5e

Size

196.7 MB

Last updated

9 days ago

docker pull hwdsl2/whisper-server