searxng

by tobi-or-not

Helm chartv0.5.2App 2026.11.13-219b63b20MITVerified publisher

Secure, plug-and-play Helm chart for SearXNG, the privacy-respecting metasearch engine, with optional Valkey for its limiter.

About this chart

searxng

Secure, plug-and-play Helm chart for SearXNG, the privacy-respecting metasearch engine, with optional Valkey for its limiter.

Kubernetes: >=1.25.0-0

Requirements

Kubernetes: >=1.25.0-0

RepositoryNameVersion
oci://registry-1.docker.io/cloudpiratesvalkey0.26.1

Overview

SearXNG is a metasearch engine: it queries many search engines and aggregates their results without tracking its users. This chart deploys it with safe defaults.

  • Plug and play: the defaults run SearXNG with its own default settings and a generated secret key; settings only holds what you change.
  • Secured: the pod meets the Pod Security restricted profile (non-root, read-only root filesystem, no privilege escalation, all capabilities dropped, seccomp, resource requests and limits) and gets no ServiceAccount token.
  • OpenShift ready: on OpenShift, the fixed user and group IDs are left to the SCC.
  • Valkey on demand: one value adds Valkey for SearXNG's limiter and bot detection.

Installing the Chart

Using Traditional Helm Repository:

helm repo add tobi https://this-is-tobi.github.io/helm-charts
helm repo update
helm install searxng tobi/searxng --namespace searxng --create-namespace

Using OCI Registry (Recommended):

helm install searxng oci://ghcr.io/this-is-tobi/charts/searxng --version 0.5.2 \
  --namespace searxng --create-namespace

ArgoCD

Argo CD renders the chart without cluster access, so the chart cannot keep a generated secret key: give it an existing Secret (see Secret key).

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: searxng
spec:
  project: default
  destination:
    server: https://kubernetes.default.svc
    namespace: searxng
  sources:
  - repoURL: ghcr.io/this-is-tobi/charts
    chart: searxng
    targetRevision: 0.5.2
    helm:
      releaseName: searxng
      values: |
        secret:
          existingSecret: searxng-secret

Exposing SearXNG

Through an Ingress or a Gateway API HTTPRoute; set settings.server.base_url to the public URL in both cases.

ingress:
  enabled: true
  className: nginx
  hosts:
  - name: search.example.com
    paths:
    - path: /
  tls:
  - secretName: search-example-com-tls
    hosts:
    - search.example.com
# or
httpRoute:
  enabled: true
  parentRefs:
  - name: gateway
    namespace: gateway-system
  hostnames:
  - search.example.com

Settings

settings is rendered to /etc/searxng/settings.yml with use_default_settings: true: SearXNG loads its own defaults first and applies yours on top, so only set what differs. See the settings reference.

settings:
  general:
    instance_name: My search
  search:
    # Clients such as Open WebUI query SearXNG for JSON results.
    formats:
    - html
    - json
  server:
    base_url: https://search.example.com/

To keep or remove some of SearXNG's default engines, give use_default_settings SearXNG's map form (engines you define under engines are added to the ones kept):

settings:
  use_default_settings:
    engines:
      keep_only:
      - duckduckgo
      - wikipedia

