Installation Guide¶
This guide covers different ways to install the FastAPI Boilerplate depending on your needs.
System Requirements¶
- Python: 3.11 or higher
- Operating System: Linux, macOS, or Windows (WSL2 recommended)
- Memory: 4GB RAM minimum (8GB recommended)
- Disk Space: ~2GB free
Method 1: Docker Compose (Recommended)¶
Docker Compose handles every service for you (Postgres + Redis + the app).
Prerequisites¶
- Docker (20.10+)
- Docker Compose (v2+)
Steps¶
-
Clone the repository:
-
Set up the environment file:
-
Bring up the stack:
-
Verify it's running:
What Gets Installed¶
- App (FastAPI + Uvicorn) on port 8000
- PostgreSQL on port 5432
- Redis on port 6379
Method 2: Manual Installation (Local with uv)¶
For development on your host machine. You provide PostgreSQL and Redis yourself.
Prerequisites¶
-
Python 3.11+:
-
uv (fast Python package manager):
-
PostgreSQL:
-
Redis:
Steps¶
-
Clone the repository:
The repo is a uv workspace — the deployable application lives in
backend/and the developer CLI (bp) lives incli/. Both share a single virtual environment at the repo root. -
Install Python dependencies:
This syncs the whole workspace — backend, CLI, and dev tools — into one
.venv/at the repo root. From here on,uv run <cmd>works from any subdirectory. -
Set up environment variables:
cp backend/.env.example backend/.env # Edit backend/.env: point POSTGRES_SERVER and CACHE_REDIS_HOST at localhost, # set a strong SECRET_KEY (or run `uv run bp env gen-secret`), etc.The CLI ships a few helpers for this step — see CLI → Commands:
-
Set up PostgreSQL (if not already configured):
-
Run database migrations (from
backend/— alembic looks foralembic.iniin cwd): -
Create the initial admin user and tier:
-
Start the app:
-
(Optional) Start a Taskiq worker (in a second terminal):
Method 3: Development Setup¶
For contributors and anyone modifying the boilerplate itself.
Steps¶
-
Fork and clone:
-
Install dev dependencies:
-
Set up pre-commit hooks (from the repo root):
-
Set up the environment:
-
Run the test suite to verify your setup:
Configuration¶
Environment Variables¶
The app reads its configuration from backend/.env (see backend/.env.example for the full reference). Common variables:
# Environment
ENVIRONMENT=development
# Database
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_SERVER=db # use "localhost" without Docker
POSTGRES_PORT=5432
# Cache (Redis)
CACHE_BACKEND=redis
CACHE_REDIS_HOST=redis # use "localhost" without Docker
CACHE_REDIS_PORT=6379
# Security
SECRET_KEY=insecure-change-this-in-production
# Initial admin
ADMIN_NAME=Admin User
ADMIN_EMAIL=admin@example.com
ADMIN_USERNAME=admin
ADMIN_PASSWORD=your-secure-password
See Environment Variables for the complete reference.
Verification¶
After installing, verify everything works:
- API Docs: http://localhost:8000/docs
- Health Check:
curl http://localhost:8000/health - Admin Panel: http://localhost:8000/admin
- Database: check the app log for "Database connected" / no errors at startup
Troubleshooting¶
Port Already in Use¶
Database Connection Error¶
# Linux
sudo systemctl status postgresql
sudo systemctl restart postgresql
# macOS (Homebrew)
brew services restart postgresql
Redis Connection Error¶
Docker — Clean Reset¶
cd backend
docker compose down # stop containers
docker compose down -v # also delete volumes (⚠️ wipes data)
docker compose build --no-cache
docker compose up
Next Steps¶
- Configuration Guide - Set up your environment
- First Run - Test your installation
- Project Structure - Understand the codebase
Need Help?¶
- Check the GitHub Issues for known problems
- Open a new issue with details