Linux Server Deployment
Run Nowledge Mem as a headless server on Linux without a desktop environment
Nowledge Mem can run as a headless server on Linux machines without a GUI. Install the same .deb or .AppImage package, then manage everything from the command line.
Availability
Background intelligence features such as daily briefings, insight detection, and knowledge graph enrichment require a configured Remote LLM and the appropriate license for your build. The server guide itself is about deployment, not packaging.
Use sudo for package installation and system service installation.
Run day-to-day commands like nmem serve, nmem config ..., nmem license ..., and nmem tui as your normal Linux user.
Recent builds block these stateful commands under root by default so a fresh install does not silently create root-owned Mem state.
System Requirements
| Requirement | Specification |
|---|---|
| Operating System | Ubuntu 22.04+, Debian 12+, or compatible (via AppImage) |
| Architecture | x86_64 |
| Memory (RAM) | 8 GiB minimum (16 GiB recommended) |
| Disk Space | 10 GiB available |
| Dependencies | libgtk-3-0, libwebkit2gtk-4.1-0, zstd (installed automatically by .deb) |
Installation
Set up the APT repository for automatic updates via apt upgrade:
curl -fsSL https://nowledge-co.github.io/community/apt/install.sh | sudo bash
sudo apt-get install nowledge-memThis adds the GPG signing key and repository source. Future updates are installed automatically when you run sudo apt-get update && sudo apt-get upgrade, or via unattended-upgrades if configured.
# Install the package
sudo dpkg -i nowledge-mem_*.deb
# Fix any missing dependencies
sudo apt-get install -f# Make executable
chmod +x Nowledge_Mem_*.AppImage
# Run once to extract the Python runtime
./Nowledge_Mem_*.AppImage --appimage-extract
# The nmem CLI is available after first run
# Location: ~/.local/bin/nmemThe .deb post-install script automatically:
- Extracts the bundled Python runtime
- Creates the
nmemCLI at/usr/local/bin/nmem - Configures the APT repository for automatic updates (if installed via APT)
- Sets up the desktop entry (ignored on headless servers)
Verify the CLI is available:
nmem --versionQuick Start
Start the Server
nmem serveThis runs the server in the foreground (press Ctrl+C to stop). The server starts on 0.0.0.0:14242 by default. Customize with flags:
nmem serve --host 127.0.0.1 --port 8080For production, use nmem service install instead. It sets up a background systemd service that starts on boot. See Running as a systemd Service below.
Activate Your License
nmem license activate <license-key> # Email is usually inferred from the key
nmem license status # Verify activation
nmem license renew # Refresh this device later if authorization expiresIf email inference fails, run nmem license activate <license-key> <email> explicitly.
Download the Search Index Model
nmem models download
nmem models status # Verify installationThis downloads the Search Index Model for hybrid search (~500 MB). Only needed once.
Configure the LLM Provider
A remote LLM is required on Linux (no on-device LLM support):
nmem config provider set anthropic \
--api-key sk-ant-xxx \
--model claude-sonnet-4-20250514
nmem config provider test # Verify connectionSupported providers include anthropic, openai, gemini, xai, deepseek, minimax, zai, moonshot, ollama, openrouter, and OpenAI-compatible endpoints.
See the full provider matrix and caveats: LLM Providers.
Enable Background Intelligence
nmem config settings set backgroundIntelligence true
nmem config settings set autoDailyBriefing trueVerify Everything
nmem statusRunning as a systemd Service
For production deployments, use nmem service install to set up a background systemd service that automatically starts on boot:
# Install, enable, and start
sudo nmem service install
# If you are running from a root shell or automation, set the real Linux user explicitly
sudo nmem service install --service-user <linux-user>
# Custom host/port
sudo nmem service install --host 0.0.0.0 --port 8080# No root required
nmem service install --userFor a system service, Mem should run as your normal Linux user, not as root.
If sudo cannot infer the right account, pass --service-user <linux-user>.
For a user service, run nmem service install --user directly as that user without sudo.
If you previously ran older builds as root, some files under ~/.config/co.nowledge.mem.desktop/ may still be owned by root.
In that case, license actions, provider changes, or Access Anywhere settings can fail until you fix ownership for the Linux user that runs the service.
Recent builds now show the exact path when this happens.
A typical repair looks like:
sudo chown -R <linux-user>:<linux-user> ~/.config/co.nowledge.mem.desktop
sudo chown -R <linux-user>:<linux-user> ~/.local/share/NowledgeGraphIf you use custom XDG_CONFIG_HOME or XDG_DATA_HOME, repair those locations instead.
Managing the Service
nmem service status # Show service status
nmem service logs -f # Follow service logs
nmem service stop # Stop the service
nmem service start # Start the service
nmem service uninstall # Stop, disable, and removeAdd --user to any nmem service command if you installed a user-level service.
serve vs service
nmem serve | nmem service install | |
|---|---|---|
| Runs in | Foreground (current terminal) | Background (systemd) |
| Stops when | Ctrl+C or terminal closes | nmem service stop or system shutdown |
| Starts on boot | No | Yes (auto-enabled) |
| Best for | Testing, development | Production deployments |
Data Location
All data (graph database, search index, version metadata) is stored in a single directory:
~/.local/share/NowledgeGraph/
├── nowledge_graph_v2.db/ # KuzuDB graph database
├── search_index/ # LanceDB vector + BM25 index
└── db_version.json # Schema version trackingThe server resolves this path automatically using XDG_DATA_HOME (defaults to ~/.local/share). To use a custom location, set the NOWLEDGE_DB_PATH environment variable before starting the server:
export NOWLEDGE_DB_PATH=/mnt/data/NowledgeGraph/nowledge_graph_v2.db
nmem serveUpgrading from an older version
Older versions stored data in ./data/ relative to the working directory. After upgrading, the server will
auto-detect legacy data and print migration instructions. If your data seems missing, see
Troubleshooting: Missing data after upgrade below.
Remote Access
By default, nmem serve listens on all interfaces and requires an API key for connections from other machines. The key is auto-generated on first start and printed to the console.
Once the server is reachable, connect clients through the highest-level surface they support: native integrations first, then plugin settings or nmem config, and only then direct MCP when no better dedicated path exists.
# On the server
nmem serve
# Prints: API Key: nmem_...Install the standalone CLI on remote machines:
pip install nmem-cli
# or
uv pip install nmem-cliThen configure the connection. You can use a config file (persistent) or environment variables (per-session):
{
"apiUrl": "http://your-server:14242",
"apiKey": "nmem_..."
}export NMEM_API_URL=http://your-server:14242
export NMEM_API_KEY="nmem_..."nmem status
nmem m search "query"Priority: CLI flags > env vars > config file > defaults.
Important for transcript-backed thread save
Commands like nmem t save --from claude-code, gemini-cli, or codex still read local agent session files on the client machine running that agent. Pointing nmem at a remote server changes where the normalized data is uploaded, not where session discovery happens.
To disable authentication (not recommended for production):
nmem serve --no-authSecurity
API key authentication is enabled by default for connections from other machines. Requests from the server itself do not require a key. For additional security, restrict access via firewall rules or use Access Mem Anywhere with a Cloudflare tunnel.
Interactive TUI
For an interactive terminal experience, use the TUI:
nmem tuiThe TUI provides a full settings management interface including license activation, LLM configuration, and knowledge processing toggles.
It also includes Access Anywhere controls in Settings, so you can configure Quick link / stable Cloudflare account mode directly from terminal workflows.
Full guide: Access Mem Anywhere.
If your server network blocks UDP/QUIC and Access Anywhere fails to come online, force Cloudflare transport to HTTP/2 before restarting Mem:
export TUNNEL_TRANSPORT_PROTOCOL=http2Configuration Reference
Environment Variables
| Variable | Default | Description |
|---|---|---|
NMEM_API_URL | http://127.0.0.1:14242 | Server URL for CLI commands |
NMEM_API_KEY | - | API key for authenticated requests |
NOWLEDGE_DB_PATH | Auto-detected | Override database location |
NOWLEDGE_BACKEND_HOST | 0.0.0.0 | Server bind address |
NMEM_LAN_AUTH | - | Set to disabled to skip authentication (same as --no-auth) |
CLI Commands Summary
| Command | Description |
|---|---|
nmem serve | Start the server (API key auth enabled for LAN) |
nmem serve --no-auth | Start without API key authentication |
nmem service install | Install and start as a systemd service |
nmem service status | Show systemd service status |
nmem service logs -f | Follow service logs |
nmem service stop / start | Stop or start the service |
nmem service uninstall | Remove the systemd service |
nmem status | Check server health |
nmem license activate <key> [email] | Activate license (email is usually inferred) |
nmem license renew | Refresh or renew this device authorization |
nmem models download | Download Search Index Model |
nmem config provider set <p> --api-key <k> | Configure LLM provider |
nmem config provider test | Test LLM connection |
nmem config settings | Show processing settings |
nmem config settings set <key> <value> | Update a setting |
nmem update | Check for available updates |
nmem update apply | Download and apply update |
nmem tui | Interactive terminal UI |
Troubleshooting
Missing data after upgrade
Older versions (before 0.7) stored the database in ./data/ relative to the directory you ran nmem serve from. The current version stores data in the standard location (~/.local/share/NowledgeGraph/). If your memories disappeared after upgrading, your data is likely still on disk, just in the old location.
Find your old data
Search common locations where the old database may be:
find / -name "nowledge_graph*.db" -type d 2>/dev/nullTypical locations include:
~/data/nowledge_graph.db, if you rannmem servefrom your home directory/data/nowledge_graph.db, if the systemd service ran from/(system service withoutWorkingDirectory)/path/where/you/ran/nmem/data/nowledge_graph.db, any other working directory
Move to the standard location
# Stop the server first
nmem service stop # if using systemd
# or Ctrl+C # if running in foreground
# Create the standard directory if needed
mkdir -p ~/.local/share/NowledgeGraph
# Move your database and related files
mv /old/path/data/nowledge_graph*.db* ~/.local/share/NowledgeGraph/
mv /old/path/data/search_index ~/.local/share/NowledgeGraph/ 2>/dev/null
mv /old/path/data/db_version.json ~/.local/share/NowledgeGraph/ 2>/dev/null
# Restart the server
nmem serve # or: nmem service startVerify recovery
nmem m search "test" # Search for your memories
nmem status # Check server healthStarting with the current version, nmem serve prints the database path at startup. This makes it easy to verify which location is being used. If legacy data is detected in ./data/, the server prints migration instructions automatically.
Next Steps
- CLI Reference - Complete CLI documentation
- API Reference - REST API endpoints
- Integrations - Connect with AI tools