11---
22layout : post
33title : How to run SearXNG with Docker
4- date : 2026-05-10 14:46:44
4+ date : 2026-05-10 15:22:16
55excerpt : How to install and run SearXNG with Docker.
6- categories : searxng docker
6+ categories : searxng docker bash
77---
88
99This post goes over how to install and run [ SearXNG] ( https://github.com/searxng/searxng ) with [ Docker] ( https://www.docker.com/ ) .
@@ -30,15 +30,59 @@ Start a new container:
3030docker run -d --name searxng -p 8080:8080 searxng/searxng
3131```
3232
33- Then open in your browser:
33+ Open in your browser:
3434
3535``` sh
3636open http://localhost:8080
3737```
3838
39+ When requesting JSON, you will receive ` 403 Forbidden ` error:
40+
41+ ``` sh
42+ curl ' http://localhost:8080/search?q=test&format=json'
43+ ```
44+
45+ This is because you need to enable it in settings:
46+
47+ ``` bash
48+ SECRET_KEY=$( openssl rand -hex 32)
49+
50+ cat > settings.yml << EOF
51+ use_default_settings: true
52+
53+ server:
54+ secret_key: "$SECRET_KEY "
55+ bind_address: "0.0.0.0"
56+ port: 8080
57+
58+ search:
59+ formats:
60+ - html
61+ - json
62+ EOF
63+ ```
64+
65+ Copy ` settings.yml ` into the container:
66+
67+ ``` sh
68+ docker cp settings.yml searxng:/etc/searxng/settings.yml
69+ ```
70+
71+ Then restart the container:
72+
73+ ``` sh
74+ docker restart searxng
75+ ```
76+
77+ Check the logs that it worked:
78+
79+ ``` sh
80+ docker logs searxng --tail=100
81+ ```
82+
3983## Stop
4084
41- To stop and remove the container:
85+ Stop and remove the container:
4286
4387``` sh
4488docker rm -f searxng
0 commit comments