Skip to content

Windows

A complete Windows guide: install, first run, AI tool setup, background service, update, uninstall, and troubleshooting. For the cross-platform quickstart, see QUICKSTART.md.

Terminal window
# Install (one line)
iwr https://raw.githubusercontent.com/ctxone/ctxone/main/install.ps1 | iex
# Open a new PowerShell window, then
ctx serve --http # in one window
ctx demo # in another
ctx init # wire into Claude Code, Cursor, VS Code...

Three files end up in %LOCALAPPDATA%\ctxone\bin\: ctx.exe, ctxone-hub.exe, and the memory database at %APPDATA%\ctxone\memory.db.

You want…Use
The lightest, most native experienceinstall.ps1 (recommended)
To run CTXone without touching your Windows PATHDocker Desktop
To hack on the sourceBuild from source

All three options produce a working Hub. They don’t conflict — you can install via install.ps1 and later cargo build from source without breaking anything.

Open PowerShell (not Command Prompt) and run:

Terminal window
iwr https://raw.githubusercontent.com/ctxone/ctxone/main/install.ps1 | iex

This downloads the latest release’s ctx.exe and ctxone-hub.exe into %LOCALAPPDATA%\ctxone\bin and adds that directory to your user PATH.

Important: PATH changes only take effect in new PowerShell windows. Close and reopen your shell before running ctx --version.

If the installer is blocked by PowerShell’s execution policy, run:

Terminal window
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
iwr https://raw.githubusercontent.com/ctxone/ctxone/main/install.ps1 | iex

This only affects the current window — it doesn’t weaken your system policy.

If you already run Docker Desktop on Windows, you can skip install.ps1 entirely:

Terminal window
docker run -p 3001:3001 -v ctxone-data:/data ghcr.io/ctxone/ctxone:latest

Docker Desktop pulls the Linux multi-arch image (amd64 or arm64 depending on your CPU) and runs it inside its built-in WSL2 Linux VM. From the Windows side, you just see localhost:3001.

Caveats with this path:

  • There’s no ctx.exe on your Windows shell unless you also run install.ps1. You’d have to use the Hub via HTTP directly, or exec into the container (docker exec -it <container> ctx ...).
  • ctx init can’t write configs into the container’s isolated filesystem. Install ctx.exe natively if you want auto-config.
  • Most users pair Docker for the Hub with install.ps1 for the CLI.

You need Rust ≥1.88 and Git.

Terminal window
git clone --recursive https://github.com/ctxone/ctxone.git
cd ctxone
cargo build --workspace --release

The binaries land in target\release\ctx.exe and target\release\ctxone-hub.exe. Copy them anywhere on your PATH, or cargo-install them:

Terminal window
cargo install --path cli
cargo install --path server

After installing via install.ps1, open a new PowerShell window and check everything is healthy:

Terminal window
ctx --version
ctx doctor

ctx doctor will show ✗ next to “hub HTTP endpoint” until you start the Hub. That’s expected.

Terminal window
ctx serve --http

You’ll see:

Starting CTXone Hub on port 3001 (db: C:\Users\you\AppData\Roaming\ctxone\memory.db)
CTXone Hub v0.60.0
Storage: C:\Users\you\AppData\Roaming\ctxone\memory.db
HTTP API listening on http://0.0.0.0:3001

Leave this window running. Open a second PowerShell window for the rest.

In the second window:

Terminal window
ctx status
ctx demo

ctx demo seeds 21 facts and runs four recalls, showing live token savings. If you see output like 18.4x overall, everything’s working.

Terminal window
ctx init

On Windows, ctx init detects and writes configs for:

ToolConfig path
Claude Code (project).\.mcp.json
Claude Desktop%APPDATA%\Claude\claude_desktop_config.json
Cursor.\.cursor\mcp.json or %USERPROFILE%\.cursor\mcp.json
VS Code.\.vscode\mcp.json or %APPDATA%\Code\User\settings.json
Codex%USERPROFILE%\.codex\config.toml
Gemini.\.gemini\settings.json or %USERPROFILE%\.gemini\settings.json
Grok.\.grok\settings.json or %USERPROFILE%\.grok\settings.json

