Skip to main content

install & uninstall

Set up (or remove) LynxDB as a production service. One command replaces the manual steps of creating a user, directories, config file, and systemd/launchd unit.

install

lynxdb install [flags]

System mode (root)

When run as root (or with sudo), lynxdb install performs these steps:

  1. Copies the binary to /usr/local/bin/lynxdb (or --prefix/bin)
  2. Creates a system user and group (lynxdb:lynxdb, no login shell)
  3. Creates directories -- /var/lib/lynxdb (data), /etc/lynxdb (config)
  4. Writes a default config to /etc/lynxdb/config.yaml (skipped if file exists)
  5. Sets file descriptor limits -- writes a /etc/security/limits.d/lynxdb.conf with nofile=65536
  6. Grants CAP_NET_BIND_SERVICE so the service can bind to ports below 1024 without running as root
  7. Installs a hardened systemd service (lynxdb.service) with ProtectSystem=strict, ProtectHome=true, NoNewPrivileges=true, PrivateTmp=true, and ReadWritePaths=/var/lib/lynxdb
  8. Runs a self-test -- starts the server briefly and verifies the health endpoint responds

All steps are idempotent. Re-running lynxdb install after an upgrade refreshes the binary and service file without touching your config or data.

User mode (non-root)

When run without root, LynxDB installs into the current user's home directory:

ResourcePath
Binary~/.local/bin/lynxdb
Config~/.config/lynxdb/config.yaml
Data~/.local/share/lynxdb
Service~/.config/systemd/user/lynxdb.service (Linux) or ~/Library/LaunchAgents/org.lynxdb.plist (macOS)

Flags

FlagDefaultDescription
--yesfalseSkip confirmation prompt (non-interactive)
--userlynxdbSystem user to create (system mode only)
--grouplynxdbSystem group to create (system mode only)
--data-dir/var/lib/lynxdbOverride the data directory
--prefix/usr/localInstallation prefix (binary goes to PREFIX/bin)
--skip-servicefalseDo not create a systemd/launchd service unit
--skip-configfalseDo not write a default config file
--skip-capabilitiesfalseDo not set CAP_NET_BIND_SERVICE
--skip-ulimitsfalseDo not write file descriptor limits config
--skip-self-testfalseDo not run the post-install health check

Examples

# Standard system install (interactive -- prompts for confirmation)
sudo lynxdb install

# Non-interactive (CI/CD, automation scripts)
sudo lynxdb install --yes

# Custom data directory
sudo lynxdb install --data-dir /data/lynxdb

# User-local install (no root required)
lynxdb install

# Install binary and config only, no systemd unit
sudo lynxdb install --skip-service

# Custom prefix (e.g., /opt/lynxdb)
sudo lynxdb install --prefix /opt/lynxdb

After installation

# Start the service
sudo systemctl start lynxdb

# Enable on boot
sudo systemctl enable lynxdb

# Verify
lynxdb health
lynxdb status

uninstall

lynxdb uninstall [flags]

Removes the systemd/launchd service, binary, config, and related system files. Data is never removed -- your /var/lib/lynxdb (or custom data directory) is always preserved.

What gets removed

ResourceStandardWith --purge
systemd / launchd serviceStopped and removedStopped and removed
Binary (/usr/local/bin/lynxdb)RemovedRemoved
Limits config (/etc/security/limits.d/lynxdb.conf)RemovedRemoved
Config directory (/etc/lynxdb/)PreservedRemoved
System user (lynxdb)PreservedRemoved
Data directory (/var/lib/lynxdb/)PreservedPreserved

Flags

FlagDefaultDescription
--yesfalseSkip confirmation prompt
--purgefalseAlso remove config directory and system user (data is still preserved)

Examples

# Standard uninstall (prompts for confirmation)
sudo lynxdb uninstall

# Non-interactive
sudo lynxdb uninstall --yes

# Remove everything except data
sudo lynxdb uninstall --purge

After uninstalling, your data directory remains intact. To remove data manually:

sudo rm -rf /var/lib/lynxdb

See Also