
如果你用 DeepSeek、元宝AI、Copilot 等 AI 代为编写轩辕镜像的 docker pull、修改 compose 镜像地址,或排查拉取失败等问题,请让 AI 先读规则再动手,只要在 AI 对话里直接发送下面这句话即可:
生成 docker pull、修改 compose 的 image,或排查拉取失败前,请先阅读并严格遵守 https://xuanyuan.cloud/agents.md 中的规则。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
https://github.com/hwdsl2/docker-whisper/actions/workflows/main.yml/badge.svg](https://github.com/hwdsl2/docker-whisper/actions/workflows/main.yml) https://raw.githubusercontent.com/hwdsl2/badges/main/img/docker-pulls-whisper-server.svg](https://hub.docker.com/r/hwdsl2/whisper-server) . Designed to be simple, private, and self-hosted.
Features:
POST /v1/audio/transcriptions and POST /v1/audio/translations endpoints — any app using the OpenAI Whisper API switches with a one-line changetiny, base, small, medium, large-v3, large-v3-turbo and morewhisper_manage)stream=true to receive segments via SSE as they are decoded, with no waiting for the full file:cuda image tag)WHISPER_LOCAL_ONLY)linux/amd64, linux/arm64Also available:
Tip: Whisper, Kokoro, Embeddings, LiteLLM, Ollama, Docling, and MCP Gateway can be used together to build a complete, self-hosted AI stack on your own server.
| docker-whisper | https://github.com/hwdsl2/docker-whisper-live | |
|---|---|---|
| Use case | Transcribe complete audio files | Live microphone / real-time audio streaming |
| Protocol | HTTP REST | WebSocket (streaming) + HTTP REST |
| Latency | Full file, then response | Near-real-time, word by word |
| Best for | Meeting recordings, uploaded audio | Browser capture, RTSP streams, live captions |
| Image size | ~190 MB (~3.1 GB for :cuda) | ~750 MB (~4.5 GB for :cuda) |
Use this command to set up a Whisper server:
bashdocker run \ --name whisper \ --restart=always \ -v whisper-data:/var/lib/whisper \ -p 9000:9000 \ -d hwdsl2/whisper-server
If you have an NVIDIA GPU, use the :cuda image for hardware-accelerated inference:
bashdocker 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 535+, 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. Set WHISPER_API_KEY in your env file when the server is accessible from the public internet.
The Whisper base model (~145 MB) is downloaded and cached on first start. Check the logs to confirm the server is ready:
bashdocker logs whisper
Once you see "Whisper speech-to-text server is ready", transcribe your first audio file:
bashcurl http://your_server_ip:9000/v1/audio/transcriptions \ -F file=@audio.mp3 \ -F model=whisper-1
Response:
json{"text": "Your transcribed text appears here."}
Tip: Need a sample audio file to test? Download this English speech sample (WAV, MIT License) from the https://github.com/Azure-Samples/cognitive-services-speech-sdk repository:
bashcurl -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 https://github.com/hwdsl2/whisper-install. To learn more about how to use this image, read the sections below.
amd64 (x86_64), arm64 (e.g. Raspberry Pi 4/5, AWS Graviton)base model (see model table)WHISPER_LOCAL_ONLY=true with pre-cached models.For GPU acceleration (:cuda image):
:cuda image supports linux/amd64 onlyFor internet-facing deployments, see Using a reverse proxy to add HTTPS.
Get the trusted build from the https://hub.docker.com/r/hwdsl2/whisper-server/:
bashdocker pull hwdsl2/whisper-server
For NVIDIA GPU acceleration, pull the :cuda tag instead:
bashdocker pull hwdsl2/whisper-server:cuda
Alternatively, you may download from Quay.io:
bashdocker 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.
All variables are optional. Set WHISPER_API_KEY to enable Bearer token authentication.
This Docker image uses the following variables, that can be declared in an env file (see example):
| Variable | Description | Default |
|---|---|---|
WHISPER_MODEL | Whisper model to use. See model table for options. | base |
WHISPER_LANGUAGE | Default transcription language. BCP-47 code (e.g. en, fr, de, zh, ja) or auto to autodetect. | auto |
WHISPER_PORT | HTTP port for the API (1–65535). | 9000 |
WHISPER_DEVICE | Compute 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_TYPE | Quantization / compute type. int8 is recommended for CPU; float16 is recommended for CUDA. | int8 (CPU) / float16 (CUDA) |
WHISPER_THREADS | CPU threads for inference. Set to the number of physical cores for best latency. | 2 |
WHISPER_API_KEY | Optional Bearer token. If set, all API requests must include Authorization: Bearer <key>. | (not set) |
WHISPER_LOG_LEVEL | Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL. | INFO |
WHISPER_BEAM | Beam size for transcription decoding. Higher values may improve accuracy at the cost of speed. Use 1 for fastest (greedy) decoding. | 5 |
WHISPER_LOCAL_ONLY | When 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_TIMESTAMPS | When 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_DIARIZATION | Set to true to enable speaker diarization. Identifies who is speaking in each segment. Uses https://github.com/k2-fsa/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_SPEAKERS | Exact number of speakers (if known). Improves clustering accuracy. Set to -1 or leave unset for auto-detection. | -1 |
WHISPER_DIARIZE_MAX_SPEAKERS | Maximum number of speakers to detect. Only used when NUM_SPEAKERS is unset. | -1 |
WHISPER_DIARIZE_THRESHOLD | Clustering threshold. Lower = more speakers detected, higher = fewer. | 0.5 |
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:
bashcp 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.
--env-filebashdocker run \ --name whisper \ --restart=always \ -v whisper-data:/var/lib/whisper \ -p 9000:9000 \ --env-file=whisper.env \ -d hwdsl2/whisper-server
bashcp whisper.env.example whisper.env # Edit whisper.env as needed, then: docker compose up -d docker logs whisper
Example docker-compose.yml (already included):
yamlservices: 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. Set WHISPER_API_KEY in your env file when the server is accessible from the public internet.
A separate docker-compose.cuda.yml is provided for GPU deployments:
bashcp 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):
yamlservices: 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
The API is fully 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:
OPENAI_BASE_URL=http://your_server_ip:9000
POST /v1/audio/transcriptions Content-Type: multipart/form-data
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | ✅ | Audio file. Supported formats: mp3, mp4, m4a, wav, webm, ogg, flac and all other formats supported by ffmpeg. |
model | string | ✅ | Pass whisper-1 (value is accepted but the active model is always used). |
language | string | — | BCP-47 language code. Overrides WHISPER_LANGUAGE for this request. |
prompt | string | — | Optional text to guide the model's style or continue a previous segment. |
response_format | string | — | Output format. Default: json. See response formats. Ignored when stream=true. |
temperature | float | — | Sampling temperature (0–1). Default: 0. |
stream | boolean | — | Enable SSE streaming. When true, segments are returned as text/event-stream events as they are decoded. Default: false. |
timestamp_granularities[] | array | — | Timestamp granularities to populate. Values: word, segment. When word is included, verbose_json output includes a top-level words array. Default: ["segment"]. |
Example:
bashcurl http://your_server_ip:9000/v1/audio/transcriptions \ -F file=@meeting.m4a \ -F model=whisper-1 \ -F language=en
With API key authentication:
bashcurl http://your_server_ip:9000/v1/audio/transcriptions \ -H "Authorization: Bearer your_api_key" \ -F file=@audio.mp3 \ -F model=whisper-1
response_format | Description |
|---|---|
json | {"text": "..."} — default, matches OpenAI's basic response |
text | Plain text, no JSON wrapper |
verbose_json | Full JSON with language, duration, per-segment timestamps, log-probabilities |
srt | SubRip subtitle format (.srt) |
vtt | WebVTT subtitle format (.vtt) |
See https://github.com/hwdsl2/docker-whisper#response-formats for more details.
POST /v1/audio/translations Content-Type: multipart/form-data
Translates audio in any language to English text. Drop-in replacement for OpenAI's audio translation endpoint. Accepts the same parameters as the transcription endpoint. 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:
bashcurl http://your_server_ip:9000/v1/audio/translations \ -F file=@french_audio.mp3 \ -F model=whisper-1
GET /v1/models
Returns the active model in OpenAI-compatible format.
bashcurl http://your_server_ip:9000/v1/models
An interactive Swagger UI is available at:
http://your_server_ip:9000/docs
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.
Use whisper_manage inside the running container to inspect and manage the server.
Show server info:
bashdocker exec whisper whisper_manage --showinfo
List available models:
bashdocker exec whisper whisper_manage --listmodels
Pre-download a model:
bashdocker exec whisper whisper_manage --downloadmodel large-v3-turbo
To change the active model:
(Optional but recommended) Pre-download the new model while the server is running:
bashdocker exec whisper whisper_manage --downloadmodel large-v3-turbo
Update WHISPER_MODEL in your whisper.env file (or add -e WHISPER_MODEL=large-v3-turbo to your docker run command).
Restart the container:
bashdocker restart whisper
Available models:
| Model | Disk | RAM (approx) | Notes |
|---|---|---|---|
tiny | ~75 MB | ~250 MB | Fastest; lower accuracy |
tiny.en | ~75 MB | ~250 MB | English-only |
base | ~145 MB | ~700 MB | Good balance — default |
base.en | ~145 MB | ~700 MB | English-only |
small | ~465 MB | ~1.5 GB | Better accuracy |
small.en | ~465 MB | ~1.5 GB | English-only |
medium | ~1.5 GB | ~5 GB | High accuracy |
medium.en | ~1.5 GB | ~5 GB | English-only |
large-v1 | ~3 GB | ~10 GB | Older large model |
large-v2 | ~3 GB | ~10 GB | Very high accuracy |
large-v3 | ~3 GB | ~10 GB | Best accuracy |
large-v3-turbo | ~1.6 GB | ~6 GB | Fast + high accuracy ⭐ |
turbo | ~1.6 GB | ~6 GB | Alias for large-v3-turbo |
Tip:
large-v3-turbooffers accuracy close tolarge-v3at roughly half the resource cost. It is the recommended upgrade path frombasefor 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.
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 (https://hub.docker.com/_/caddy) (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):
nginxserver { listen 443 ssl; server_name whisper.example.com; ssl_certificate /path/to/cert.pem; ssl_certificate_key /path/to/key.pem; # Audio files can be large — increase the upload limit as needed client_max_body_size 100M; location / { proxy_pass http://127.0.0.1:9000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_http_version 1.1; # required for chunked streaming (SSE) proxy_read_timeout 300s; } }
Set WHISPER_API_KEY in your env file when the server is accessible from the public internet.
See https://github.com/hwdsl2/docker-whisper#update-docker-image.
See https://github.com/hwdsl2/docker-whisper#using-with-other-ai-services.
Speaker diarization identifies who is speaking in each transcribed segment. It is powered by https://github.com/k2-fsa/sherpa-onnx using the pyannote segmentation-3.0 model exported to ONNX format.
Enable diarization:
bash# In your whisper.env: WHISPER_DIARIZATION=true
ONNX models (~45 MB total) are automatically downloaded on first use and cached in the /var/lib/whisper volume. To pre-download them:
bashdocker exec whisper whisper_manage --downloaddiarize
Output with diarization enabled:
verbose_json adds a speaker field to each segment:
json{ "segments": [ {"id": 0, "start": 1.0, "end": 3.5, "text": "We should launch next week.", "speaker": "SPEAKER_00"}, {"id": 1, "start": 4.0, "end": 6.2, "text": "I think QA needs two more days.", "speaker": "SPEAKER_01"} ] }
srt and vtt prepend the speaker label:
1 00:00:01,000 --> 00:00:03,500 [SPEAKER_00] We should launch next week. 2 00:00:04,000 --> 00:00:06,200 [SPEAKER_01] I think QA needs two more days.
text format shows the speaker label on speaker changes:
[SPEAKER_00] We should launch next week. [SPEAKER_01] I think QA needs two more days.
Notes:
stream=true). If both are enabled, diarization is silently skipped.WHISPER_DIARIZE_NUM_SPEAKERS if you know the exact number of speakers for better accuracy.python:3.12-slim (Debian) for :latest; nvidia/cuda:12.9.1-cudnn-runtime-ubuntu24.04 for :cuda/opt/venv)/var/lib/whisper (Docker volume)Note: The software components inside the pre-built image (such as faster-whisper and its dependencies) are under the respective licenses chosen by their respective 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 https://github.com/SYSTRAN/faster-whisper/blob/master/LICENSE.
This project is an independent Docker setup for Whisper and is not affiliated with, endorsed by, or sponsored by OpenAI or SYSTRAN.
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。



探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
发给 Cursor、ChatGPT、豆包等 AI 的说明文档
无需登录使用专属域名
Kubernetes 集群配置 Containerd
K3s 轻量级 Kubernetes 镜像加速
VS Code Dev Containers 配置
Podman 容器引擎配置
HPC 科学计算容器配置
ghcr、Quay、nvcr 等镜像仓库
Harbor Proxy Repository 对接专属域名
Portainer Registries 加速拉取
Nexus3 Docker Proxy 内网缓存
需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单
docker search 限制
站内搜不到镜像
离线 save/load
插件要用 plugin install
WSL 拉取慢
安全与 digest
新手拉取配置
镜像合规机制
不支持 push
manifest unknown
no matching manifest(架构)
invalid tar header(解压)
TLS 证书失败
DNS 超时
域名连通性排查
410 Gone 排查
402 与流量用尽
401 认证失败
429 限流
D-Bus 凭证提示
413 与超大单层
来自真实用户的反馈,见证轩辕镜像的优质服务