Compare commits

...

52 Commits

Author SHA1 Message Date
Ivan Gabaldon
2138c5d13d Deprecation notice
Templates moved to https://github.com/searxng/searxng/tree/master/container
Documentation moved to https://docs.searxng.org/admin/installation-docker.html
2026-03-28 20:09:29 +01:00
ArnoldCordewiner
0c7875a429 Remove the "version" attribute (#429) 2025-09-21 21:40:14 +02:00
Markus Heiser
c33905f78a Merge pull request #425 from searxng/revert-424-mod-caddy-csp
Revert "[mod] caddy: update csp"
2025-08-21 13:24:33 +02:00
Markus Heiser
cf2444a5ef Revert "[mod] caddy: update csp (#424)"
This reverts commit bc0cfa3d28.
2025-08-21 13:23:57 +02:00
Ivan Gabaldon
bc0cfa3d28 [mod] caddy: update csp (#424)
Since https://github.com/searxng/searxng/pull/5073 we add a script directly to the [`base.html`](https://github.com/searxng/searxng/blob/master/searx/templates/simple/base.html), we need `'unsafe-inline'`.
2025-08-18 21:59:55 +02:00
echo r"0xX4H" | rev
d9357aca09 [enh] add HSTS header (#419) 2025-08-15 16:31:02 +02:00
Ivan Gabaldon
649d7509c9 [fix] container: move references (#417) 2025-08-07 12:37:32 +02:00
Ivan Gabaldon
8de6ea65ab [fix] container: remove static hashing (#410)
* [fix] container: remove static hashing

Allows browser cache heuristics to properly work.

Related https://github.com/searxng/searxng/pull/5006
Closes https://github.com/searxng/searxng-docker/issues/409

* [fix] container: don't revalidate at every request

As Granian no longer handles static files directly, the whole process goes through Flask, which apart from being slow, is resource intensive, even to serve HTTP 304 responses.
2025-07-19 10:19:17 +02:00
Ivan Gabaldon
b0107a0801 [fix] container: dangling Dockerfile reference (#407)
Closes https://github.com/searxng/searxng-docker/issues/403
2025-07-10 21:30:05 +02:00
Ivan Gabaldon
8b75609524 [mod] container: replace uWSGI with Granian (#395)
To sync with https://github.com/searxng/searxng/pull/4820
2025-07-04 14:35:43 +02:00
Ivan Gabaldon
fc51db2367 [fix] container: missing data volume (#399)
Synced from a76ccba9c5/container/base.yml (L54)
2025-06-28 08:59:38 +02:00
ItsNiceCraft
8fe0b98ced docs: remove security cap note (#398) 2025-06-23 21:47:34 +02:00
Ivan Gabaldon
8c006d702f [fix] caddy: revise csp header (#397)
Relaxes some policies, there are obsolete options that are not currently in use that have been removed as well.

Closes https://github.com/searxng/searxng-docker/issues/371
Closes https://github.com/searxng/searxng-docker/issues/177
Closes https://github.com/searxng/searxng/issues/4304
2025-06-14 16:17:08 +02:00
Ivan Gabaldon
6022367de4 [mod] caddy: trusted proxies support (#396)
Early preparation for https://github.com/searxng/searxng/pull/4911
2025-06-14 15:21:40 +02:00
Émilien (perso)
6299a68922 chore: deactivate limiter by default for easier setup (#384) 2025-05-25 18:24:08 +02:00
Ivan Gabaldon
31acd45ec2 [fix] remove security cap
Fixes 749de829d5bad6a05ebe1a733a6bd942c1a386ec
2025-05-20 14:39:21 +02:00
Émilien (perso)
21bca5efa8 fix: layout about mac sed command 2025-03-06 13:32:12 +01:00
Alex Wall
4aa1d14878 Update README.md (#352)
Added Mac syntax on sed command.
2025-03-05 21:15:13 +01:00
Ivan Gabaldon
9adeb8a6f2 revert setting env on Caddyfile (#341) 2025-02-15 21:21:43 +01:00
Ivan Gabaldon
5fc00a3285 Rework Caddyfile (#255)
* rework Caddyfile

* fix missing "public" directive

* features cleanup

Since this header is attached to each outgoing request the overall size is slightly increased by 300 bytes, we don't care if the site is allowed to play media in the background, so with the vast majority of features that have been added (and those that were already present)

* restore encode directive

Caddyserver actually did passthrough the precompressed resources served by uWSGI (Oops)

* merge upstream changes

* fix typo

---------

Co-authored-by: Émilien (perso) <4016501+unixfox@users.noreply.github.com>
2025-02-14 10:27:41 +01:00
(root@itachi)-[~]
a899b72a50 Updated version of "Start SearXNG with systemd"
* Update: grammatical correctness in README.md

* Update:  grammatical accuracy on README.md

* Update: enhance readability and include proper syntax highlighting for the commands under "Start SearXNG with systemd" in README.md

Update: enhance readability and include proper syntax highlighting for the commands under "Start SearXNG with systemd" in README.md

Update README.md

Update README.md

Update README.md

Update: enhance readability and included proper syntax highlighting for the commands under "Start SearXNG with systemd" in README.md

Update: Space Fix!

Update: Space Fixing in cp command
2025-01-03 15:15:03 +01:00
(root@itachi)-[~]
271ba86644 Update: grammatical correctness in README.md (#315)
* Update: grammatical correctness in README.md

* Update:  grammatical accuracy on README.md
2025-01-03 10:33:54 +01:00
Markus Heiser
849975b3fd Merge pull request #293 from 0fficersally/0fficersally
Update `valkey:7-alpine` to `valkey:8-alpine` in `README.md`
2024-10-29 18:17:31 +01:00
Lysander Fontyn
65fa0f9cb6 Update valkey:7-alpine to valkey:8-alpine in README.md
This will update `valkey:7-alpine` to `valkey:8-alpine` in `README.md`, as it has not been updated yet. This is a follow-up on commit 61745b3bf1.
2024-10-29 18:00:07 +01:00
Bnyro
72cb934126 [refactor] readme: add hosting instructions for bringing own reverse proxy 2024-10-06 11:56:21 +02:00
Bnyro
f2b9efe33e feat: uwsgi workers / threads configuration options (#235) 2024-10-04 11:25:44 +02:00
stoXe
0667030a42 Explain required cap_drop removal on first run (#258)
Add instructions to the `README.md` for removing `cap_drop: - ALL` on the first run.

* **Explanation**: Add a note explaining that `cap_drop: - ALL` must be removed from the `docker-compose.yaml` file for the `searxng` service to successfully create `/etc/searxng/uwsgi.ini`.
* **Reason**: Explain that the `cap_drop: - ALL` directive removes all capabilities, including those required for the creation of the `uwsgi.ini` file.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/IAmStoxe/searxng-docker?shareId=XXXX-XXXX-XXXX-XXXX).
2024-10-04 11:24:33 +02:00
Ivan Gabaldon
61745b3bf1 Update to Valkey 8 (#273) 2024-09-22 18:41:39 +02:00
Ivan Gabaldon
35525c664b remove note about ARMv7 (#253) 2024-08-04 00:34:26 +02:00
Marco Perini
de09409572 docs(secret): add powershell script to generate secret (#249) 2024-08-01 12:22:08 +02:00
Markus Heiser
206682d230 Merge pull request #245 from jiangying000/patch-1
fix limiter.toml url
2024-07-13 07:53:59 +02:00
jiangying
157b0a3fb9 fix limiter.toml url 2024-07-13 13:32:31 +08:00
Émilien (perso)
fc4327cd50 note about armv7 2024-06-09 08:03:46 +00:00
Ivan Gabaldon
63f06f5db3 Replace with official Valkey image (#234)
* replace with official image

* use `7-alpine` tag

* prevent collision with other volumes

* Revert editing README formatting

---------

Co-authored-by: Émilien (perso) <4016501+unixfox@users.noreply.github.com>
2024-06-02 21:47:14 +02:00
Émilien (perso)
8546bf599b Add automatic restart of the services
close https://github.com/searxng/searxng-docker/pull/106
2024-05-13 15:43:18 +02:00
Ivan Gabaldon
a0e711191e Replace Redis with Valkey + reduce logging for containers caddy and redis (#230)
* replace redis w/valkey

* cleanup

* apply changes

* revert volume reuse

* fix valkey container

* revert remove `CAP_DROP` `CAP_ADD`

* revert switch from `redis` to `valkey`

* revert revert volume reuse

* update README

* apply changes

* add back useful stuff from README + keep structure + keep compat old docker compose

---------

Co-authored-by: Emilien Devos <4016501+unixfox@users.noreply.github.com>
2024-05-13 15:39:28 +02:00
Lemonade
83447b9435 Fixed searxng-docker.service.template issue (#225) 2024-04-17 14:02:09 +02:00
iacore
8e3220be09 Add docker.io prefix to container image names (#221)
Co-authored-by: iacore <noreply+gpg-stub@1a-insec.net>
2024-02-29 14:19:37 +01:00
Nicolas Bonduel
3ec746a2b4 Update README to use newer docker compose command (#205)
* Update README to use newer docker compose command

* Update README to add note about docker < 3.6.0 and docker-compose

* Update the docker compose install url
2024-01-08 21:45:10 +00:00
Ivan Gabaldon
6813aff4d4 allow persistent rdb (#198)
Signed-off-by: Inetol <igabaldon@inetol.net>
2023-11-28 18:35:40 +01:00
Émilien (perso)
47fad9cba6 remove duplicated limiter parameter 2023-10-25 10:44:24 +02:00
Émilien (perso)
d63d0c77a8 Simply the update process 2023-09-24 09:39:54 +00:00
Émilien (perso)
fa11493d8a update instructions for update docker-compose 2023-09-24 09:38:50 +00:00
Alexandre Flament
41ca45c87f Merge pull request #182 from dalf/enable_limiter
Enable limiter by default
2023-09-22 20:35:01 +02:00
Alexandre Flament
69eb81f031 Enable limiter by default
Related to https://github.com/searxng/searxng/pull/2832
2023-09-22 16:25:27 +00:00
Alexandre Flament
070b02e6da fix URL to documentation in searxng/settings.yml
Close #173
2023-08-25 08:11:09 +02:00
Alexandre Flament
9e42027c31 Merge pull request #162 from ChillyKitty/patch-1
Update Caddyfile to Add X-Real-IP to fix bot detection
2023-08-25 07:54:53 +02:00
ChillyKitty
8b2d017136 Update Caddyfile to Add X-Real-IP to fix bot detection
Bot detection complains about not having X-Real-IP which is required https://docs.searxng.org/src/searx.botdetection.html#id4 this adds the header and fixes the problem for me.
2023-06-20 02:45:04 +00:00
Alexandre Flament
e76656a162 Merge pull request #110 from searxng/dac_override
docker-compose.yaml: remove CAP_DAC_OVERRIDE
2022-12-31 18:35:37 +01:00
Alexandre Flament
12d726f4ff docker-compose.yaml: remove CAP_DAC_OVERRIDE
Close #30
2022-12-31 00:28:19 +00:00
Alexandre Flament
d4f06df911 Merge pull request #77 from searxng/remove_security_yml
Delete security.yml
2022-09-01 18:48:52 +02:00
Alexandre Flament
09742281df Delete security.yml
See https://github.com/searxng/searxng/pull/1730
2022-08-31 20:44:15 +02:00
8 changed files with 7 additions and 306 deletions

7
.env
View File

@@ -1,7 +0,0 @@
# By default listen on https://localhost
# To change this:
# * uncomment SEARXNG_HOSTNAME, and replace <host> by the SearXNG hostname
# * uncomment LETSENCRYPT_EMAIL, and replace <email> by your email (require to create a Let's Encrypt certificate)
# SEARXNG_HOSTNAME=<host>
# LETSENCRYPT_EMAIL=<email>

View File

@@ -1,27 +0,0 @@
name: "Security checks"
on:
schedule:
- cron: "05 06 * * *"
workflow_dispatch:
jobs:
dockers:
name: Trivy ${{ matrix.image }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
image: ["searxng/searxng", "dalf/filtron", "dalf/morty"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: '${{ matrix.image }}:latest'
format: 'table'
exit-code: '1'
ignore-unfixed: false
vuln-type: 'os,library'
severity: 'UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL'

6
.gitignore vendored
View File

@@ -1,6 +0,0 @@
*~
searxng-docker.service
caddy
srv
searxng/uwsgi.ini

View File

@@ -1,98 +0,0 @@
{
admin off
}
{$SEARXNG_HOSTNAME} {
log {
output discard
}
tls {$SEARXNG_TLS}
@api {
path /config
path /healthz
path /stats/errors
path /stats/checker
}
@static {
path /static/*
}
@notstatic {
not path /static/*
}
@imageproxy {
path /image_proxy
}
@notimageproxy {
not path /image_proxy
}
header {
# Enable HTTP Strict Transport Security (HSTS) to force clients to always connect via HTTPS
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Prevent some browsers from MIME-sniffing a response away from the declared Content-Type
X-Content-Type-Options "nosniff"
# Disable some features
Permissions-Policy "accelerometer=(),ambient-light-sensor=(),autoplay=(),camera=(),encrypted-media=(),focus-without-user-activation=(),geolocation=(),gyroscope=(),magnetometer=(),microphone=(),midi=(),payment=(),picture-in-picture=(),speaker=(),sync-xhr=(),usb=(),vr=()"
# Disable some features (legacy)
Feature-Policy "accelerometer 'none';ambient-light-sensor 'none'; autoplay 'none';camera 'none';encrypted-media 'none';focus-without-user-activation 'none'; geolocation 'none';gyroscope 'none';magnetometer 'none';microphone 'none';midi 'none';payment 'none';picture-in-picture 'none'; speaker 'none';sync-xhr 'none';usb 'none';vr 'none'"
# Referer
Referrer-Policy "no-referrer"
# X-Robots-Tag
X-Robots-Tag "noindex, noarchive, nofollow"
# Remove Server header
-Server
}
header @api {
Access-Control-Allow-Methods "GET, OPTIONS"
Access-Control-Allow-Origin "*"
}
# Cache
header @static {
# Cache
Cache-Control "public, max-age=31536000"
defer
}
header @notstatic {
# No Cache
Cache-Control "no-cache, no-store"
Pragma "no-cache"
}
# CSP (see http://content-security-policy.com/ )
header @imageproxy {
Content-Security-Policy "default-src 'none'; img-src 'self' data:"
}
header @notimageproxy {
Content-Security-Policy "upgrade-insecure-requests; default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; form-action 'self' https://github.com/searxng/searxng/issues/new; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self' https://overpass-api.de; img-src 'self' data: https://*.tile.openstreetmap.org; frame-src https://www.youtube-nocookie.com https://player.vimeo.com https://www.dailymotion.com https://www.deezer.com https://www.mixcloud.com https://w.soundcloud.com https://embed.spotify.com"
}
# SearXNG
handle {
encode zstd gzip
reverse_proxy localhost:8080 {
header_up X-Forwarded-Port {http.request.port}
header_up X-Forwarded-Proto {http.request.scheme}
}
}
}

View File

@@ -1,75 +1,8 @@
# searxng-docker > [!WARNING]
> *searxng-docker* repository is superseded.
>
> For [**NEW installations**](https://docs.searxng.org/admin/installation-docker.html#compose-instancing)
>
> For [**EXISTING installations**](https://docs.searxng.org/admin/installation-docker.html#migrate-from-searxng-docker)
Create a new SearXNG instance in five minutes using Docker Continue to [*searxng-docker*](https://github.com/searxng/searxng-docker/tree/0c7875a42942e916ab39b171d69cab7d170ddb60) (deprecated)
## What is included ?
| Name | Description | Docker image | Dockerfile |
| -- | -- | -- | -- |
| [Caddy](https://github.com/caddyserver/caddy) | Reverse proxy (create a LetsEncrypt certificate automatically) | [caddy/caddy:2-alpine](https://hub.docker.com/_/caddy) | [Dockerfile](https://github.com/caddyserver/caddy-docker) |
| [SearXNG](https://github.com/searxng/searxng) | SearXNG by itself | [searxng/searxng:latest](https://hub.docker.com/r/searxng/searxng) | [Dockerfile](https://github.com/searxng/searxng/blob/master/Dockerfile) |
| [Redis](https://github.com/redis/redis) | In-memory database | [redis:alpine](https://hub.docker.com/_/redis) | [Dockerfile-alpine.template](https://github.com/docker-library/redis/blob/master/Dockerfile-alpine.template) |
## How to use it
- [Install docker](https://docs.docker.com/install/)
- [Install docker-compose](https://docs.docker.com/compose/install/) (be sure that docker-compose version is at least 1.9.0)
- Get searxng-docker
```sh
cd /usr/local
git clone https://github.com/searxng/searxng-docker.git
cd searxng-docker
```
- Edit the [.env](https://github.com/searxng/searxng-docker/blob/master/.env) file to set the hostname and an email
- Generate the secret key ```sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml```
- Edit the [searxng/settings.yml](https://github.com/searxng/searxng-docker/blob/master/searxng/settings.yml) file according to your need
- Check everything is working: ```docker-compose up```
- Run SearXNG in the background: ```docker-compose up -d```
## How to access the logs
To access the logs from all the containers use: `docker-compose logs -f`.
To access the logs of one specific container:
- Caddy: `docker-compose logs -f caddy`
- SearXNG: `docker-compose logs -f searxng`
- Redis: `docker-compose logs -f redis`
### Start SearXNG with systemd
You can skip this step if you don't use systemd.
- ```cp searxng-docker.service.template searxng-docker.service```
- edit the content of ```WorkingDirectory``` in the ```searxng-docker.service``` file (only if the installation path is different from /usr/local/searxng-docker)
- Install the systemd unit:
```sh
systemctl enable $(pwd)/searxng-docker.service
systemctl start searxng-docker.service
```
## Note on the image proxy feature
The SearXNG image proxy is activated by default.
The default [Content-Security-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) allow the browser to access to ```${SEARXNG_HOSTNAME}``` and ```https://*.tile.openstreetmap.org;```.
If some users wants to disable the image proxy, you have to modify [./Caddyfile](https://github.com/searxng/searxng-docker/blob/master/Caddyfile). Replace the ```img-src 'self' data: https://*.tile.openstreetmap.org;``` by ```img-src * data:;```.
## Multi Architecture Docker images
Supported architecture:
- amd64
- arm64
- arm/v7
## How to update ?
To update the SearXNG stack:
```sh
docker-compose pull
docker-compose down
docker-compose up
```
To update this `docker-compose.yml` file:
Check out the newest version on github: [searxng/searxng-docker](https://github.com/searxng/searxng-docker).

View File

@@ -1,67 +0,0 @@
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
- DAC_OVERRIDE
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
searxng:
container_name: searxng
image: searxng/searxng:latest
networks:
- searxng
ports:
- "127.0.0.1:8080:8080"
volumes:
- ./searxng:/etc/searxng:rw
environment:
- SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-localhost}/
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
- DAC_OVERRIDE
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "1"
networks:
searxng:
ipam:
driver: default
volumes:
caddy-data:
caddy-config:

View File

@@ -1,16 +0,0 @@
[Unit]
Description=SearXNG service
Requires=docker.service
After=docker.service
[Service]
Restart=on-failure
Environment=SEARXNG_DOCKERCOMPOSEFILE=docker-compose.yaml
WorkingDirectory=/usr/local/searxng-docker
ExecStart=/usr/local/bin/docker-compose -f ${SEARXNG_DOCKERCOMPOSEFILE} up --remove-orphans
ExecStop=/usr/local/bin/docker-compose -f ${SEARXNG_DOCKERCOMPOSEFILE} down
[Install]
WantedBy=multi-user.target

View File

@@ -1,11 +0,0 @@
# 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: "ultrasecretkey" # 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