Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:ARCANGEL0 EVA setup local searxng

From Leeroopedia
Knowledge Sources
Domains Containers, Infrastructure, Self_Hosting
Last Updated 2026-10-29 14:00 GMT

Overview

Concrete tool for deploying a loopback-only SearXNG Docker container with private settings, image pulling, and readiness probing, provided by the Mitsu SearXNG service module.

Description

The setup_local_searxng function creates and starts a SearXNG container:

  1. Port validation: Validates the port is between 1024 and 65535, and checks it's not already in use.
  2. Docker runtime check: Calls `_runtime()` to verify Docker is available and the daemon is running.
  3. Container state check: If the container already exists: starts it if stopped, or probes it if running. If new: creates a config volume with private settings (JSON API enabled, limiter disabled, random secret_key).

4 Image pull: Pulls the SearXNG image from GHCR or Docker Hub via `_ensure_image`. 5 Container creation: Runs a detached container published on `127.0.0.1:port:8080` with the config volume mounted. 6 Readiness probing: Polls the JSON search endpoint for up to 75 seconds (1.5s intervals). On failure, stops the container and raises `SearXNGSetupError`.

Returns a dict with base_url, port, managed_local=True, container_name, container_runtime.

Usage

  • Search engine configuration: Called from the `SearchEnginePanel` when the operator sets up SearXNG.
  • Onboarding: Called during first-run setup if the operator chooses SearXNG.

Code Reference

Source Location

  • Repository: Mitsu
  • File: services/searxng.py

Signature

def setup_local_searxng(
    port_value: str,
    progress: Progress | None = None,
) -> dict[str, str | int | bool]:

Import

from mitsu.services.searxng import setup_local_searxng

I/O Contract

Inputs

Name Type Required Description
port_value str Yes TCP port number (1024-65535)
progress None No Callback for status messages

Outputs

Name Type Description
returns int | bool] {base_url, port, managed_local, container_name, container_runtime}

Usage Examples

Set Up SearXNG

from mitsu.services.searxng import setup_local_searxng

def report(message):
    print(message)

result = setup_local_searxng("8888", progress=report)
print(f"SearXNG ready at: {result['base_url']}")
print(f"Container: {result['container_name']}")

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment