If it helps others this was my config. To be honest I have a weak grasp of what it actually does so there might be some security issues with it.
Apparently you can also add lemmy as a search engine. Will work on that later.
config
# docker-compose.yml
name: searxng
services:
core:
container_name: searxng-core
image: docker.io/searxng/searxng:latest
restart: always
network_mode: "service:gluetun"
volumes:
- ./core-config:/etc/searxng
- core-data:/var/cache/searxng
gluetun:
image: qmcgaw/gluetun:v3.41.3
container_name: gluetun
cap_add:
- NET_ADMIN
environment:
- VPN_SERVICE_PROVIDER=custom
- VPN_TYPE=openvpn
- OPENVPN_CUSTOM_CONFIG=/gluetun/custom.conf
ports:
- 8080:8080
restart: always
volumes:
- ./gluetun:/gluetun
devices:
- /dev/net/tun:/dev/net/tun
nginx:
container_name: nginx
image: nginx:latest
ports:
- 80:80
- 443:443
volumes:
- ./nginx:/etc/nginx/conf.d
- ./cert:/etc/nginx/cert
valkey:
container_name: searxng-valkey
image: docker.io/valkey/valkey:9-alpine
command: valkey-server --save 30 1 --loglevel warning
restart: always
volumes:
- valkey-data:/data/
volumes:
core-data:
valkey-data:
# nginx/default.conf
server {
server_name localhost;
listen 443 ssl;
ssl_certificate /etc/nginx/cert/cert.pem;
ssl_certificate_key /etc/nginx/cert/private.key;
location / {
proxy_pass http://gluetun:8080/;
proxy_set_header Host $host;
proxy_set_header Connection $http_connection;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
server {
server_name localhost;
listen 80;
location / {
return 301 https://$host$request_uri;
}
}
I run the container locally, and set up 127.0.0.1 as search engine on my browsers. It works for me, as I do not use search on mobile as much.
How much rate-limiting do you get with a VPN? Because I use SearxNG with my regular network and I tend to get a lot of my search queries fail because the search providers have CAPTCHAs after the 10th request or so for some given timespan.
All of the mainstream engines block me after a few requests too on my VPN. After a bit I’m only getting stuff from DDG and what else. Gotta add more engines.
@rounding_error I use a gluten docker container using proton VPN and route my SearXNG docker container traffic through it. Is that basically the same as using the SearXNG config to do it?
Uhm, well I don’t think there’s a searXNG config line for that. I basically just copied what my qbit container had for network_mode and made sure to expose the 8080 in gluetun instead of searXNG. Then, I had nginx point to gluetun’s container name to provide https.




