Blog / Tutorials / How to Self-Host Piper TTS for Offline Voice Generation
(last updated: )

How to Self-Host Piper TTS for Offline Voice Generation

Piper TTS is a free neural text-to-speech engine that runs on CPU alone. Learn how to install it on a VPS, download a voice, serve audio over HTTP, and keep your text on your own server.

9 min read
Piper TTS

In short. Piper TTS is a free neural text-to-speech engine that runs on CPU alone, so an ordinary VPS is enough hardware. Install it with pip install piper-tts, fetch a voice with python3 -m piper.download_voices, and write a WAV file with one command. Voices cover 44 language and region combinations. The engine is licensed GPL-3.0, and each voice carries its own separate license.


Text-to-speech on a server used to mean one of two things: a flat robotic system voice, or a metered cloud API that bills you per character and reads every sentence you send it. Piper sits between those. It loads a small neural voice model on hardware you already rent, runs on ordinary CPU cores with no GPU anywhere in the picture, and never sends your text off the machine. Getting it running takes about 15 minutes. Picking a voice you actually like takes longer than the install does.

What Piper TTS Is Good At

Piper TTS is good at producing natural-sounding speech quickly on modest hardware, without a GPU and without a network round trip. Piper TTS is an open-source neural text-to-speech engine that turns written text into spoken audio entirely on the machine it runs on, using compact voice models and no external service.

Synthesis happens in two stages. Piper hands your text to espeak-ng, which converts it into phonemes, and the voice model turns those phonemes into a waveform. The voices themselves are VITS models exported to the ONNX runtime. That combination is why a single voice weighs tens of megabytes rather than gigabytes. The English lessac voice at medium quality is one 63 MB file plus a 5 KB config, and it renders audio at 22,050 Hz.

That design shapes what Piper is and is not. It is a strong fit for accessibility tooling, voice assistants, IVR prompts, audiobook and article narration, and any pipeline that turns written output into audio at volume. The ecosystem around it reflects that: Home Assistant ships a Piper add-on, the NVDA screen reader can use Piper voices, and LocalAI and Open Voice OS both integrate it as a speech backend.

Where it falls short is expressiveness. Piper will not match the top commercial models on emotional range, and it does not do on-the-fly voice cloning. You get per-request controls for speaking speed and variability, not direction. For narration and prompts that is usually fine. For a character performance it is not.

One more thing to go in with your eyes open about. The original rhasspy/piper repository is no longer the active project. Development moved to OHF-Voice/piper1-gpl under the Open Home Foundation, and that repository currently carries an open call for maintainers. The software works and is widely deployed. The old repository was archived and made read-only on October 6, 2025, and the companion piper-phonemize repository went read-only in July 2025. The maintenance picture is thinner than the deployment count suggests, which matters if you are putting it on a critical path.

Installing Piper TTS

Before you start, you need a Linux server with Python 3 and pip available, shell access with sudo, and roughly 1 GB of free disk space for the engine and a couple of voices. There is no GPU to provision and no CUDA toolkit to install. If you want to hear audio on the server itself rather than copying files off it, install ffplay from the FFmpeg package as well.

1. Create a virtual environment. Most current distributions mark the system Python as externally managed and will refuse a global pip install. Create a virtual environment and work inside it.

python3 -m venv ~/piper
source ~/piper/bin/activate

2. Install the engine. One package pulls in the runtime and the command-line interface.

pip install piper-tts

3. Download a voice. Every voice is two files, a .onnx model and a matching .onnx.json config, and the engine will not start without both. The downloader handles the pairing for you.

python3 -m piper.download_voices en_US-lessac-medium

Files land in the current directory unless you pass --data-dir. Run python3 -m piper.download_voices with no argument to list what is available.

4. Synthesize a test phrase. This writes test.wav and confirms the model loads and the phonemizer works.

python3 -m piper -m en_US-lessac-medium -f test.wav -- 'This is a test.'

Copy the file down with scp and play it. If you installed ffplay, drop the -f flag and the audio plays straight through your terminal session instead.

5. Wire it into an application. The command-line path reloads the model on every invocation, which is wasteful for anything repeated. Run the bundled HTTP server instead and keep the model resident in memory.

pip install 'piper-tts[http]'
python3 -m piper.http_server -m en_US-lessac-medium

The server listens on port 5000 and serves a browser test page at that address. Your application posts JSON and gets a WAV back:

curl -X POST -H 'Content-Type: application/json' \
  -d '{ "text": "This is a test." }' \
  -o test.wav localhost:5000/synthesize

