Last active
May 26, 2025 04:46
-
-
Save ParkWardRR/602e01042aceedc882972bb3ec5c1e4f to your computer and use it in GitHub Desktop.
This script automates the installation and setup of SearXNG using Podman on AlmaLinux. It includes steps to update the system, install Podman, pull the SearXNG Docker image, create necessary configuration files, and run the SearXNG container with the correct port mapping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Filename: install_searxng.sh | |
# Description: This script automates the installation and setup of SearXNG using Podman on AlmaLinux. | |
# It includes steps to update the system, install Podman, pull the SearXNG Docker image, create necessary | |
# configuration files, run the SearXNG container with the correct port mapping, and set up a systemd service | |
# to ensure the container starts automatically on system boot. | |
# Update system | |
sudo dnf update -y | |
# Install Podman | |
sudo dnf install -y podman | |
# Verify Podman installation | |
podman --version | |
# Pull the SearXNG Docker image | |
podman pull docker.io/searxng/searxng:latest | |
# Create a directory for SearXNG configuration | |
mkdir -p ~/searxng/settings | |
# Create a configuration file with default settings | |
curl -o ~/searxng/settings/settings.yml https://raw.githubusercontent.com/searxng/searxng/master/searx/settings.yml.example | |
# Run the SearXNG container with correct port mapping | |
podman run -d --name searxng -p 8888:8080 -v ~/searxng/settings:/etc/searxng/settings:Z docker.io/searxng/searxng:latest | |
# Verify the container is running | |
podman ps | |
# Create a systemd service file for the SearXNG container | |
sudo tee /etc/systemd/system/searxng.service > /dev/null <<EOF | |
[Unit] | |
Description=SearXNG container | |
After=network.target | |
[Service] | |
Restart=always | |
ExecStart=/usr/bin/podman start -a searxng | |
ExecStop=/usr/bin/podman stop -t 2 searxng | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
# Reload systemd to recognize the new service | |
sudo systemctl daemon-reload | |
# Enable the SearXNG service to start on boot | |
sudo systemctl enable searxng | |
# Start the SearXNG service | |
sudo systemctl start searxng | |
# Fetch the server's hostname | |
hostname=$(hostname) | |
# Output the URL to access SearXNG | |
echo "SearXNG is running. Access it at http://$hostname:8888/" |
cool
Thank you, it worked flawlessly. It is hard to find podman version of containers.
Excellent. Worked like a charm. For those newbies to Podman like me, I had to run the following commands to achieve the run state:
podman machine init
podman machine start
and finally:
chmod +x install_searxng.sh
./install_searxng.sh
Excellent. Worked like a charm. For those newbies to Podman like me, I had to run the following commands to achieve the run state:
podman machine init
podman machine start
and finally:
chmod +x install_searxng.sh
./install_searxng.sh
If you have podman installed it should be running as a service systemctl enable podman
systemctl status podman
Thank you because docker was failing me on trying to get this running.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
would you please help me to set up and running searxng on huggingface spaces?