Proxmox Tutorial

Stop Network Ads: Deploy Pi-hole on Proxmox LXC

Let's be real for a second: the modern internet is almost unusable without some form of ad blocking. Ads have gotten completely out of hand. They are no longer just simple banners at the top of a page. They are auto-playing videos that pop out at you, massive overlays that cover the text you are trying to read, and invisible trackers that silently follow you from website to website, recording your every move to sell your data to the highest bidder. They slow down your browsing speed, eat up your bandwidth, and turn basic web surfing into an absolute minefield.

If you are browsing on a laptop or desktop computer, you probably already use a browser extension like uBlock Origin to fix this. That is great for your computer. But what about your smart TV? What about your mobile phone apps? What about your streaming devices, smart fridges, and IoT gadgets? You cannot install a traditional browser ad-blocker on those devices.

That is exactly where Pi-hole comes in. Pi-hole is a network-wide ad blocker. Instead of blocking ads on a single device, it acts as a black hole for advertisements across your entire home network. It intercepts ad requests at the DNS level before they even have a chance to download to your devices.

Traditionally, people run Pi-hole on a small physical computer called a Raspberry Pi. But since you already have a powerful Proxmox server running in your home lab, buying extra hardware is a waste of money. Today, we are going to deploy Pi-hole inside a lightweight Linux Container (or LXC) directly on your Proxmox server. Let's get into it.

Understanding the Magic: How Does Pi-hole Work?

Before we install anything, it is really important to understand exactly what you are building. It sounds complicated, but it is actually very simple.

Every time you type a website name (like google.com) into your browser, your computer doesn't actually know where that is. It has to ask a DNS server. Think of a DNS server like a giant internet phonebook. Your computer says, "Hey, what is the IP address for google.com?" The DNS server looks it up, replies with a string of numbers, and your computer connects to the site.

When you visit a news website, that website also tries to load ads. Your computer says, "Hey, what is the IP address for tracking-ads-server.com?"

When you install Pi-hole, you are forcing every device in your house to use the Pi-hole as its primary phonebook. Pi-hole has a massive, constantly updating list of known ad servers and tracking domains. When your smart TV tries to load an ad, it asks the Pi-hole for the address. The Pi-hole checks its list, sees that it's a known tracker, and instead of giving the real address, it essentially replies with "That number doesn't exist." The ad request drops into a black hole, the ad never downloads, and your webpage loads twice as fast. It is brilliant.

Why an LXC instead of a Virtual Machine?

If you are new to Proxmox, you might be wondering why we are using a Linux Container (LXC) instead of creating a full Virtual Machine (VM) like we do for Windows or heavy Linux servers.

The answer is efficiency. A full VM has to simulate an entire computer—motherboard, BIOS, hard drives, and all. That takes up a lot of system resources. An LXC, on the other hand, just borrows the host's core operating system (the kernel) to run.

Because Pi-hole is basically just a text-based phonebook, it requires almost zero processing power. By running it as an LXC container, it boots instantly and uses less than 512 megabytes of RAM. This leaves the vast majority of your Proxmox server's resources completely free for your heavier, more demanding self-hosting workloads.

Step 1: Open the Proxmox Shell

Normally, setting up a container involves downloading an operating system template, manually assigning resources, creating a user, and running dozens of update commands.

To get this running flawlessly and quickly, we are going to use a streamlined shortcut: the community helper scripts. These scripts automate the entire boring setup process.

  • First, open your web browser and log into your Proxmox web interface.
  • Look at the left sidebar and click on your main node (it is usually called "pve" unless you renamed it).
  • Once your node is selected, look at the main window area and click the button that says Shell. This will open up a black terminal window with a blinking cursor. You are now inside the brain of your server.

Step 2: Execute the Creator Script

Next, we need to run the automatic setup command. We are using the legendary Proxmox VE Helper Scripts created by tteck. These scripts are safe, open-source, and used by thousands of home lab enthusiasts every single day.

Highlight the command below, copy it, paste it directly into your Proxmox terminal, and press Enter:

bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/pihole.sh)"

Step 3: Follow the Configuration Wizard