The request body also accepts voice, speaker, length_scale for speaking speed, and noise_scale for variability, so one server can serve several voices.

Two failure modes account for most first-run problems. If you downloaded voice files by hand with wget and the engine rejects the model, check the file with file en_US-lessac-medium.onnx. A saved HTML redirect page instead of binary data is the usual culprit, and the downloader avoids it entirely. If you hit an error mentioning piper-phonemize, you are on an older release that needed a separate phonemizer package. Upgrade with pip install --upgrade piper-tts, since current versions embed espeak-ng directly.

Bind the HTTP server to 127.0.0.1 and reach it over an SSH tunnel or a reverse proxy with authentication in front. Port 5000 has no auth of its own, and an open synthesis endpoint is free compute for anyone who finds it.

A few flags earn their keep once the first run is behind you. --input-file reads text from one or more files rather than the command line, which suits batch narration. --sentence-silence adds a pause of a given number of seconds between sentences. --volume applies a multiplier to the output, and --no-normalize switches off the automatic levelling when you would rather manage gain downstream.

When a proper noun or an acronym comes out mangled, override the pronunciation instead of respelling the word. Piper accepts raw espeak-ng phonemes inside double square brackets anywhere in the input text. Generate the phoneme string for a troublesome word with espeak-ng -v en-us --ipa=3 -q batman, then paste the result between the brackets:

I am the [[ bˈætmæn ]] and this is my server.

Why Self-Host Voice Generation Instead of Using an API

Self-hosting Piper TTS wins on three counts that a per-character API cannot match: your text never leaves your server, your bill does not move when your volume does, and nobody rate-limits you at the wrong moment.

The privacy one is the least negotiable. If the text being read aloud is a support ticket, a medical note, a customer address, or anything else covered by GDPR, sending it to a third-party speech API makes that vendor a processor you have to document and assess. Running the model on your own server removes the transfer and the paperwork that follows it.

Cost behaves differently too. Commercial speech APIs bill per character synthesized, so an audiobook project or a bulk re-narration run has an open-ended price tag until it finishes. A VPS has a fixed monthly cost whether it generates one minute of audio or 1,000 hours. The crossover arrives faster than most people expect, and past it the server is effectively free.

Be honest about what you take on. You own the updates and the uptime, including the restart when something falls over at an inconvenient hour. There is no support contract and no SLA. Voice quality tops out below the best commercial offerings. If you generate a handful of clips a month, an API is the cheaper use of your attention.

For the hardware, Piper runs comfortably on a general-purpose Core VPS, the Contabo tier built for everyday workloads with predictable resource needs. No GPU is involved, so the GPU tier is the wrong thing to buy here. The entry plan, Cloud VPS 4, carries 4 vCPU cores, 8 GB RAM, 100 GB SSD, and unlimited traffic under a fair use policy, which leaves room for several voices and a handful of concurrent requests. Scale up a tier if you are narrating in bulk rather than answering the occasional call, and check the current pricing page at Contabo before you order.

FAQ: Self-Hosting Piper TTS

Does Piper TTS need a GPU?

No. Piper TTS runs entirely on CPU by default, which is the main reason it suits ordinary virtual servers. The voice models are small ONNX exports that synthesize faster than real time on a few cores. GPU acceleration exists as an option through the –cuda flag, which requires the onnxruntime-gpu package, but it is unnecessary for typical workloads.

How many languages does Piper TTS support?

The official voice catalog covers 44 language and region combinations, including German, English for both the United States and Great Britain, Spanish for Spain, Mexico, and Argentina, French, Italian, Polish, Portuguese, Ukrainian, Arabic, Hindi, Chinese, and Vietnamese. Several languages offer more than one voice, and voices come in more than one quality level. The full list lives in the VOICES documentation in the Piper repository.

Is Piper TTS free to use commercially?

The engine is free software under GPL-3.0, so it costs nothing and you may run it commercially. The voice models are the part to check: each ships a MODEL_CARD with its own license, inherited from its training data, and some are restrictive. The Piper project states it is intended for personal use and speech research. Review the card for every voice you deploy, and take legal advice first.

How much CPU and RAM does Piper TTS need?

Piper TTS is undemanding. A medium-quality voice is a single 63 MB model file, and the HTTP server loads it once and keeps it resident, so memory use stays flat across requests rather than growing with traffic. Scale CPU cores with the number of concurrent requests rather than with the length of the text. Throughput varies by processor, so benchmark your own voice before sizing the server.