You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,15 +21,15 @@ To configure SearXNG optimally for use with Open WebUI, follow these steps:
21
21
22
22
**Step 1: `git clone` SearXNG Docker and navigate to the folder:**
23
23
24
-
1.Create a New Directory`searxng-docker`
24
+
1.Clone the repository`searxng-docker`
25
25
26
-
Clone the searxng-docker repository. This folder will contain your SearXNG configuration files. Refer to the [SearXNG documentation](https://docs.searxng.org/) for configuration instructions.
26
+
Clone the searxng-docker repository. This will create a new directory called `searxng-docker`, which will contain your SearXNG configuration files. Refer to the [SearXNG documentation](https://docs.searxng.org/) for configuration instructions.
3. Remove the `localhost` restriction by modifying the `docker-compose.yaml` file:
70
70
71
+
If port 8080 is already in use, change `0.0.0.0:8080` to `0.0.0.0:[available port]` in the command before running it.
72
+
73
+
Run the appropriate command for your operating system:
74
+
75
+
-**Linux**
76
+
```bash
77
+
sed -i 's/127.0.0.1:8080/0.0.0.0:8080/' docker-compose.yaml
78
+
```
79
+
80
+
-**macOS**:
71
81
```bash
72
-
sed -i "s/127.0.0.1:8080/0.0.0.0:8080/"
82
+
sed -i '''s/127.0.0.1:8080/0.0.0.0:8080/' docker-compose.yaml
73
83
```
74
84
75
85
**Step 4: Grant Necessary Permissions**
76
86
77
87
4. Allow the container to create new config files by running the following command in the root directory:
78
88
79
89
```bash
80
-
sudo chmod a+rwx searxng-docker/searxng
90
+
sudo chmod a+rwx searxng
81
91
```
82
92
83
93
**Step 5: Create a Non-Restrictive `limiter.toml` File**
84
94
85
95
5. Create a non-restrictive `searxng-docker/searxng/limiter.toml` config file:
86
96
97
+
*If the file already exists, append the missing lines to it.*
98
+
87
99
<!-- markdownlint-disable-next-line MD033 -->
88
100
<details>
89
101
<!-- markdownlint-disable-next-line MD033 -->
@@ -112,172 +124,74 @@ pass_ip = []
112
124
6. Delete the default `searxng-docker/searxng/settings.yml` file if it exists, as it will be regenerated on the first launch of SearXNG:
113
125
114
126
```bash
115
-
rm searxng-docker/searxng/settings.yml
127
+
rm searxng/settings.yml
116
128
```
117
129
118
130
**Step 7: Create a Fresh `settings.yml` File**
119
131
120
-
:::note
121
-
122
-
On the first run, you must remove `cap_drop: - ALL` from the `docker-compose.yaml` file for the `searxng` service to successfully create `/etc/searxng/uwsgi`.ini. This is necessary because the `cap_drop: - ALL` directive removes all capabilities, including those required for the creation of the `uwsgi.ini` file. After the first run, you should re-add `cap_drop: - ALL` to the `docker-compose.yaml` file for security reasons.
123
-
124
-
:::
125
-
126
132
7. Bring up the container momentarily to generate a fresh settings.yml file:
127
133
134
+
If you have multiple containers running with the same name, such as caddy, redis, or searxng, you need to rename them in the docker-compose.yaml file to avoid conflicts.
135
+
128
136
```bash
129
137
docker compose up -d ; sleep 10 ; docker compose down
130
138
```
131
139
132
-
**Step 8: Add Formats and Update Port Number**
133
-
134
-
8. Add HTML and JSON formats to the `searxng-docker/searxng/settings.yml` file:
140
+
After the initial run, add `cap_drop: - ALL` to the `docker-compose.yaml` file for security reasons.
135
141
136
-
```bash
137
-
sed -i 's/formats: \[\"html\"\/]/formats: [\"html\", \"json\"]/' searxng-docker/searxng/settings.yml
138
-
```
142
+
If Open WebUI is running in the same Docker network as Searxng, you may remove the `0.0.0.0` and only specify the port mapping. In this case, Open WebUI can access Searxng directly using the container name.
139
143
140
-
Generate a secret key for your SearXNG instance:
144
+
<details>
145
+
<summary>docker-compose.yaml</summary>
141
146
142
-
```bash
143
-
sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng-docker/searxng/settings.yml
147
+
```yaml
148
+
searxng:
149
+
container_name: searxng
150
+
image: docker.io/searxng/searxng:latest
151
+
restart: unless-stopped
152
+
networks:
153
+
- searxng
154
+
ports:
155
+
- "0.0.0.0:8080:8080"# use 8080:8080 if containers are in the same Docker network
0 commit comments