Install and Run docsfy Without Docker
Use this guide to run docsfy directly from a local checkout instead of inside Docker. You will end with a local web app and CLI that both talk to the same server on your machine.
Prerequisites
- A clone of the repository, with your shell opened at the repo root
- Python
3.12or newer uv- Node.js and
npm git- One supported AI provider CLI installed and authenticated on the same machine that will run
docsfy-server
Quick Example
cp .env.example .env
Use these values in .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:
uv run docsfy --host localhost --port 8000 -u admin -p 'change-this-to-a-16-plus-character-password' health
Then open http://localhost:8000/login and sign in as admin with the same admin password.
Note: This example uses a local
DATA_DIRso you do not need a writable/datadirectory, and it setsSECURE_COOKIES=falseso browser login works over plainhttp://localhost.
Step-by-Step
- Install the Python dependencies.
uv sync --frozen
Run uv run ... commands from the repo root after this so both docsfy-server and docsfy use the project environment.
- Create your local
.envfile.
cp .env.example .env
Use these values in .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 the server rejects values shorter than 16 characters.DATA_DIR=.datakeeps the database and generated output in a writable local directory.SECURE_COOKIES=falseis the right choice for plain localhttp://use.- Change
AI_PROVIDERandAI_MODELnow if your machine is set up forclaudeorgeminiinstead ofcursor.
Note: Start
docsfy-serverfrom this repo root so it picks up the.envfile.
- Build the web app that the server will serve.
cd frontend
npm ci
npm run build
cd ..
This builds the browser UI before the backend starts.
- Start the server.
uv run docsfy-server
By default, this listens on 127.0.0.1:8000, so http://localhost:8000 works locally.
Warning: When you later run generations, the selected provider CLI must already be installed and authenticated for the same machine and user account that started
docsfy-server.
- Configure the CLI once and verify the server.
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 connection:
uv run docsfy health
You should see the server URL and an ok status.
Tip:
docsfy config initwrites~/.config/docsfy/config.tomlwith owner-only permissions automatically.
- Sign in from the browser.
Open http://localhost:8000/login, then sign in as admin with the same admin password you used in .env.
See CLI Command Reference for details.
Advanced Usage
**Bind to another address or enable reload**HOST=0.0.0.0 PORT=8000 DEBUG=true uv run docsfy-server
uv run docsfy --host localhost --port 8000 -u admin -p 'change-this-to-a-16-plus-character-password' list
DEBUG=true uv run docsfy-server
cd frontend
API_TARGET=http://localhost:8000 npm run dev
AI_PROVIDER=gemini
AI_MODEL=gemini-2.5-pro
AI_CLI_TIMEOUT=120
npm install -g @mermaid-js/mermaid-cli@11
Troubleshooting
- If
docsfy-serverexits immediately, make sureADMIN_KEYis set and at least 16 characters long. - If browser sign-in keeps returning to
/loginonhttp://localhost, setSECURE_COOKIES=falsein.env. - If the UI says the frontend is not built, or static assets are missing, run
cd frontend && npm ci && npm run build, then restartuv run docsfy-server. - If you get permission errors under
/data, pointDATA_DIRat a writable directory such as.dataor a folder under your home directory. - If
uv run docsfy healthsays no server is configured, runuv run docsfy config init, or pass--host,--port,-u, and-pfor a one-off command. - If a generation fails before it starts, install and authenticate the selected provider CLI on the same machine and for the same user that runs
docsfy-server.