Skip to content

Installation

Zenith is a batteries-included Python web framework that comes with everything you need to build production APIs.

Terminal window
pip install zenithweb
# Verify installation
zen --version

Zenith bundles commonly needed dependencies so you can start building immediately:

Database & ORM

  • SQLAlchemy 2.0+ with async support
  • SQLModel for type-safe models
  • PostgreSQL driver (asyncpg)
  • SQLite driver (aiosqlite)
  • Alembic for migrations

Authentication & Security

  • JWT libraries (PyJWT)
  • Password hashing (Argon2 via pwdlib)
  • Security headers middleware

Performance & Caching

  • Redis client for caching
  • JSON serialization (orjson, msgspec)
  • Performance monitoring (prometheus-client)
  • Async server (uvicorn)

Development Tools

  • WebSocket support
  • File upload support (python-multipart)
  • Testing utilities
  • CLI tools
  • Python 3.12-3.13
  • pip or uv package manager
  • PostgreSQL or SQLite for database (optional)
  • Redis for caching and background tasks (optional)

The standard Python package manager:

Terminal window
# Install Zenith
pip install zenithweb
# Create your first project
zen new my-api
cd my-api
# Start development server
zen dev

uv is a fast, modern Python package manager:

Terminal window
# Install uv if you haven't
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install Zenith
uv add zenithweb
# Run with uv
uv run zen dev

For projects that use Poetry for dependency management:

Terminal window
# Add to your project
poetry add zenithweb
# Run commands
poetry run zen dev
MethodBest ForKey Benefit
pipQuick start, tutorialsUniversal, works everywhere
uvModern development10-100x faster installs
PoetryTeam projectsLock files, reproducible builds
DockerMicroservicesConsistent environments

Install additional features as needed:

Terminal window
# Development tools (testing, linting)
pip install "zenithweb[dev]"
# Performance benchmarking
pip install "zenithweb[benchmark]"
# Additional performance optimizations
pip install "zenithweb[performance]"
# HTTP/3 support
pip install "zenithweb[http3]"
# Advanced compression
pip install "zenithweb[compression]"
Terminal window
# Create virtual environment
python -m venv venv
# Activate it
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install Zenith
pip install zenithweb

Create a .env file for your configuration:

Terminal window
# Database
DATABASE_URL=postgresql://user:password@localhost/zenith_dev
# Redis (optional)
REDIS_URL=redis://localhost:6379
# Security
SECRET_KEY=your-secret-key-here
# Environment
DEBUG=true
ENVIRONMENT=development

For containerized development:

docker-compose.yml
version: '3.8'
services:
postgres:
image: postgres:15
environment:
POSTGRES_USER: zenith
POSTGRES_PASSWORD: zenith
POSTGRES_DB: zenith_dev
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
postgres_data:

Start services:

Terminal window
docker-compose up -d

After installation, verify everything works:

Terminal window
# Check CLI
zen --version
# Check Python import
python -c "import zenith; print(zenith.__version__)"
# Create test project
zen new test-project
cd test-project
# Run development server
zen dev
# Visit http://localhost:8000

Install recommended extensions for the best experience:

{
"recommendations": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter",
"charliermarsh.ruff",
"tamasfe.even-better-toml"
]
}
  1. Set Python interpreter to your virtual environment
  2. Enable type checking in settings
  3. Configure Black as the code formatter
Terminal window
# Install with production optimizations
pip install "zenithweb[performance]"
# Set production environment variables
export DATABASE_URL=postgresql://...
export REDIS_URL=redis://...
export SECRET_KEY=$(zen keygen)
export DEBUG=false
# Run with production server
zen serve --workers 4
  • Ensure Python 3.12-3.13 is being used
  • Check virtual environment is activated
  • Reinstall: pip install --force-reinstall zenithweb
  • Check if zen is in your PATH
  • Try python -m zenith.cli instead
  • Ensure virtual environment is activated
  • Stop other processes: lsof -i :8000
  • Use different port: zen dev --port 8001