Other configuration files (limiter.toml, favicons.toml, ...) go under extraConfigFiles, by file name; they are mounted next to settings.yml. The root filesystem is read-only and /tmp is the only writable path: keep cache files there (favicons.toml's db_url defaults to /tmp/faviconcache.db), or mount a volume with extraVolumes and extraVolumeMounts.

Secrets in the settings

SearXNG reads only a few settings from its environment (the secret key among them) and cannot include a second file, so a secret value such as the metrics password (general.open_metrics) or a proxy's credentials would otherwise sit in settings, in git and in the ConfigMap. settingsFromSecrets takes it from a Secret key instead, by dotted path:

settingsFromSecrets:
- path: general.open_metrics
  name: searxng-metrics
  key: password

An init container (the SearXNG image) writes the final settings.yml, with the Secret values read from its environment, to an in-memory volume that SearXNG mounts at /etc/searxng; extraConfigFiles are copied next to it. A path cannot also be set in settings, and it addresses keys of nested maps only (not an item of a list such as engines). The Secret is read when the pod starts: restart the Deployment after rotating it.

Secret key

SearXNG signs its sessions and image proxy URLs and encrypts its cache with server.secret_key, so every replica needs the same key and it must not change. The chart passes it in the SEARXNG_SECRET environment variable, from:

  • a Secret the chart creates with a random key, reused on every upgrade (Helm reads it back from the cluster);
  • or secret.existingSecret (key secret.key), required for tools that render without cluster access such as Argo CD, which would otherwise get a new key on every render.
kubectl -n searxng create secret generic searxng-secret --from-literal=secret-key="$(openssl rand -hex 32)"

Metrics

SearXNG serves Prometheus metrics on /metrics when settings.general.open_metrics holds a password, checked with HTTP basic auth (any username). SearXNG only reads it from its settings: set it from a Secret with settingsFromSecrets (see above), or it ends up in the chart's ConfigMap. serviceMonitor scrapes it with the Prometheus Operator, the password coming from the same Secret:

settingsFromSecrets:
- path: general.open_metrics
  name: searxng-metrics
  key: password
serviceMonitor:
  enabled: true
  basicAuth:
    username:
      name: searxng-metrics
      key: username
    password:
      name: searxng-metrics
      key: password

Valkey and the limiter

With valkey.enabled, the chart deploys Valkey (password authentication on, no volume) and points SearXNG at it with SEARXNG_VALKEY_URL, built from the Valkey service and the password of its Secret. SearXNG uses it for its bot detection and its limiter, and connects to it once, at startup: a wait-for-valkey init container holds SearXNG until Valkey answers.

The subchart generates the password and keeps it across upgrades. Tools that render without cluster access (Argo CD) would generate a new one on every render: give them an existing Secret with valkey.auth.existingSecret (key valkey.auth.existingSecretPasswordKey), whose password must stay URL-safe.

The limiter stays off until settings.server.limiter: true. It then answers 429 to the requests its bot detection does not trust, which includes clients calling SearXNG directly (an Open WebUI web search, for instance): keep it off for those. Behind an ingress, list the ingress controller's addresses in botdetection.trusted_proxies (extraConfigFiles."limiter.toml"), so that SearXNG takes the client address from X-Forwarded-For instead of limiting every user as the ingress.

valkey:
  enabled: true
settings:
  server:
    limiter: true
extraConfigFiles:
  limiter.toml: |
    [botdetection]
    # The ingress controller's pod network.
    trusted_proxies = ["10.42.0.0/16"]

OpenShift

OpenShift's restricted SCCs assign the user, group and fsGroup from the namespace's range and reject pods that set others. With global.compatibility.openshift.adaptSecurityContext: auto (the default), the chart drops runAsUser, runAsGroup and fsGroup from its security contexts when the cluster serves security.openshift.io/v1; force drops them anywhere (for platforms that inject IDs the same way), disabled keeps them. SearXNG runs with any UID and GID 0: it only writes to its /tmp emptyDir. The valkey subchart adapts itself when it detects OpenShift (route.openshift.io/v1); with force elsewhere, also set valkey.targetPlatform: openshift.

Values

KeyTypeDefaultDescription
affinityobject{}Affinity.
autoscaling.enabledboolfalseScale SearXNG with a HorizontalPodAutoscaler (needs a metrics server).
autoscaling.maxReplicasint3Maximum replicas.
autoscaling.minReplicasint1Minimum replicas.
autoscaling.targetCPUUtilizationPercentageint80Average CPU utilization target, in percent of the CPU request.
autoscaling.targetMemoryUtilizationPercentagestring""Average memory utilization target, in percent of the memory request. Empty by default: an idle worker already sits near its request.
envlist[]Extra SearXNG environment variables.
envFromlist[]Extra SearXNG environment variables from ConfigMaps or Secrets.
extraConfigFilesobject{}Extra files rendered next to settings.yml in /etc/searxng, by file name (e.g. limiter.toml, favicons.toml).
extraObjectslist[]Extra objects to deploy with the release (rendered with tpl).
extraVolumeMountslist[]Extra volume mounts of the SearXNG container.
extraVolumeslist[]Extra volumes.
fullnameOverridestring""Override the full resource name (release-name + chart-name).
global.compatibility.openshift.adaptSecurityContextstring"auto"Drop runAsUser, runAsGroup and fsGroup from the security contexts so that OpenShift's SCC assigns them from the namespace range (it rejects pods that set others): auto when the cluster serves security.openshift.io/v1, force always, disabled never. The valkey subchart adapts itself when it detects OpenShift (route.openshift.io/v1); with force elsewhere, also set valkey.targetPlatform: openshift.
httpRoute.annotationsobject{}HTTPRoute annotations.
httpRoute.enabledboolfalseExpose SearXNG through a Gateway API HTTPRoute (needs the gateway.networking.k8s.io CRDs).
httpRoute.hostnameslist[]Hostnames the HTTPRoute matches.
httpRoute.labelsobject{}HTTPRoute labels.
httpRoute.parentRefslist[]Gateways (and listeners) the HTTPRoute attaches to. Required.
httpRoute.ruleslist[]Routing rules (matches, filters), all sent to SearXNG. Empty routes everything to it.
image.digeststring""SearXNG image digest (sha256:...). Takes precedence over the tag.
image.pullPolicystring"IfNotPresent"SearXNG image pull policy.
image.registrystring"docker.io"SearXNG image registry.
image.repositorystring"searxng/searxng"SearXNG image repository.
image.tagstring""SearXNG image tag. Defaults to the chart appVersion.
imagePullSecretslist[]Image pull secrets.
ingress.annotationsobject{}Ingress annotations.
ingress.classNamestring""Ingress class.
ingress.enabledboolfalseExpose SearXNG through an Ingress.
ingress.hostslist[{"name":"searxng.local","paths":[{"path":"/","pathType":"Prefix"}]}]Hosts and paths routed to SearXNG.
ingress.labelsobject{}Ingress labels.
ingress.tlslist[]Ingress TLS (secretName and hosts).
livenessProbeobject{"failureThreshold":3,"httpGet":{"path":"/healthz","port":"http"},"periodSeconds":20,"timeoutSeconds":5}Liveness probe.
nameOverridestring""Override the chart name (used in resource naming).
nodeSelectorobject{}Node selector.
pdb.enabledboolfalseCreate a PodDisruptionBudget.
pdb.maxUnavailableint1Pods that may be unavailable during voluntary disruptions (number or percentage).
pdb.minAvailablestring""Pods that must stay available during voluntary disruptions (number or percentage). Exclusive with maxUnavailable: set that one to null to use it. With a single replica, 1 blocks node drains.
podAnnotationsobject{}Pod annotations.
podLabelsobject{}Pod labels.
podSecurityContextobject{"fsGroup":977,"runAsGroup":977,"runAsNonRoot":true,"runAsUser":977,"seccompProfile":{"type":"RuntimeDefault"}}Pod security context (Pod Security restricted). 977 is the image's searxng user.
priorityClassNamestring""Priority class.
readinessProbeobject{"httpGet":{"path":"/healthz","port":"http"},"periodSeconds":10,"timeoutSeconds":5}Readiness probe. /healthz goes through SearXNG's request setup, so a broken configuration fails it, without rendering a page.
replicaCountint1SearXNG replicas (ignored with autoscaling.enabled). They all share the secret key below.
resourcesobject{"limits":{"cpu":"1","memory":"512Mi"},"requests":{"cpu":"50m","memory":"160Mi"}}Resources. One SearXNG worker uses about 130Mi once warm.
secret.existingSecretstring""Existing Secret holding the SearXNG secret key (server.secret_key). When empty, the chart creates one with a random key and keeps it across upgrades. Tools that render without cluster access (Argo CD) would generate a new key on every render: give them an existing Secret.
secret.keystring"secret-key"Key of the secret key in the Secret.
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true}Container security context (Pod Security restricted, read-only root filesyste

Deploy searxng with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has searxng on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartsearxng is pinned at v0.5.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply