Install and Run docsfy Without Docker
You want docsfy running straight from a local checkout so you can use the web app and CLI without a container. This setup is useful when you want a normal Python and Node workflow, faster frontend iteration, or direct access to the AI CLIs on your machine.
Prerequisites
- A local clone of the repository, with your shell at the repo root
- Python
3.12or newer uv- Node.js and
npm git- One supported AI provider CLI installed and signed in on the same machine and as the same user that will run
docsfy-server:claude,gemini, orcursor
Quick Example
cp .env.example .env
ADMIN_KEY=change-this-to-a-16-plus-character-password
AI_PROVIDER=cursor
AI_MODEL=gpt-5.4-xhigh-fast
AI_CLI_TIMEOUT=60
LOG_LEVEL=INFO
DATA_DIR=data
SECURE_COOKIES=false
uv sync --frozen
cd frontend
npm ci
npm run build
cd ..
uv run docsfy-server
In another terminal:
curl http://localhost:8000/health
Then open http://localhost:8000/login and sign in with username admin and the same ADMIN_KEY value from .env.
Note:
DATA_DIR=datakeeps the database and generated output in a writable local folder, andSECURE_COOKIES=falseis required for browser login over plainhttp://localhost. If you plan to generate docs withclaudeorgemini, replaceAI_PROVIDERandAI_MODELbefore your first run.
Step-by-Step
- Install the Python environment.
uv sync --frozen
Run all uv run ... commands from the repo root after this so both docsfy-server and docsfy use the project environment.
- Create a local
.env.
cp .env.example .env
ADMIN_KEY=change-this-to-a-16-plus-character-password
AI_PROVIDER=cursor
AI_MODEL=gpt-5.4-xhigh-fast
AI_CLI_TIMEOUT=60
LOG_LEVEL=INFO
DATA_DIR=data
SECURE_COOKIES=false
Put in .env |
Set when you start the server |
|---|---|
ADMIN_KEY, AI_PROVIDER, AI_MODEL, AI_CLI_TIMEOUT, LOG_LEVEL, DATA_DIR, SECURE_COOKIES |
HOST, PORT, DEBUG |
ADMIN_KEYis required and must be at least 16 characters long.DATA_DIR=datakeeps local state in a writable project folder instead of a system path like/data.SECURE_COOKIES=falselets the browser keep the login session onhttp://localhost.- Change
AI_PROVIDERandAI_MODELnow if you are usingclaudeorgeminiinstead ofcursor.
See Configuration Reference for every supported setting.
Note: Start
docsfy-serverfrom the repo root so it picks up.env.
- Build the browser UI that the server will serve.
cd frontend
npm ci
npm run build
cd ..
This creates the frontend files that http://localhost:8000/ and http://localhost:8000/login need in a normal local run.
- Start the server.
uv run docsfy-server
By default, the server listens on 127.0.0.1:8000, so http://localhost:8000 works locally.
Warning: Before you start a generation, the selected provider CLI must already be installed, on
PATH, and signed in for the same OS user that starteddocsfy-server.
- Verify the server from the browser and the CLI.
curl http://localhost:8000/health
A successful response confirms the backend is up. After that, open http://localhost:8000/login and sign in as admin with the same ADMIN_KEY.
Set up the CLI once:
uv run docsfy config init
Use these values when prompted:
- Profile name:
dev - Server URL:
http://localhost:8000 - Username:
admin - Password: the same value as
ADMIN_KEY
Then verify the saved profile:
uv run docsfy health
Tip:
docsfy config initcreates~/.config/docsfy/config.tomlfor you, so later CLI commands can keep using your localhttp://localhost:8000server without re-entering the connection details.
- Start using the local server.
uv run docsfy list
If you have not generated anything yet, No projects found. is normal on a fresh install. See Generating Documentation when you are ready to create your first docs site, and see Managing docsfy from the CLI or CLI Command Reference for the next CLI steps.
Advanced Usage
Choose a built UI or a live-reload UI
| When you want | Backend | Frontend | Open |
|---|---|---|---|
| One local server that serves the built app | uv run docsfy-server |
cd frontend && npm ci && npm run build |
http://localhost:8000 |
| Live frontend reload while you work on the UI | DEBUG=true uv run docsfy-server |
cd frontend && API_TARGET=http://localhost:8000 npm run dev |
http://localhost:5173 |
DEBUG=true uv run docsfy-server
cd frontend
API_TARGET=http://localhost:8000 npm run dev
Open http://localhost:5173. The Vite dev server proxies /api, /docs, and /health to the backend on port 8000.
Note: The commented
DEV_MODEline in.env.exampleis for the container entrypoint. For a direct local run, start the backend and Vite yourself.
Change the bind address or port
HOST=0.0.0.0 PORT=9000 DEBUG=true uv run docsfy-server
Use this when you want another port, LAN access, or automatic backend reload during development.
Tune local generation defaults
AI_PROVIDER=gemini
AI_MODEL=gemini-2.5-pro
AI_CLI_TIMEOUT=120
MAX_CONCURRENT_PAGES=4
Use these settings when you want a different default provider or model, a longer CLI timeout, or lower local parallelism on a smaller machine. See Configuration Reference for the full list.
Troubleshooting
- If
docsfy-serverexits immediately, make sureADMIN_KEYis set and at least 16 characters long. - If browser login keeps returning to
/loginonhttp://localhost, setSECURE_COOKIES=falsein.env, then restart the server. - If the browser says the frontend is not built, run
cd frontend && npm ci && npm run build, then restartuv run docsfy-server. - If you get permission errors under
/data, pointDATA_DIRat a writable local folder such asdata. - If a generation fails before it really starts, the selected
claude,gemini, orcursorCLI is usually missing, signed out, or installed for a different user than the one runningdocsfy-server. - If
uv run docsfy healthfails before connecting, finishuv run docsfy config initfirst so the CLI has a saved local profile.
See Fixing Setup and Generation Problems for deeper setup and runtime failures.