Replace Google with SearXNG - a privacy respecting, self-hosted search engine
Table of Contents
Introduction
In this tutorial, we will guide you through the process of replacing Google with SearXNG, a privacy-respecting, self-hosted search engine. Using SearXNG allows you to search the web without being tracked or profiled. We will set it up in an LXC container on Proxmox with Docker, and configure Tailscale for secure access with HTTPS/TLS certificates from Let's Encrypt. This setup is perfect for users looking for a more private search experience.
Step 1: Create an LXC Container
- Access Proxmox: Log into your Proxmox web interface.
- Create a New Container:
- Click on "Create CT" to start the container creation process.
- Configure the following settings:
- Hostname: Choose a name for your container (e.g., searxng).
- Template: Select a Linux template (Ubuntu or Debian recommended).
- Resources: Allocate CPU and memory according to your needs (2 CPU and 2GB RAM is sufficient for basic use).
- Network Configuration:
- Set up a static IP address for your container.
- Configure the network settings to ensure it can communicate with your network.
- Complete the Creation: Review your settings and click "Finish."
Step 2: Install Docker
- Access the Container: Open a terminal and access your new LXC container using SSH or the Proxmox console.
- Update Package List:
sudo apt update
- Install Docker:
sudo apt install docker.io
- Start and Enable Docker:
sudo systemctl start docker sudo systemctl enable docker
Step 3: Set Up Tailscale
- Install Tailscale:
curl -fsSL https://tailscale.com/install.sh | sh
- Authenticate with Tailscale:
- Run the following command to log in:
sudo tailscale up
- Follow the link provided to authenticate your account.
- Verify the Connection:
tailscale status
Step 4: Set Up SearXNG with Docker Compose
- Install Docker Compose:
sudo apt install docker-compose
- Create a Directory for SearXNG:
mkdir ~/searxng && cd ~/searxng
- Create a Docker Compose File:
- Create a file named
docker-compose.yml
and add the following content:
version: '3' services: searxng: image: searxng/searxng ports: - "8080:8080" environment: - SEARXNG_SECRET_KEY=your_secret_key
- Replace
your_secret_key
with a secure, random value.
- Create a file named
- Start SearXNG:
docker-compose up -d
Step 5: Configure TLS with Tailscale Serve
- Set Up Tailscale Serve:
- Use Tailscale to create a secure endpoint for your SearXNG instance:
tailscale serve add /searxng http://localhost:8080
- Access SearXNG:
- Visit the provided Tailscale URL to access your SearXNG instance securely.
Step 6: Set SearXNG as Default Search in Chrome
- Open Chrome Settings: Navigate to
chrome://settings/
. - Manage Search Engines:
- Go to "Search engine" settings.
- Click on "Manage search engines and site search."
- Add SearXNG:
- Click "Add" and enter the following:
- Search engine: SearXNG
- Shortcut: searxng
- URL:
https://your-tailscale-url/searxng/search?q=%s
- Replace
your-tailscale-url
with your actual Tailscale URL.
- Click "Add" and enter the following:
- Set as Default: Click on the three dots next to SearXNG and select "Make default."
Conclusion
You have successfully set up SearXNG as a self-hosted search engine, configured with Tailscale for secure access. This privacy-focused solution allows you to search the web without ads or tracking. For further customization, explore SearXNG's settings and features. Enjoy your new, private search experience!