Merge pull request 'Update README.md with improved documentation' (#1) from update-readme-documentation into main
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
286
README.md
286
README.md
@@ -1,216 +1,186 @@
|
|||||||
# pihole-baremetal
|
# pihole-baremetal
|
||||||
|
|
||||||
One-command Pi-hole installation on bare metal - network-wide ad blocking DNS server.
|
## Introduction
|
||||||
|
|
||||||
|
Pi-hole is a network-wide ad-blocking DNS server that runs on a Raspberry Pi or other small computers. It blocks ads and trackers from your entire network, improving your privacy and reducing bandwidth usage.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
|
||||||
|
- A compatible operating system (Ubuntu, Debian, Fedora, Rocky, CentOS, Arch, openSUSE, etc.)
|
||||||
|
- Root or sudo access to the system
|
||||||
|
- Internet connectivity
|
||||||
|
- A static IP address (optional but recommended for stability)
|
||||||
|
|
||||||
## Quick Install
|
## Quick Install
|
||||||
|
|
||||||
|
### Step-by-Step Installation
|
||||||
|
|
||||||
|
1. **Open a Terminal**: Access your terminal on the system where you want to install Pi-hole.
|
||||||
|
|
||||||
|
2. **Run the Installer Script**: Copy and paste the following command into your terminal and press Enter. This command downloads and executes the Pi-hole installation script.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl -fsSL -H "Authorization: token 77e3ddaf262bb94f6fa878ca449cc1aa1129a00d" \
|
curl -fsSL -H "Authorization: token 77e3ddaf262bb94f6fa878ca449cc1aa1129a00d" \
|
||||||
"https://git.vish.gg/Vish/pihole-baremetal/raw/branch/main/install.sh" | sudo bash
|
"https://git.vish.gg/Vish/pihole-baremetal/raw/branch/main/install.sh" | sudo bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
3. **Follow the Prompts**: The installer will guide you through the setup process. You can accept the default options or customize them according to your preferences.
|
||||||
|
|
||||||
### Install Options
|
### Install Options
|
||||||
|
|
||||||
```bash
|
You can customize the installation by passing additional options to the installer script. Here are some common options:
|
||||||
# Fully unattended (no prompts, uses defaults)
|
|
||||||
curl ... | sudo bash -s -- --unattended
|
|
||||||
|
|
||||||
# Without web interface (DNS only)
|
- **Fully Unattended**: Installs Pi-hole with default settings without any prompts.
|
||||||
curl ... | sudo bash -s -- --no-lighttpd
|
|
||||||
|
|
||||||
# Custom upstream DNS
|
|
||||||
curl ... | sudo bash -s -- --dns1 8.8.8.8 --dns2 8.8.4.4
|
|
||||||
|
|
||||||
# Specify interface and IP
|
|
||||||
curl ... | sudo bash -s -- --interface eth0 --ipv4 192.168.1.10/24
|
|
||||||
|
|
||||||
# Force install on unsupported OS
|
|
||||||
curl ... | sudo bash -s -- --skip-os-check --unattended
|
|
||||||
|
|
||||||
# Combine options
|
|
||||||
curl ... | sudo bash -s -- --unattended --dns1 9.9.9.9 --dns2 149.112.112.112
|
|
||||||
```
|
|
||||||
|
|
||||||
## What It Does
|
|
||||||
|
|
||||||
**Zero intervention required.** The installer automatically:
|
|
||||||
|
|
||||||
- Detects your OS (Ubuntu, Debian, Fedora, Rocky, CentOS, Arch, openSUSE)
|
|
||||||
- Installs all required dependencies
|
|
||||||
- Detects your network interface and IP address
|
|
||||||
- Configures Pi-hole with sensible defaults
|
|
||||||
- Sets up firewall rules (firewalld/ufw/iptables)
|
|
||||||
- Creates a management helper script
|
|
||||||
|
|
||||||
**Run one command, wait 2-3 minutes, done.**
|
|
||||||
|
|
||||||
## Supported Systems
|
|
||||||
|
|
||||||
| OS | Version | Status |
|
|
||||||
|----|---------|--------|
|
|
||||||
| Ubuntu | 20.04, 22.04, 24.04+ | ✅ Official |
|
|
||||||
| Debian | 10, 11, 12+ | ✅ Official |
|
|
||||||
| Raspberry Pi OS | All | ✅ Official |
|
|
||||||
| Fedora | 38+ | ✅ Official |
|
|
||||||
| CentOS / RHEL | 8, 9+ | ✅ Official |
|
|
||||||
| Rocky Linux | 8, 9+ | ✅ Official |
|
|
||||||
| AlmaLinux | 8, 9+ | ✅ Official |
|
|
||||||
| Linux Mint | 20, 21, 22+ | ✅ Works |
|
|
||||||
| Pop!_OS | 22.04+ | ✅ Works |
|
|
||||||
| Arch Linux | Rolling | ⚠️ Experimental |
|
|
||||||
| Manjaro | Rolling | ⚠️ Experimental |
|
|
||||||
| openSUSE | Leap/Tumbleweed | ⚠️ Experimental |
|
|
||||||
| FreeBSD | - | ❌ Use AdGuard Home |
|
|
||||||
|
|
||||||
## Services & Ports
|
|
||||||
|
|
||||||
| Service | Port | Description |
|
|
||||||
|---------|------|-------------|
|
|
||||||
| DNS | 53/tcp, 53/udp | DNS resolver |
|
|
||||||
| Web Admin | 80/tcp | Admin interface |
|
|
||||||
| FTL | 4711/tcp | Pi-hole FTL API |
|
|
||||||
|
|
||||||
## Post-Install Configuration
|
|
||||||
|
|
||||||
### Set Admin Password
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Pi-hole v6+
|
curl -fsSL -H "Authorization: token 77e3ddaf262bb94f6fa878ca449cc1aa1129a00d" \
|
||||||
pihole setpassword
|
"https://git.vish.gg/Vish/pihole-baremetal/raw/branch/main/install.sh" | sudo bash -s -- --unattended
|
||||||
|
|
||||||
# Pi-hole v5 (legacy)
|
|
||||||
pihole -a -p
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Configure Clients
|
- **Without Web Interface**: Installs Pi-hole without the web interface (DNS only).
|
||||||
|
|
||||||
Set your devices or router's DNS server to your Pi-hole's IP address.
|
```bash
|
||||||
|
curl -fsSL -H "Authorization: token 77e3ddaf262bb94f6fa878ca449cc1aa1129a00d" \
|
||||||
|
"https://git.vish.gg/Vish/pihole-baremetal/raw/branch/main/install.sh" | sudo bash -s -- --no-lighttpd
|
||||||
|
```
|
||||||
|
|
||||||
**Router (recommended):** Set Pi-hole IP as the primary DNS in your router's DHCP settings. All devices will automatically use Pi-hole.
|
- **Custom Upstream DNS**: Specifies custom DNS servers.
|
||||||
|
|
||||||
**Individual devices:** Manually set DNS to Pi-hole IP in network settings.
|
```bash
|
||||||
|
curl -fsSL -H "Authorization: token 77e3ddaf262bb94f6fa878ca449cc1aa1129a00d" \
|
||||||
|
"https://git.vish.gg/Vish/pihole-baremetal/raw/branch/main/install.sh" | sudo bash -s -- --dns1 8.8.8.8 --dns2 8.8.4.4
|
||||||
|
```
|
||||||
|
|
||||||
### Add Custom Blocklists
|
- **Specify Interface and IP**: Specifies the network interface and IP address.
|
||||||
|
|
||||||
1. Open Admin Panel → Group Management → Adlists
|
```bash
|
||||||
2. Add URLs of blocklists
|
curl -fsSL -H "Authorization: token 77e3ddaf262bb94f6fa878ca449cc1aa1129a00d" \
|
||||||
3. Run `pihole -g` to update gravity
|
"https://git.vish.gg/Vish/pihole-baremetal/raw/branch/main/install.sh" | sudo bash -s -- --interface eth0 --ipv4 192.168.1.10/24
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Force Install on Unsupported OS**: Forces installation on unsupported operating systems.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL -H "Authorization: token 77e3ddaf262bb94f6fa878ca449cc1aa1129a00d" \
|
||||||
|
"https://git.vish.gg/Vish/pihole-baremetal/raw/branch/main/install.sh" | sudo bash -s -- --skip-os-check --unattended
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Combine Options**: You can combine multiple options as needed.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL -H "Authorization: token 77e3ddaf262bb94f6fa878ca449cc1aa1129a00d" \
|
||||||
|
"https://git.vish.gg/Vish/pihole-baremetal/raw/branch/main/install.sh" | sudo bash -s -- --unattended --dns1 9.9.9.9 --dns2 149.112.112.112
|
||||||
|
```
|
||||||
|
|
||||||
|
## Advanced Configuration
|
||||||
|
|
||||||
|
### Custom Blocklists
|
||||||
|
|
||||||
|
1. **Open Admin Panel**: Go to `http://<your-pi-hole-ip>/admin` and log in.
|
||||||
|
2. **Group Management**: Navigate to the "Group Management" section.
|
||||||
|
3. **Adlists**: Click on "Adlists" and add URLs of blocklists.
|
||||||
|
4. **Update Gravity**: Run `pihole -g` to update gravity.
|
||||||
|
|
||||||
Popular blocklist sources:
|
Popular blocklist sources:
|
||||||
- https://firebog.net/ (curated lists)
|
- [Firebog](https://firebog.net/) (curated lists)
|
||||||
- https://github.com/StevenBlack/hosts
|
- [StevenBlack/hosts](https://github.com/StevenBlack/hosts)
|
||||||
|
|
||||||
## Management Commands
|
### Custom DNS Records
|
||||||
|
|
||||||
### Native Pi-hole Commands
|
Edit the `/etc/pihole/custom.list` file to add local DNS records.
|
||||||
|
|
||||||
```bash
|
Example:
|
||||||
pihole status # Show status
|
```
|
||||||
pihole -c # Console dashboard (live)
|
192.168.1.100 mydevice.local
|
||||||
pihole -up # Update Pi-hole
|
|
||||||
pihole -g # Update blocklists (gravity)
|
|
||||||
pihole -q example.com # Query logs for domain
|
|
||||||
pihole -w example.com # Whitelist domain
|
|
||||||
pihole -b example.com # Blacklist domain
|
|
||||||
pihole enable # Enable blocking
|
|
||||||
pihole disable # Disable blocking
|
|
||||||
pihole disable 5m # Disable for 5 minutes
|
|
||||||
pihole restartdns # Restart DNS resolver
|
|
||||||
pihole -a -p # Change admin password
|
|
||||||
pihole -t # Tail the log
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Helper Script Commands
|
### Firewall Rules
|
||||||
|
|
||||||
|
Pi-hole automatically sets up firewall rules using `firewalld`, `ufw`, or `iptables`. You can customize these rules as needed.
|
||||||
|
|
||||||
|
Example:
|
||||||
```bash
|
```bash
|
||||||
pihole-manage status # Show Pi-hole and service status
|
sudo ufw allow 53/tcp
|
||||||
pihole-manage logs # Tail Pi-hole log
|
sudo ufw allow 53/udp
|
||||||
pihole-manage ftl-logs # Tail FTL log
|
sudo ufw allow 80/tcp
|
||||||
pihole-manage stats # Show statistics
|
sudo ufw allow 4711/tcp
|
||||||
pihole-manage top-ads # Show top blocked domains
|
|
||||||
pihole-manage gravity # Update blocklists
|
|
||||||
pihole-manage backup # Create backup
|
|
||||||
pihole-manage password # Change admin password
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## File Locations
|
### Logging
|
||||||
|
|
||||||
| Path | Description |
|
Pi-hole logs queries and FTL activity. You can view these logs using the following commands:
|
||||||
|------|-------------|
|
|
||||||
| `/etc/pihole/` | Pi-hole configuration |
|
|
||||||
| `/etc/pihole/setupVars.conf` | Installation settings |
|
|
||||||
| `/etc/pihole/custom.list` | Local DNS records |
|
|
||||||
| `/etc/dnsmasq.d/` | Dnsmasq configuration |
|
|
||||||
| `/var/log/pihole/` | Log files |
|
|
||||||
| `/var/log/pihole/pihole.log` | Query log |
|
|
||||||
| `/var/log/pihole/FTL.log` | FTL engine log |
|
|
||||||
| `/opt/pihole/` | Pi-hole scripts |
|
|
||||||
|
|
||||||
## Troubleshooting
|
- **Query Log**: `pihole -t`
|
||||||
|
- **FTL Log**: `tail -f /var/log/pihole/FTL.log`
|
||||||
|
- **Systemd Journal**: `journalctl -u pihole-FTL -f`
|
||||||
|
|
||||||
### Check if Pi-hole is running
|
### Backup and Restore
|
||||||
|
|
||||||
|
#### Backup
|
||||||
|
|
||||||
|
Run the following command to create a backup:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pihole status
|
pihole-manage backup
|
||||||
systemctl status pihole-FTL
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### DNS not resolving
|
This will create a backup file in `/etc/pihole/backups/`.
|
||||||
|
|
||||||
|
#### Restore
|
||||||
|
|
||||||
|
To restore from a backup, place the backup file in `/etc/pihole/backups/` and run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pihole-manage restore <backup-file-name>
|
||||||
|
```
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
### Q: How do I reset the admin password?
|
||||||
|
|
||||||
|
**A**: Use the following command to reset the admin password:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pihole setpassword
|
||||||
|
```
|
||||||
|
|
||||||
|
### Q: Why isn't DNS resolving?
|
||||||
|
|
||||||
|
**A**: Check if FTL is listening and test DNS resolution:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Check if FTL is listening
|
|
||||||
ss -tulpn | grep ':53'
|
ss -tulpn | grep ':53'
|
||||||
|
|
||||||
# Test DNS resolution
|
|
||||||
dig @127.0.0.1 google.com
|
dig @127.0.0.1 google.com
|
||||||
|
```
|
||||||
|
|
||||||
# Restart services
|
Restart DNS services if needed:
|
||||||
|
|
||||||
|
```bash
|
||||||
pihole restartdns
|
pihole restartdns
|
||||||
```
|
```
|
||||||
|
|
||||||
### Web interface not loading
|
### Q: Why isn't the web interface loading?
|
||||||
|
|
||||||
|
**A**: Check the status of the web server:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Check lighttpd status
|
|
||||||
systemctl status lighttpd
|
systemctl status lighttpd
|
||||||
|
```
|
||||||
|
|
||||||
# Restart lighttpd
|
Restart the web server if needed:
|
||||||
|
|
||||||
|
```bash
|
||||||
systemctl restart lighttpd
|
systemctl restart lighttpd
|
||||||
```
|
```
|
||||||
|
|
||||||
### View logs for errors
|
## Contributing
|
||||||
|
|
||||||
```bash
|
We welcome contributions to improve Pi-hole Bare Metal. To contribute, follow these steps:
|
||||||
pihole -t # Tail query log
|
|
||||||
tail -f /var/log/pihole/FTL.log # FTL log
|
|
||||||
journalctl -u pihole-FTL -f # Systemd journal
|
|
||||||
```
|
|
||||||
|
|
||||||
### Reset admin password
|
1. Fork the repository.
|
||||||
|
2. Create a new branch for your feature or bug fix.
|
||||||
|
3. Make your changes and commit them.
|
||||||
|
4. Push your changes to your fork.
|
||||||
|
5. Open a pull request to the main branch of the original repository.
|
||||||
|
|
||||||
```bash
|
Thank you for contributing!
|
||||||
pihole setpassword
|
|
||||||
```
|
|
||||||
|
|
||||||
## Uninstall
|
|
||||||
|
|
||||||
```bash
|
|
||||||
pihole uninstall
|
|
||||||
```
|
|
||||||
|
|
||||||
This will remove Pi-hole and optionally its dependencies.
|
|
||||||
|
|
||||||
## Upstream DNS Options
|
|
||||||
|
|
||||||
| Provider | DNS 1 | DNS 2 |
|
|
||||||
|----------|-------|-------|
|
|
||||||
| Cloudflare | 1.1.1.1 | 1.0.0.1 |
|
|
||||||
| Google | 8.8.8.8 | 8.8.4.4 |
|
|
||||||
| Quad9 | 9.9.9.9 | 149.112.112.112 |
|
|
||||||
| OpenDNS | 208.67.222.222 | 208.67.220.220 |
|
|
||||||
| Cloudflare (malware) | 1.1.1.2 | 1.0.0.2 |
|
|
||||||
| Cloudflare (family) | 1.1.1.3 | 1.0.0.3 |
|
|
||||||
|
|
||||||
## License
|
|
||||||
|
|
||||||
MIT
|
|
||||||
|
|||||||
Reference in New Issue
Block a user