Docs / fastkit-cli / server

server

Start the FastAPI development server powered by Uvicorn. Sensible defaults out of the box — auto-reload enabled, bound to all interfaces so you can test from any device on the network.

Usage

fastkit server [OPTIONS]

The simplest way to start — all defaults apply:

bash
fastkit server
Terminal
$ fastkit server
INFO: Will watch for changes in these directories: ['/home/user/my-project']
INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO: Started reloader process [12345] using WatchFiles
INFO: Application startup complete.

Options

OptionShortDefaultDescription
--host -h 0.0.0.0 Network interface to bind to
--port -p 8000 TCP port to listen on
--reload / --no-reload --reload Enable or disable auto-reload on file changes

Default host: 0.0.0.0

Binding to 0.0.0.0 makes the server accessible on all network interfaces — localhost and any local network IP. This means you can test from a mobile device or another machine on the same network without any extra configuration.

If you want to restrict access to the local machine only, use 127.0.0.1:

bash
fastkit server --host 127.0.0.1

Examples

Default — all interfaces, port 8000, auto-reload on
bash
fastkit server
Custom host and port
bash
fastkit server --host 127.0.0.1 --port 9000
Disable auto-reload (faster startup, no file watching)
bash
fastkit server --no-reload
Run two projects simultaneously on different ports
bash
# Terminal 1 — user service
cd my-user-service && fastkit server --port 8001

# Terminal 2 — invoice service
cd my-invoice-service && fastkit server --port 8002

Auto-reload

Auto-reload is enabled by default. Uvicorn watches your project files and automatically restarts the server whenever a .py file changes — no manual restart needed during development.

ON — default fastkit server
  • File watcher process runs alongside the server
  • Restarts automatically on any .py change
  • Slightly higher memory usage
  • Ideal for active development
OFF fastkit server --no-reload
  • Single process, no file watcher
  • Faster startup — no overhead
  • Manual restart required after changes
  • Useful for integration testing or CI

Useful URLs

Once the server starts, these URLs are available immediately:

API
http://localhost:8000
Your FastAPI application root
Swagger
http://localhost:8000/docs
Interactive Swagger UI — test every endpoint directly in the browser
ReDoc
http://localhost:8000/redoc
Alternative API reference documentation
OpenAPI
http://localhost:8000/openapi.json
Raw OpenAPI schema — import into Postman, Insomnia, or any API client

If you run on a custom port (e.g. --port 9000), replace 8000 with your port in all URLs above.

Production

fastkit server is designed for development only. For production, run Uvicorn directly with production-grade settings — or use a process manager like Gunicorn with the Uvicorn worker:

bash
uvicorn main:app \
  --host 0.0.0.0 \
  --port 8000 \
  --workers 4 \
  --no-access-log
bash
pip install gunicorn

gunicorn main:app \
  --workers 4 \
  --worker-class uvicorn.workers.UvicornWorker \
  --bind 0.0.0.0:8000
dockerfile
FROM python:3.12-slim

WORKDIR /app
COPY . .

RUN pip install -r requirements.txt

EXPOSE 8000

CMD ["uvicorn", "main:app",
     "--host", "0.0.0.0",
     "--port", "8000",
     "--workers", "4"]

Never use --reload in production. File watching adds overhead and the reloader process has elevated filesystem permissions.

You've covered all of FastKit CLI

That's the complete documentation — make, migrate, db seed, and server. Ready to build something?