By default, ctx init writes project-local configs in the current directory. Use ctx init --global to write user-level configs.

After ctx init, restart each AI tool so it picks up the new MCP server config.

Having a PowerShell window pinned to ctx serve --http works for development. For daily use, there are three options to run it in the background.

Option A: Windows Task Scheduler (no admin required)

Section titled “Option A: Windows Task Scheduler (no admin required)”

The cleanest solution. Register a task that runs at login.

Terminal window
# Register the task once
$Action = New-ScheduledTaskAction `
-Execute "$env:LOCALAPPDATA\ctxone\bin\ctxone-hub.exe" `
-Argument "--http --port 3001 --path $env:APPDATA\ctxone\memory.db"
$Trigger = New-ScheduledTaskTrigger -AtLogOn -User $env:USERNAME
$Settings = New-ScheduledTaskSettingsSet `
-AllowStartIfOnBatteries `
-DontStopIfGoingOnBatteries `
-StartWhenAvailable
Register-ScheduledTask `
-TaskName "CTXone Hub" `
-Action $Action `
-Trigger $Trigger `
-Settings $Settings `
-Description "CTXone memory layer for AI agents"

Start it immediately:

Terminal window
Start-ScheduledTask -TaskName "CTXone Hub"

Verify:

Terminal window
ctx status

Remove later:

Terminal window
Unregister-ScheduledTask -TaskName "CTXone Hub" -Confirm:$false

Lowest friction if you don’t need it running all the time.

Terminal window
$WScript = New-Object -ComObject WScript.Shell
$Shortcut = $WScript.CreateShortcut("$env:APPDATA\Microsoft\Windows\Start Menu\Programs\CTXone Hub.lnk")
$Shortcut.TargetPath = "$env:LOCALAPPDATA\ctxone\bin\ctxone-hub.exe"
$Shortcut.Arguments = "--http --port 3001"
$Shortcut.WorkingDirectory = "$env:APPDATA\ctxone"
$Shortcut.WindowStyle = 7 # Minimized
$Shortcut.Save()

Now “CTXone Hub” appears in your Start menu and launches a minimized window when clicked.

Option C: Run as a real Windows service (NSSM)

Section titled “Option C: Run as a real Windows service (NSSM)”

For always-on production-style setups. Install NSSM first, then:

Terminal window
nssm install CTXoneHub "$env:LOCALAPPDATA\ctxone\bin\ctxone-hub.exe"
nssm set CTXoneHub AppParameters "--http --port 3001 --path $env:APPDATA\ctxone\memory.db"
nssm set CTXoneHub DisplayName "CTXone Hub"
nssm set CTXoneHub Start SERVICE_AUTO_START
nssm start CTXoneHub

This runs the Hub under the Windows service control manager — it starts at boot before any user logs in, restarts on crash, and shows up in services.msc.

CTXone uses Windows-standard locations:

WhatWhere
Binaries%LOCALAPPDATA%\ctxone\bin\ (e.g., C:\Users\you\AppData\Local\ctxone\bin)
Memory database%APPDATA%\ctxone\memory.db (e.g., C:\Users\you\AppData\Roaming\ctxone\memory.db)
Config file%APPDATA%\ctxone\config.toml
Log file(Hub logs to stderr by default; redirect with 2> if needed)

Re-run the installer. It overwrites ctx.exe and ctxone-hub.exe with the latest release.

Terminal window
iwr https://raw.githubusercontent.com/ctxone/ctxone/main/install.ps1 | iex

If the Hub is running via Task Scheduler or NSSM, restart it:

Terminal window
# Task Scheduler
Stop-ScheduledTask -TaskName "CTXone Hub"
Start-ScheduledTask -TaskName "CTXone Hub"
# NSSM
nssm restart CTXoneHub
Terminal window
# 1. Stop any running Hub
Stop-Process -Name "ctxone-hub" -ErrorAction SilentlyContinue
# 2. Remove scheduled task (if you set one up)
Unregister-ScheduledTask -TaskName "CTXone Hub" -Confirm:$false -ErrorAction SilentlyContinue
# 3. Remove NSSM service (if you set one up)
nssm remove CTXoneHub confirm
# 4. Delete the binaries
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\ctxone"
# 5. Delete the memory database and config (WARNING: this loses your memory)
Remove-Item -Recurse -Force "$env:APPDATA\ctxone"
# 6. Remove from user PATH (manual)
# Open: Start → Edit environment variables for your account
# Remove %LOCALAPPDATA%\ctxone\bin from the Path entry

Your current PowerShell session doesn’t have the updated PATH. Close the window and open a new PowerShell. If that still fails, check:

Terminal window
Get-Item "$env:LOCALAPPDATA\ctxone\bin\ctx.exe"
$env:Path -split ';' | Select-String "ctxone"

If the binary is there but not on PATH, add it manually:

Terminal window
$env:Path += ";$env:LOCALAPPDATA\ctxone\bin"

(Persistent across sessions only if you use [Environment]::SetEnvironmentVariable — see install.ps1 for the exact invocation.)

File install.ps1 cannot be loaded because running scripts is disabled on
this system.

Use a process-scoped bypass:

Terminal window
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
iwr https://raw.githubusercontent.com/ctxone/ctxone/main/install.ps1 | iex

This only affects the current window, not your system policy.

Some AV products flag new .exe downloads from GitHub releases. If Windows Defender quarantines ctx.exe or ctxone-hub.exe:

  1. Open Windows Security → Virus & threat protection → Protection history
  2. Find the quarantined file and choose “Restore”
  3. Add %LOCALAPPDATA%\ctxone\bin to Defender’s exclusions if it keeps happening

Something else is bound to 3001. Use a different port:

Terminal window
ctx serve --http --port 3002
ctx --server http://localhost:3002 status

Or persist the new default in your config:

Terminal window
ctx config set server http://localhost:3002

ctx init wrote configs but Claude Code / Cursor can’t see CTXone

Section titled “ctx init wrote configs but Claude Code / Cursor can’t see CTXone”

Restart the AI tool. Most MCP clients load config at startup. If the tool still doesn’t see CTXone:

Terminal window
ctx init --dry-run

Copy the reported config path, open it in a text editor, and verify the mcpServers.ctxone entry points at your real ctxone-hub.exe path.

Windows Defender Firewall may prompt when ctxone-hub.exe first binds to port 3001. Allow it for private networks (you don’t need public network access — the Hub is for your local AI tools).

The memory database is huge / I want to start over

Section titled “The memory database is huge / I want to start over”
Terminal window
# Stop the Hub first
Stop-Process -Name "ctxone-hub" -ErrorAction SilentlyContinue
# Delete the database
Remove-Item "$env:APPDATA\ctxone\memory.db"
# Restart the Hub — it'll create a fresh database
ctx serve --http

Your config file stays intact; only the memory is wiped.

If you’re using Docker Desktop instead of install.ps1:

  • Docker Desktop runs Linux containers via a WSL2-based Linux VM. Our ghcr.io/ctxone/ctxone image is a Linux image; it runs in that VM. You never see or touch the VM directly.
  • docker run -p 3001:3001 ... forwards port 3001 from the VM to Windows localhost. ctx status (if you also installed ctx.exe) will connect to http://localhost:3001 and just work.
  • The container’s filesystem is isolated. ctx init runs on Windows (not in the container) and writes configs to Windows paths. The container and the config paths are two different concerns — the container is the Hub, the Windows binary is the client.

A common setup:

  • Hub runs in Docker Desktop (auto-starts with Docker)
  • ctx.exe runs natively on Windows (from install.ps1)
  • Both talk to http://localhost:3001
  • Quickstart — the cross-platform 5-minute walkthrough
  • Architecture — how recall and pinning work
  • Cookbook — real workflow recipes (some assume bash; most translate to PowerShell with minor tweaks)
  • CLI Reference — every command and flag
  • Troubleshooting — the full top-10 error list