this post was submitted on 08 Aug 2023
8 points (90.0% liked)

Selfhosted

61003 readers
645 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

Detailed Rules Post

  1. Be civil.

  2. No spam.

  3. Posts are to be related to self-hosting.

  4. Don't duplicate the full text of your blog or readme if you're providing a link.

  5. Submission headline should match the article title.

  6. No trolling.

  7. Promotion posts require active participation, with an account that is at least 30 days old. F/LOSS without a paywall has exceptions, with requirements. See the rules link for details. Tags [CBH] or [AIP] are required, see the links in Rule 8 for details.

  8. AI-related discussions and AI-involved promotional posts have additional requirements for tagging, as noted in Rule 7 and the AI & Promotional Post Expanded Rules post, and find example disclosures here.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 3 years ago
MODERATORS
 

Hey guys what's up, first post on Lemmy here. I tried to get a SearXNG instance to run on my home server but cannot seem to get it to work.

.env

# By default listen on https://localhost
# To change this:
# * uncomment SEARXNG_HOSTNAME, and replace  by the SearXNG hostname
# * uncomment LETSENCRYPT_EMAIL, and replace  by your email (require to create a Let's Encrypt certificate)

SEARXNG_HOSTNAME=search.xxxxx.com
# LETSENCRYPT_EMAIL=

docker-compose.yml

version: '3.7'

services:

#  caddy:
#    container_name: caddy
#    image: caddy:2-alpine
#    network_mode: host
#    volumes:
#      - ./Caddyfile:/etc/caddy/Caddyfile:ro
#      - caddy-data:/data:rw
#      - caddy-config:/config:rw
#    environment:
#      - SEARXNG_HOSTNAME=${SEARXNG_HOSTNAME:-http://localhost:80}
#      - SEARXNG_TLS=${LETSENCRYPT_EMAIL:-internal}
#    cap_drop:
#      - ALL
#    cap_add:
#      - NET_BIND_SERVICE

  redis:
    container_name: redis
    image: "redis:alpine"
    command: redis-server --save "" --appendonly "no"
    networks:
      - searxng
    tmpfs:
      - /var/lib/redis
    cap_drop:
      - ALL
    cap_add:
      - SETGID
      - SETUID
      - DAC_OVERRIDE
    restart: always

  searxng:
    container_name: searxng
    image: searxng/searxng:latest
    networks:
      - searxng
    ports:
     - "127.0.0.1:8181:8080"
    volumes:
      - ./searxng:/etc/searxng:rw
    environment:
      - SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-localhost}/
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETGID
      - SETUID
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "1"
    restart: always
networks:
  searxng:
    ipam:
      driver: default

#volumes:
#  caddy-data:
#  caddy-config:

settings.yml

# see https://docs.searxng.org/admin/engines/settings.html#use-default-settings
use_default_settings: true
server:
  # base_url is defined in the SEARXNG_BASE_URL environment variable, see .env and docker-compose.yml
  secret_key: "THE_SECRET_KEY"  # change this!
  limiter: true  # can be disabled for a private instance
  image_proxy: true
ui:
  static_use_hash: true
redis:
  url: redis://redis:6379/0

I commented out the caddy stuff in the docker-compose.yml as I have an extra instance of caddy that handles all the reverse proxy and cert stuff. Even if I run this with caddy not commented out I get the same errors.

Logs

SearXNG version 2023.8.8+b8352eca0
Create /etc/searxng/uwsgi.ini
cp: can't create '/etc/searxng/uwsgi.ini': Permission denied
sed: /etc/searxng/uwsgi.ini: No such file or directory
Use existing /etc/searxng/settings.yml
Listen on 0.0.0.0:8080
realpath() of /etc/searxng/uwsgi.ini failed: No such file or directory [core/utils.c line 3662]
SearXNG version 2023.8.8+b8352eca0
Create /etc/searxng/uwsgi.ini
cp: can't create '/etc/searxng/uwsgi.ini': Permission denied
sed: /etc/searxng/uwsgi.ini: No such file or directory
Use existing /etc/searxng/settings.yml
Listen on 0.0.0.0:8080
realpath() of /etc/searxng/uwsgi.ini failed: No such file or directory [core/utils.c line 3662]
SearXNG version 2023.8.8+b8352eca0

Any help is appreciated. This doesn't seem to be a common error out there as there is not much info on the web.

Thanks and have a good day!

you are viewing a single comment's thread
view the rest of the comments
[–] morethanevil@lmy.mymte.de 4 points 3 years ago (1 children)

There are 2 lines "cap drop"

You need to comment them out for the first start

The files are created, then remove outcommenting and restart again

You can use my docker-compose.yml

Start it and the stop it. Remove then the # on line 30 and 31. Start up again ☺️

[–] MoshpitDaddy@lemmy.world 3 points 3 years ago (1 children)

That worked, thanks a ton! :-)

[–] morethanevil@lmy.mymte.de 2 points 3 years ago

Glad it worked for you 😊