Chatterbox TTS Installation on Ubuntu 24.04 – Free & Open-Source ElevenLabs Alternative

Chatterbox TTS Installation on Ubuntu 24.04 – Free & Open-Source ElevenLabs Alternative

  • 12 Jan, 2026
  • AI

How to Install Chatterbox TTS on Ubuntu 24.04 (Free ElevenLabs Alternative)


1.1 Update System and Install Basic Tools


# Update system
apt update && apt upgrade -y

# Install essential tools
apt install -y \
curl \
wget \
git \
vim \
nano \
htop \
net-tools \
build-essential \
software-properties-common \
lsb-release \
ca-certificates



1.2 Install Python 3.11 (Required for TTS)
Ubuntu 24.04 has Python 3.12 by default, but TTS needs Python 3.11:

# Add deadsnakes PPA for Python 3.11
add-apt-repository -y ppa:deadsnakes/ppa
apt update

# Install Python 3.11 and virtual environment tools
apt install -y \
python3.11 \
python3.11-venv \
python3.11-dev \
python3.11-distutils \
python3.11-tk

# Set Python 3.11 as default python3 (optional)
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
update-alternatives --set python3 /usr/bin/python3.11

# Verify Python version
python3 --version # Should show 3.11.x


1.3 Install System Dependencies for TTS

# Install audio and build dependencies
apt install -y \
build-essential \
cmake \
ffmpeg \
libsndfile1 \
libsndfile1-dev \
libopenblas-dev \
libatlas-base-dev \
libhdf5-dev \
portaudio19-dev \
libportaudio2 \
libportaudiocpp0 \
espeak-ng \
sox \
libsox-fmt-all \
pulseaudio \
pulseaudio-utils \
libssl-dev \
libffi-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
zlib1g-dev \
libncursesw5-dev \
libgdbm-dev \
tk-dev \
liblzma-dev


Step 2: Create Project Directory and Virtual Environment
2.1 Create Project Structure

# Create project directory
mkdir -p /opt/chatterbox
cd /opt/chatterbox

# Create directory structure

mkdir -p {models,data/{audio/{input,output,training},text},api,webui,scripts,logs,config}

2.2 Create Python 3.11 Virtual Environment


# Create virtual environment with Python 3.11
python3.11 -m venv venv

# Activate virtual environment
source venv/bin/activate

# Verify Python in venv
python --version # Should show 3.11.x
which python # Should show /opt/chatterbox/venv/bin/python


2.3 Upgrade pip and setuptools

pip install --upgrade pip setuptools wheel



Step 3: Install Python Packages


3.1 Install PyTorch First


# For CPU (if no GPU)
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu

# For CUDA 11.8 (if you have NVIDIA GPU)
# pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

# Verify PyTorch
python -c "import torch; print(f'PyTorch {torch.__version__}'); print(f'CUDA: {torch.cuda.is_available()}')"



3.2 Install TTS from GitHub (Most Reliable)

# Install TTS from GitHub (more reliable than PyPI)
pip install git+https://github.com/coqui-ai/TTS.git

# Or install specific version
# pip install TTS==0.22.0

# Verify TTS installation
python -c "import TTS; print(f'TTS {TTS.__version__}')"



3.3 Install Additional Dependencies

# Create requirements.txt
cat > requirements.txt << 'EOF'
# Core TTS dependencies
TTS==0.22.0
transformers==4.40.2
sentencepiece==0.2.0
protobuf==3.20.3

# Audio processing
soundfile==0.12.1
librosa==0.10.1
pydub==0.25.1
pyaudio==0.2.14
webrtcvad==2.0.10
phonemizer==3.2.1

# Web/API
fastapi==0.110.0
uvicorn[standard]==0.29.0
streamlit==1.32.0
flask==3.0.3
flask-cors==4.0.1

# Utilities
numpy==1.26.4
scipy==1.12.0
pandas==1.5.3 # Must be <2.0 for TTS compatibility
scikit-learn==1.4.2
pillow==10.3.0
pyyaml==6.0.1
tqdm==4.66.2
requests==2.31.0


