Table of Contents
Updating and Installing SearXNG Docker Instance
This page provides detailed instructions on how to update or install your SearXNG instance using Docker. The installation directory is set in this example as `/data1/searxng-docker/`.
Steps to Update SearXNG
Follow the steps below to update your SearXNG instance to the latest version.
1. Navigate to the Installation Directory
First, open your terminal and navigate to the directory where your SearXNG instance is installed.
cd /data1/searxng-docker/
2. Pull the Latest Docker Images
Use the `docker-compose pull` command to download the latest version of the Docker images defined in your `docker-compose.yml` file.
docker-compose pull
This command fetches the most recent versions of the SearXNG Docker images available.
3. Restart the Containers with the New Version
After downloading the new images, restart the containers to apply the updates. Run the following command to bring the updated version into effect:
docker-compose up -d
This will recreate and restart the containers with the latest versions of the images.
4. Verify the Update
To ensure that the update was successful, visit your running SearXNG instance in a web browser. You can also list the currently running containers with:
docker container ls
Check that the SearXNG container is running and that it is indeed using the latest image.
5. (Optional) Clean Up Unused Containers
If any old containers are still in place and no longer needed, you might want to clean them up. You can remove unnecessary containers with the following command:
docker container prune
This command removes all stopped containers and frees up space.
Steps to Install SearXNG
If you don't have SearXNG installed yet, follow the steps below for a fresh installation:
1. Install Docker
Make sure Docker is installed on your system. If Docker is not installed, follow the official Docker documentation to set it up.
2. Clone the SearXNG Docker Repository
Navigate to your desired installation directory and clone the SearXNG Docker repository:
cd /data1/ git clone https://github.com/searxng/searxng-docker.git cd searxng-docker/
3. Configure Environment Variables
Edit the `.env` file to set the appropriate hostname and email address:
nano .env
Generate a secret key to be used in SearXNG by running:
sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml
4. Customize SearXNG Settings
Edit the `searxng/settings.yml` file according to your needs. You can configure various aspects of your SearXNG instance including search engines, API keys, and user interface options.
nano searxng/settings.yml
5. Start SearXNG in the Background
After finishing the configuration, start SearXNG in the background using Docker Compose:
docker-compose up -d
6. Check if SearXNG is Running
Ensure that SearXNG is running correctly by checking the status of the Docker container:
docker container ls
You can also visit your SearXNG instance by navigating to the hostname you set in the `.env` file.