English | 简体中文 | 繁體中文 | Русский
Open-source, self-hosted text-to-speech API.
SpeakCrate is a self-hosted text-to-speech API powered by Kokoro. It provides an OpenAI-compatible speech endpoint, multilingual voices, and streamed audio. Deploy with Docker on CPU or an NVIDIA GPU. The image is based on Debian (python:3.12-slim).
Previously known as
docker-kokoro, maintained by hwdsl2. The Docker image name remainshwdsl2/kokoro-server.
Features:
- OpenAI-compatible API:
POST /v1/audio/speechfor text-to-speech requests from compatible OpenAI SDKs and apps. - Private, local processing: audio stays on your server and is not sent to third parties.
- Voices and languages: 54 high-quality voices across 9 languages (English, Japanese, Chinese, Spanish, French, Italian, and more).
- Voice-name aliases: accepts OpenAI voice-name aliases (
alloy,nova,echo, ...) that map to local Kokoro voices, plus native voice IDs (af_heart,bm_george, ...). - Streaming audio: set
stream_formatto"audio"or"sse"to receive audio as each sentence is synthesized, reducing time-to-first-audio. - Flexible output:
mp3,wav,flac,opus,aac,pcm. - CPU and GPU support: run on CPU or use the
:cudaimage for NVIDIA GPU acceleration. - Offline operation: run without internet access using pre-cached model (
KOKORO_LOCAL_ONLY). - Automated builds: images are automatically built and published through GitHub Actions.
Try it online: Open in Colab (no Docker or local installation required)
Also available as part of the Self-Hosted AI Stack, which deploys a complete self-hosted AI stack with a single command.
📘 The Self-Hosted AI Builder’s Guide shows how to configure this service and use it with other self-hosted AI tools. Kindle · paperback · Google Play
Use this command to set up a SpeakCrate TTS server:
docker run \
--name kokoro \
--restart=always \
-v kokoro-data:/var/lib/kokoro \
-p 8880:8880 \
-d hwdsl2/kokoro-serverGPU quick start (NVIDIA CUDA)
If you have an NVIDIA GPU, use the :cuda image for hardware-accelerated inference:
docker run \
--name kokoro \
--restart=always \
--gpus=all \
-v kokoro-data:/var/lib/kokoro \
-p 8880:8880 \
-d hwdsl2/kokoro-server:cudaRequirements: 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 1.5 GB of available RAM due to the PyTorch runtime and Kokoro model. Systems with 1 GB or less of total RAM are not supported.
Note
For internet-facing deployments, use a reverse proxy to add HTTPS. Also replace -p 8880:8880 with -p 127.0.0.1:8880:8880 in the docker run command above, to prevent direct access to the unencrypted port.
The Kokoro model (~320 MB) is downloaded and cached on first start. Check the logs to confirm the server is ready:
docker logs kokoroOnce you see "SpeakCrate text-to-speech server is ready", synthesize your first audio file:
Fresh persistent installations require an API key. Retrieve it for the following examples:
speak_api_key="$(docker exec kokoro kokoro_manage --getkey)"curl http://your_server_ip:8880/v1/audio/speech \
-H "Authorization: Bearer $speak_api_key" \
-H "Content-Type: application/json" \
-d '{"model":"tts-1","input":"Hello, world!","voice":"af_heart"}' \
--output speech.mp3- 📬 Get project updates and free deployment guides (1–2 emails/month)
- 💬 Join the r/selfhostedstack community for discussions and showcases
- ⭐ Star the repository if you find it useful — it helps others discover it
Self-hosted VPN & networking projects
- 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: ~1.5 GB free (model is ~320 MB; PyTorch runtime uses additional memory)
- Internet access for the initial model download (the model is cached locally afterwards). Not required if using
KOKORO_LOCAL_ONLY=truewith a pre-cached model.
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
:cudaimage supportslinux/amd64only
For internet-facing deployments, see Using a reverse proxy to add HTTPS.
Get the trusted build from the Docker Hub registry:
docker pull hwdsl2/kokoro-serverFor NVIDIA GPU acceleration, pull the :cuda tag instead:
docker pull hwdsl2/kokoro-server:cudaAlternatively, you may download from Quay.io:
docker pull quay.io/hwdsl2/kokoro-server
docker image tag quay.io/hwdsl2/kokoro-server hwdsl2/kokoro-serverSupported platforms: linux/amd64 and linux/arm64. The :cuda tag supports linux/amd64 only.
All variables are optional. Fresh installs with a mounted /var/lib/kokoro 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):
| Variable | Description | Default |
|---|---|---|
KOKORO_VOICE |
Default voice for synthesis. See voices for all options. Accepts Kokoro voice IDs (af_heart) or OpenAI aliases (alloy, ballad, etc.). |
af_heart |
KOKORO_SPEED |
Default speech speed. Range: 0.25 (slowest) to 4.0 (fastest). |
1.0 |
KOKORO_PORT |
HTTP port for the API (1–65535). | 8880 |
KOKORO_LANG_CODE |
If set, loads only that language pipeline at startup (a=American English, b=British English, e=Spanish, f=French, h=Hindi, i=Italian, j=Japanese, p=Brazilian Portuguese, z=Mandarin Chinese). When unset, the pipeline is auto-selected from the KOKORO_VOICE prefix. Additional pipelines are created on demand when a request uses a different language. |
(not set) |
KOKORO_API_KEY |
Optional 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 |
KOKORO_LOG_LEVEL |
Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL. |
INFO |
KOKORO_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 model. |
(not set) |
KOKORO_DISABLE_USAGE_COUNTS |
Set 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 KOKORO_PORT, update the -p flag in the docker run command accordingly.
Example using an env file:
cp kokoro.env.example kokoro.env
# Edit kokoro.env with your settings, then:
docker run \
--name kokoro \
--restart=always \
-v kokoro-data:/var/lib/kokoro \
-v ./kokoro.env:/kokoro.env:ro \
-p 8880:8880 \
-d hwdsl2/kokoro-serverThe 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 kokoro \
--restart=always \
-v kokoro-data:/var/lib/kokoro \
-p 8880:8880 \
--env-file=kokoro.env \
-d hwdsl2/kokoro-serverKOKORO_API_KEY_FILE optionally loads the API key from a mounted file. Existing configuration works as before when file inputs are unset.
Use a compatible image and a readable, nonempty file. Leave each matching direct variable unset, including empty assignments in container settings or the mounted env file. See the Compose example and expand the instructions below before changing credential sources.
File-sourced auth keys are not saved in the data volume. Before disabling file mode or downgrading, configure another supported credential source to avoid legacy unauthenticated operation.
Setup, rotation and rollback
Setup
The mounted env file keeps its existing precedence. Conflicting sources, an empty file path or an invalid file stop startup before credential/configuration writes.
Note: If the matching direct variable is inherited from -e or Compose environment, remove its assignment and recreate the container. Alternatively, remove any direct assignment from the bind-mounted kokoro.env, add the matching unset command (for example, unset KOKORO_API_KEY) before the _FILE assignment, and restart once the updated file is visible. This command works in the shell-sourced bind-mounted file; Docker --env-file and Compose env_file do not execute shell commands. The workaround leaves the old credential in the container configuration until recreation.
Use a readable, nonempty regular file (a symlink to one is accepted). Paths may contain spaces. Only terminal LF/CRLF sequences are removed; embedded line breaks, lone CR, NUL and other controls are rejected. Bearer tokens may contain ASCII letters, digits and -._~+/, with optional trailing = padding. External permissions and ownership are unchanged.
Choose a compatible published image, or optionally build a local CPU image from this checkout. For a local build, merge the existing configuration with the Compose override:
docker build -t speakcrate:secret-files-candidate .
SECRET_FILE_IMAGE=speakcrate:secret-files-candidate SECRET_FILE_PATH=/absolute/path/to/api-key \
docker compose -f docker-compose.yml -f docs/examples/compose.secrets.yml configReview the merged configuration before starting only the affected service with the same project, volumes and file arguments. Remove its direct-key assignment first. CUDA deployments must use a compatible CUDA build and their existing CUDA Compose file. Older published images may ignore these inputs; select an image containing this implementation.
Credential storage
File-sourced auth keys are not written to persistent .api_key files. Existing saved keys remain available when file mode is removed. Management helpers use a private 0700 directory and atomic 0600 startup snapshot under /run/kokoro-secrets; /run is not necessarily memory-backed. Snapshots are replaced on startup or removed when file mode ends, so source edits/deletion do not change the key reported by --getkey. Runtime state is not included in data-volume backups.
File mode requires writable private runtime storage. If you replace /run or use a read-only root filesystem, provision the snapshot directory with the service UID and mode 0700.
Upstream processes may still receive the values in environments or arguments; _FILE does not provide encryption.
Back up the external secret source separately from container data.
Rotation and rollback
Rotation is startup-based. After making new contents visible, restart the affected container and refresh credential consumers. Changing the container's environment configuration or mounts requires recreation. Atomic replacement of a bind-mounted host file can leave the old inode mounted; verify visibility and recreate the affected container if needed. Keep persistent volumes and backups. Before downgrading, configure a direct/saved credential supported by the older image and verify protected requests with correct, wrong and missing credentials.
Compatibility
CI covers image builds, authentication and standalone Docker Compose secret mounts for the tested variants. Podman, rootless operation, Podman Compose, Swarm, Kubernetes and GPU acceleration were not tested.
cp kokoro.env.example kokoro.env
# Edit kokoro.env as needed, then:
docker compose up -d
docker logs kokoroExample docker-compose.yml (already included):
services:
kokoro:
image: hwdsl2/kokoro-server
container_name: kokoro
restart: always
ports:
- "8880:8880/tcp" # For a host-based reverse proxy, change to "127.0.0.1:8880:8880/tcp"
volumes:
- kokoro-data:/var/lib/kokoro
- ./kokoro.env:/kokoro.env:ro
volumes:
kokoro-data:
name: kokoro-dataNote
For internet-facing deployments, use a reverse proxy to add HTTPS. Also change "8880:8880/tcp" to "127.0.0.1:8880:8880/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 kokoro.env.example kokoro.env
# Edit kokoro.env as needed, then:
docker compose -f docker-compose.cuda.yml up -d
docker logs kokoroExample docker-compose.cuda.yml (already included):
services:
kokoro:
image: hwdsl2/kokoro-server:cuda
container_name: kokoro
restart: always
ports:
- "8880:8880/tcp" # For a host-based reverse proxy, change to "127.0.0.1:8880:8880/tcp"
volumes:
- kokoro-data:/var/lib/kokoro
- ./kokoro.env:/kokoro.env:ro
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
volumes:
kokoro-data:
name: kokoro-dataThe API is compatible with OpenAI's text-to-speech endpoint. For clients using the OpenAI SDK, configure the base URL and your server's API key:
OpenAI voice names are accepted as local aliases for client compatibility. These aliases map to Kokoro voices and do not reproduce OpenAI's proprietary voices. The voice field may be a string or an object with an id field; unknown voices return 400.
Fresh persistent installations require an API key. Retrieve it for the following examples:
speak_api_key="$(docker exec kokoro kokoro_manage --getkey)"
export OPENAI_BASE_URL="http://your_server_ip:8880/v1"
export OPENAI_API_KEY="$speak_api_key"If API key authentication is disabled, omit the Authorization header in curl examples. OpenAI SDK clients still require a nonempty key; set OPENAI_API_KEY=unused.
POST /v1/audio/speech
Content-Type: application/json
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
model |
string | ✅ | Pass tts-1, tts-1-hd, or kokoro (all use Kokoro-82M). |
input |
string | ✅ | The text to synthesize. Maximum 4096 characters. |
voice |
string or object | ✅ | Voice to use. See available voices. Accepts Kokoro IDs, OpenAI aliases that map to local Kokoro voices, or an object with an id field. Unknown voices return 400. |
response_format |
string | — | Output format. Default: mp3. Options: mp3, opus, aac, flac, wav, pcm. pcm is raw signed 16-bit little-endian audio at 24 kHz mono, with no header. |
speed |
float | — | Speech speed. Default: 1.0. Range: 0.25–4.0. |
instructions |
string | — | Control the voice with additional instructions. Accepted for API compatibility but not currently supported by the Kokoro engine (ignored). |
stream_format |
string | — | The format to stream the audio in. Options: audio, sse. When set to audio, audio bytes are streamed via chunked transfer encoding. When set to sse, the response uses Server-Sent Events with speech.audio.delta and speech.audio.done events (OpenAI streaming speech protocol). For SSE WAV, the first delta is a streaming WAV header and later deltas are raw PCM_S16LE at 24 kHz mono. SSE PCM deltas are raw PCM_S16LE at 24 kHz mono with no header. If omitted, the full audio is returned as a single response. |
volume_multiplier |
float | — | Output volume multiplier. Default: 1.0. Range: 0.1–2.0. Values above 1.0 amplify, below 1.0 attenuate. Samples are clipped after scaling to prevent distortion. |
Example:
curl http://your_server_ip:8880/v1/audio/speech \
-H "Authorization: Bearer $speak_api_key" \
-H "Content-Type: application/json" \
-d '{"model":"tts-1","input":"The quick brown fox jumps over the lazy dog.","voice":"af_heart"}' \
--output speech.mp3With a different voice and format:
curl http://your_server_ip:8880/v1/audio/speech \
-H "Authorization: Bearer $speak_api_key" \
-H "Content-Type: application/json" \
-d '{"model":"tts-1","input":"Hello from London.","voice":"bm_george","response_format":"wav","speed":0.9}' \
--output speech.wavWith API key authentication:
curl http://your_server_ip:8880/v1/audio/speech \
-H "Authorization: Bearer $speak_api_key" \
-H "Content-Type: application/json" \
-d '{"model":"tts-1","input":"Hello world","voice":"nova"}' \
--output speech.mp3Response: Binary audio data with the appropriate Content-Type header.
GET /v1/voices
Returns all available Kokoro voice IDs and their OpenAI alias mappings.
curl http://your_server_ip:8880/v1/voices \
-H "Authorization: Bearer $speak_api_key"GET /v1/models
Returns the active models in OpenAI-compatible format.
curl http://your_server_ip:8880/v1/models \
-H "Authorization: Bearer $speak_api_key"An interactive Swagger UI is available at:
http://your_server_ip:8880/docs
Use kokoro_manage --listvoices to see the full list at any time:
docker exec kokoro kokoro_manage --listvoicesAmerican English:
| Voice ID | Gender | Style |
|---|---|---|
af_heart |
Female | Warm, natural — default |
af_aoede |
Female | |
af_bella |
Female | Expressive |
af_jessica |
Female | Energetic |
af_kore |
Female | |
af_nicole |
Female | Friendly |
af_nova |
Female | Clear |
af_river |
Female | Calm |
af_sarah |
Female | Conversational |
af_sky |
Female | Neutral, versatile |
af_alloy |
Female | Balanced |
am_adam |
Male | Deep |
am_michael |
Male | Clear |
am_echo |
Male | Neutral |
am_eric |
Male | Authoritative |
am_fenrir |
Male | Distinctive |
am_liam |
Male | Conversational |
am_onyx |
Male | Rich |
am_puck |
Male | Expressive |
am_santa |
Male | Warm |
British English:
| Voice ID | Gender | Style |
|---|---|---|
bf_emma |
Female | Clear, professional |
bf_isabella |
Female | Warm |
bf_alice |
Female | Crisp |
bf_lily |
Female | Soft |
bm_george |
Male | Authoritative |
bm_lewis |
Male | Smooth |
bm_daniel |
Male | Calm |
bm_fable |
Male | Expressive |
Japanese: jf_alpha, jf_gongitsune, jf_nezumi, jf_tebukuro, jm_kumo
Mandarin Chinese: zf_xiaobei, zf_xiaoni, zf_xiaoxiao, zf_xiaoyi, zm_yunjian, zm_yunxi, zm_yunxia, zm_yunyang
Spanish: ef_dora, em_alex, em_santa
French: ff_siwis
Hindi: hf_alpha, hf_beta, hm_omega, hm_psi
Italian: if_sara, im_nicola
Brazilian Portuguese: pf_dora, pm_alex, pm_santa
OpenAI voice aliases (accepted in the voice field):
| OpenAI alias | Maps to |
|---|---|
alloy |
af_alloy |
echo |
am_echo |
fable |
bm_fable |
onyx |
am_onyx |
nova |
af_nova |
shimmer |
af_bella |
ash |
am_michael |
coral |
af_heart |
sage |
af_sky |
verse |
bm_george |
ballad |
bm_lewis |
marin |
af_nicole |
cedar |
am_adam |
Tip: The server automatically selects the correct language pipeline from the voice ID prefix — no configuration needed. For example,
jf_alphaloads the Japanese pipeline,bf_emmaloads British English. Additional language pipelines are created on demand when needed.
All voices use a single shared model file (~320 MB). No re-download is needed when switching voices.
All server data is stored in the Docker volume (/var/lib/kokoro inside the container):
/var/lib/kokoro/
├── hub/ # Cached Kokoro model files (downloaded from HuggingFace)
├── .port # Active port (used by kokoro_manage)
├── .voice # Active default voice (used by kokoro_manage)
└── .server_addr # Cached server IP (used by kokoro_manage)
Back up the Docker volume to preserve the downloaded model. The model is ~320 MB and only needs to be downloaded once.
Use kokoro_manage inside the running container to inspect and manage the server.
Show server info:
docker exec kokoro kokoro_manage --showinfoList available voices:
docker exec kokoro kokoro_manage --listvoicesTo change the default voice, update KOKORO_VOICE in your kokoro.env file and restart the container. No model re-download is required — all voices use the same Kokoro-82M model.
# Edit kokoro.env: set KOKORO_VOICE=bm_george
docker restart kokoroNote: Individual API requests can always specify a different voice using the
voicefield, regardless of the container default.
If your SpeakCrate TTS server is reachable from the public internet — even briefly — apply at minimum these protections. SpeakCrate is CPU/GPU-intensive, so an unauthenticated endpoint can be abused to burn your compute resources.
1. Use an API key. Fresh installs with a mounted /var/lib/kokoro volume auto-generate an API key. Display it with docker exec kokoro kokoro_manage --showkey, or use docker exec kokoro kokoro_manage --getkey in scripts. Existing installs without a key remain open for backward compatibility; set KOKORO_API_KEY in your env file to enable authentication manually. All authenticated requests must include Authorization: Bearer <key>.
# Generate a 32-byte random key
openssl rand -hex 322. Bind to localhost when fronted by a reverse proxy. Replace -p 8880:8880 with -p 127.0.0.1:8880:8880 (or change "8880:8880/tcp" to "127.0.0.1:8880:8880/tcp" in docker-compose.yml) so the unencrypted port is not reachable directly from outside the host.
3. Limit request body size at the proxy. TTS requests carry text input; configure your reverse proxy to reject oversized request bodies (e.g. nginx client_max_body_size 1M;).
4. Mind the log level. KOKORO_LOG_LEVEL=DEBUG may write input text to logs. Keep it at INFO or higher on shared systems.
5. Enable CORS at the proxy if calling from a browser. The server does not set Access-Control-Allow-Origin headers by default; add them at your reverse proxy if you intend to call the API directly from a web page on a different origin.
6. Consider rate limiting. Place a rate-limit (e.g. nginx limit_req_zone, Caddy rate_limit) in front of the server to cap concurrent synthesis requests per client IP.
For internet-facing deployments, place a reverse proxy in front of the TTS server 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 TTS container from your reverse proxy:
kokoro:8880— if your reverse proxy runs as a container in the same Docker network as the TTS server (e.g. defined in the samedocker-compose.yml).127.0.0.1:8880— if your reverse proxy runs on the host and port8880is published (the defaultdocker-compose.ymlpublishes it).
Example with Caddy (Docker image) (automatic TLS via Let's Encrypt, reverse proxy in the same Docker network):
Caddyfile:
kokoro.example.com {
reverse_proxy kokoro:8880
}
Example with nginx (reverse proxy on the host):
server {
listen 443 ssl;
server_name kokoro.example.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://127.0.0.1:8880;
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_read_timeout 120s;
}
}To update the Docker image and container, first download the latest version:
docker pull hwdsl2/kokoro-serverIf the Docker image is already up to date, you should see:
Status: Image is up to date for hwdsl2/kokoro-server:latest
Otherwise, it will download the latest version. Remove and re-create the container:
docker rm -f kokoro
# Then re-run the docker run command from Quick start with the same volume and port.Your downloaded model is preserved in the kokoro-data volume.
SpeakCrate can be used as the text-to-speech service in a broader self-hosted AI setup.
For full and lightweight Docker Compose stacks, manual docker run examples, and voice/RAG/MCP pipeline examples with SpeakCrate, EmbedCrate, GatewayCrate, InferCrate, ParseCrate, and UplinkCrate, see Self-Hosted AI Stack.
Related AI services:
- Voice: ScribeCrate
- Documents & search: ParseCrate, EmbedCrate
- Models & gateways: InferCrate, GatewayCrate, UplinkCrate
This image uses public GitHub release asset download counts for anonymous, aggregate usage counts. Counts are approximate and are not unique users or active installs. The image does not send a telemetry payload or use a private collector. It only attempts the best-effort count after the server starts successfully with a mounted /var/lib/kokoro volume, and again when that persistent install first runs a different image build. To opt out, set KOKORO_DISABLE_USAGE_COUNTS=1.
- Base image:
python:3.12-slim(Debian) - Runtime: Python 3 (virtual environment at
/opt/venv) - TTS engine: Kokoro (Kokoro-82M, Apache 2.0) with PyTorch (CPU and CUDA GPU)
- API framework: FastAPI + Uvicorn
- Audio encoding: soundfile (wav/flac), ffmpeg (mp3/aac/opus)
- Data directory:
/var/lib/kokoro(Docker volume) - Model storage: HuggingFace Hub format inside the volume — downloaded once, reused on restarts
- Sample rate: 24 kHz (native Kokoro output)
Note: The software components inside the pre-built image (such as Kokoro 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.
Kokoro TTS is Copyright (C) hexgrad, and is distributed under the Apache License 2.0.
This project is an independent Docker setup for Kokoro and is not affiliated with, endorsed by, or sponsored by hexgrad or OpenAI.