The moment you press enter, the script wizard will pop up in the terminal. It is going to ask you a series of very simple questions.

  • Create a new Pi-hole LXC? Hit Yes.
  • Use Default Settings? For 99% of home networks, the default allocation settings (usually 1 core and 512MB of RAM) are absolutely perfect. Select Yes.

Now, just sit back and watch the text fly by. The script is automatically downloading a clean, lightweight Linux template, creating the container, allocating the system resources, updating the operating system, and pulling down the latest Pi-hole framework. It does ten minutes of manual labor in about thirty seconds.

Step 4: The Pi-hole Setup Prompts

During the installation, the official Pi-hole setup screens will appear (these are usually blue and gray text boxes).

  • Upstream DNS Provider: It will ask you to choose an upstream DNS provider. This is the "real" phonebook Pi-hole will use when it doesn't know an address. You can pick Google (8.8.8.8) or Cloudflare (1.1.1.1). Cloudflare is generally considered faster and slightly more privacy-focused.
  • Blocklists: It will ask if you want to use StevenBlack's default blocklist. Say Yes. This list blocks millions of known ad domains right out of the box.
  • Static IP Address: This is critical. It will ask to set a static IP address for the container. Say Yes and confirm the IP it suggests. If your Pi-hole's IP address ever changes, your entire house will lose internet access, so it must be static!

Step 5: Save Your Login Credentials

Once the installation finishes, the terminal will spit out a final summary screen. It will explicitly list your container's newly assigned IP Address and a randomly generated Admin Password.

Make sure you write these down on a piece of paper or take a quick screenshot immediately. If you lose that password, getting back into the system is a headache.

Step 6: Route Your Network Traffic

Your Pi-hole is now alive, running, and ready to block ads. But right now, it isn't doing anything because none of the devices in your house know it exists.

Open up a new browser tab, type in the IP address you just wrote down followed by /admin (for example: 192.168.1.50/admin), and log in using your new password. Welcome to your ad-blocking command center. You will see a beautiful dashboard showing total queries and blocked domains.

The final, crucial step to make this work for your entire household is to route your traffic through it. You have to tell your main home router to use the Pi-hole as the one and only DNS server.

  • Log into your home router's settings gateway (usually by going to 192.168.1.1 or 10.0.0.1 in your browser).
  • Look through the menus for DHCP Settings or LAN Setup. Every router brand (Netgear, Asus, Unifi) is slightly different, but you are looking for the DNS fields.
  • You will likely see Primary DNS and Secondary DNS. Change the Primary DNS to the IP address of your new Pi-hole. Leave the Secondary DNS completely blank. (If you put a secondary DNS like Google, your devices might bypass the Pi-hole and you will still see ads).
  • Save the settings and restart your router.

Common Questions (FAQ)

Will Pi-hole block YouTube ads?
No. This is the most common misconception. Pi-hole blocks ads by looking at the domain name. If an ad comes from ads.google.com, Pi-hole blocks it. But YouTube serves its video ads from the exact same domain name as the actual video you want to watch. If Pi-hole blocks the ad, it blocks the video too. To block YouTube ads, you still need a browser extension like uBlock Origin on your PC.

What happens if my Proxmox server goes offline?
If your server loses power or crashes, the Pi-hole turns off. Because your router is pointing all traffic to the Pi-hole, if the Pi-hole is dead, your entire house will instantly lose the ability to load webpages. If you need to do maintenance on your server, simply log back into your router and change the DNS back to "Automatic" to restore the internet.

Can I see what my family is browsing?
Technically, yes. The Pi-hole dashboard will show a log of every DNS request made by every device on your network. However, you can configure the privacy settings in the Pi-hole admin panel to anonymize the data if you don't want to see individual logs.

Conclusion

Congratulations. Whenever any device on your network—from your phone, to your laptop, to your smart TV—tries to load an application or webpage, your router quietly points it to the Pi-hole. If it’s a tracking pixel, a malware domain, or a massive banner ad, it gets blocked instantly. If it’s real content, it passes right through flawlessly.

Your network is now significantly faster, visually cleaner, and much more private—and it's all running smoothly on a tiny fraction of your Proxmox server's footprint. Enjoy the ad-free experience.