This directory contains tools to run the Logseq HTTP server automatically in the background on macOS using LaunchAgents.
- Auto-start at login: Server starts automatically when you log in
- Persistent: Automatically restarts if it crashes
- GUI Control: AppleScript app to manage the server
- Simple installation: One command to set up everything
cd /path/to/logseq-http-server/macos
./install.shThe installer will:
- Detect your Python installation
- Create a LaunchAgent to auto-start the server
- Start the server immediately
- Optionally install the control app to /Applications
- Python 3: Should be installed via Homebrew
- @logseq/cli: Install with
npm install -g @logseq/cli - jet: Install with
brew install borkdude/brew/jet - Logseq DB graph: Must have at least one DB (database) graph configured
Double-click /Applications/Logseq Server Control.app to:
- Check server status
- Start/stop/restart the server
- View logs
- Clear logs
# Check status
launchctl list | grep logseq
# Start server
launchctl start com.logseq.sidekick.server
# Stop server
launchctl unload ~/Library/LaunchAgents/com.logseq.sidekick.server.plist
# View logs
tail -f /tmp/logseq-server.log
# Clear logs
cat /dev/null > /tmp/logseq-server.logcd /path/to/logseq-http-server/macos
./uninstall.shThis will:
- Stop and remove the LaunchAgent
- Remove the control app from /Applications
- Optionally delete log files
- com.logseq.sidekick.server.plist: Template for LaunchAgent configuration
- Logseq Server Control.applescript: Source code for control app
- Logseq Server Control.app: Compiled AppleScript application
- install.sh: Automated installer script
- uninstall.sh: Automated uninstaller script
The installer creates a LaunchAgent (~/Library/LaunchAgents/com.logseq.sidekick.server.plist) that:
- Runs
python3 logseq_server.pyat login - Keeps it running (restarts on crashes)
- Logs to
/tmp/logseq-server.log - Sets the correct PATH environment variable to find the
logseqCLI
Check the logs:
cat /tmp/logseq-server.logCommon issues:
- "logseq command not found": Install @logseq/cli with
npm install -g @logseq/cli - "jet command not found": Install jet with
brew install borkdude/brew/jet - "Address already in use": Another process is using port 8765
Verify the plist file:
plutil -lint ~/Library/LaunchAgents/com.logseq.sidekick.server.plist
launchctl load -w ~/Library/LaunchAgents/com.logseq.sidekick.server.plistSimply run ./install.sh again. It will ask if you want to reinstall.
By default, the server uses privacy-safe logging:
- Only logs health checks and errors
- Does NOT log search queries or graph names
- Log file:
/tmp/logseq-server.log
If you need to troubleshoot, enable debug mode:
Manual start:
python3 /path/to/logseq_server.py --debugLaunchAgent: Edit the plist to add --debug flag:
-
Stop the server:
launchctl unload ~/Library/LaunchAgents/com.logseq.sidekick.server.plist -
Edit the plist:
nano ~/Library/LaunchAgents/com.logseq.sidekick.server.plist -
Add
<string>--debug</string>to ProgramArguments:<key>ProgramArguments</key> <array> <string>/opt/homebrew/bin/python3</string> <string>/Users/your-username/Documents/Code/logseq-http-server/logseq_server.py</string> <string>--debug</string> <!-- Add this line --> </array>
-
Restart the server:
launchctl load -w ~/Library/LaunchAgents/com.logseq.sidekick.server.plist
After debugging, remember to:
- Remove the
--debugflag from the plist - Clear logs:
cat /dev/null > /tmp/logseq-server.log - Restart:
launchctl unload ~/Library/LaunchAgents/com.logseq.sidekick.server.plist && launchctl load -w ~/Library/LaunchAgents/com.logseq.sidekick.server.plist
The LaunchAgent is configured with:
- Label:
com.logseq.sidekick.server - RunAtLoad:
true(starts at login) - KeepAlive:
true(restarts on crashes) - WorkingDirectory: Path to logseq-http-server directory
- Environment PATH: Includes Homebrew paths for CLI tools
All server output (both stdout and stderr) goes to:
/tmp/logseq-server.log
This file persists across restarts but is cleared on system reboot.
This setup is macOS only. For other platforms:
- Linux: Use systemd user services
- Windows: Use Task Scheduler or NSSM
See the main README for manual server startup instructions.
- Main README - HTTP server overview
- Logseq DB Sidekick TODO - Project roadmap