EOF

# Install all requirements
pip install -r requirements.txt

# Install additional packages that might be missing
pip install coqpit pyyaml tqdm scikit-learn transformers tokenizers einops numba llvmlite



3.4 Fix Any Missing Dependencies

# If you get "No module named 'coqpit'" or similar errors:
pip install coqpit

# If audio playback issues:
pip install sounddevice



Step 4: Download TTS Models
4.1 Create Model Download Script





cat > scripts/download_models.py << 'EOF'
#!/usr/bin/env python3
"""
Download TTS model for English only
"""

import os
import sys
from pathlib import Path
from TTS.api import TTS
import torch

print("=" * 60)
print("ChatterBox TTS Model Downloader")
print("=" * 60)

# System info
print(f"Python: {sys.version}")
print(f"PyTorch: {torch.__version__}")
print(f"CUDA available: {torch.cuda.is_available()}")

# Create models directory
model_dir = Path("models")
model_dir.mkdir(exist_ok=True)

# Function to download model with error handling
def download_model(model_name, model_type, test_text):
print(f"\n{'='*50}")
print(f"Downloading {model_type} model...")
print(f"Model: {model_name}")
print(f"{'='*50}")

try:
# Download model
tts = TTS(model_name=model_name, progress_bar=True)
print(f"? {model_type} model loaded successfully")

# Generate test audio
test_file = model_dir / f"test_{model_type}.wav"

# Check if it's multilingual model
if "multilingual" in model_name:
try:
# Try with language parameter
tts.tts_to_file(
text=test_text,
file_path=str(test_file),
language="en"
)
except:
# Fallback without language parameter
tts.tts_to_file(
text=test_text,
file_path=str(test_file)
)
else:
tts.tts_to_file(
text=test_text,
file_path=str(test_file)
)

# Verify file creation
if test_file.exists():
file_size = test_file.stat().st_size / 1024 # KB
print(f"? Test audio generated: {test_file}")
print(f" File size: {file_size:.1f} KB")
return True
else:
print(f"? Test file not created")
return False

except Exception as e:
print(f"? Error downloading {model_type} model: {str(e)[:200]}")
return False

# Download English model
english_success = download_model(
model_name="tts_models/en/ljspeech/tacotron2-DDC",
model_type="english",
test_text="Hello, this is a test of the English TTS system."
)

# Alternative English model if the first one fails
if not english_success:
print("\nTrying alternative English model...")
english_success = download_model(
model_name="tts_models/en/ljspeech/fast_pitch",
model_type="english_alternative",
test_text="Hello, this is a test of the alternative English TTS system."
)

print("\n" + "=" * 60)
print("DOWNLOAD SUMMARY")
print("=" * 60)
print(f"English: {'? SUCCESS' if english_success else '? FAILED'}")

if english_success:
print("\n? English model downloaded successfully!")
print("You can now use ChatterBox TTS!")
else:
print("\n?? English model failed to download.")
print("Check the errors above and try again.")

print("=" * 60)
EOF

# Make executable
chmod +x scripts/download_models.py



4.2 Download Models

# Activate virtual environment if not already
source venv/bin/activate

# Download models (this will take time and bandwidth)
python scripts/download_models.py



4.3 Test If Solution is working

cat > /home/generate_voice.py << 'EOF'
#!/usr/bin/env python3
"""
Generate voice message
"""

from TTS.api import TTS
import os

# Text to convert
text = "hello, how are you"
output_file = "/home/my_voice.wav"

print(f"Generating voice file...")

try:
# Initialize TTS
tts = TTS(model_name="tts_models/en/ljspeech/tacotron2-DDC", progress_bar=True)

# Generate and save
tts.tts_to_file(text=text, file_path=output_file)

print(f"? Done! File created: {output_file}")

# Play it automatically if aplay is available
import subprocess
subprocess.run(["aplay", output_file])

except Exception as e:
print(f"Error: {e}")
EOF

# Make it executable
chmod +x /home/generate_voice.py

# Run it
cd /home && python generate_voice.py