AdGuard Home with Docker - Part 2: System Setup & Configuration
In this part, we’ll prepare your Raspberry Pi or device for running AdGuard Home by setting up SSH access, installing Docker, and configuring a static IP address.
Table of Contents
Setting Up SSH (Headless Operation)
Skip this section if: You’re sitting at your device with a monitor and keyboard connected.
Follow this section if: You want to control your device remotely from another computer (recommended!)
What is SSH?
SSH (Secure Shell) lets you control your Raspberry Pi or Linux device from another computer. It’s like remote desktop, but text-based and much faster.
Benefits:
- Control your device from your laptop/desktop
- No monitor/keyboard/mouse needed on the Pi
- Professional server management method
- Secure and encrypted
Enabling SSH on Raspberry Pi
Method 1: Enable Before First Boot (Easiest for Headless Setup)
If you haven’t started your Raspberry Pi yet:
- Flash Raspberry Pi OS to SD card (using Raspberry Pi Imager)
- Open the SD card on your computer
- Create an empty file called
ssh(no extension) in the boot partition- Windows: Right-click → New → Text Document → Name it
ssh(remove .txt) - Mac/Linux: Open terminal and run:
touch /Volumes/boot/ssh
- Windows: Right-click → New → Text Document → Name it
- Eject SD card and put it in your Raspberry Pi
- SSH is now enabled when Pi boots up
Method 2: Enable After Boot (If You Have Monitor/Keyboard)
If your Raspberry Pi is already running:
- Open terminal on the Raspberry Pi
- Run this command:
sudo raspi-config - Navigate to: Interface Options → SSH
- Select: Yes (to enable SSH)
- Reboot:
sudo reboot
Method 3: Enable from Desktop (Raspberry Pi OS with GUI)
- Click Raspberry Pi Menu (top-left)
- Preferences → Raspberry Pi Configuration
- Interfaces tab
- Enable SSH
- Click OK
Enabling SSH on Ubuntu/Debian (Laptop/Desktop)
# Install SSH server
sudo apt update
sudo apt install openssh-server -y
# Start SSH service
sudo systemctl enable ssh
sudo systemctl start ssh
# Check status
sudo systemctl status ssh
You should see “active (running)” in green.
Finding Your Device’s IP Address
You need the IP address to connect via SSH.
On the device itself:
hostname -I
Example output: 192.168.1.100
Or from another computer:
- Check your router’s connected devices list
- Use IP scanner app (like Fing or Advanced IP Scanner)
- Use command:
ping raspberrypi.local(works on most networks)
Write down this IP address! You’ll need it to connect.
Connecting via SSH
Now connect from your main computer (laptop/desktop):
On Windows:
Option 1: Using PowerShell or Command Prompt (Windows 10/11)
Open PowerShell (search for “PowerShell” in Start menu)
Type:
ssh pi@192.168.1.100(Replace
192.168.1.100with your device’s IP address) (Replacepiwith your username if different)First time: You’ll see “Are you sure you want to continue?” → Type
yesEnter your password (default for Pi:
raspberry)
Option 2: Using PuTTY (Classic Method)
- Download PuTTY from https://www.putty.org/
- Run PuTTY
- Enter your device’s IP address in “Host Name”
- Port: 22
- Click “Open”
- Login with your username and password
On Mac/Linux:
Open Terminal
Type:
ssh pi@192.168.1.100(Replace
192.168.1.100with your device’s IP address) (Replacepiwith your username if different)First time: Type
yeswhen askedEnter your password
You’re Now Connected! 🎉
You’ll see a prompt like:
pi@raspberrypi:~ $
This means you’re controlling your device remotely! Any command you type here runs on your Raspberry Pi/device, not your local computer.
Quick SSH Tips
Copying and Pasting in SSH:
- Windows (PowerShell): Right-click to paste
- Mac/Linux:
Cmd+C/Cmd+Vor right-click - PuTTY: Right-click to paste
Exit SSH:
exit
Or press Ctrl+D
Reconnect: Just run the SSH command again - your device is still running!
Pro Tip: Keep your SSH window open while following this tutorial. All the commands work exactly the same via SSH!
SSH Security Tips
Optional - Advanced security hardening (can be skipped)
Change Default Password:
passwd
Follow the prompts to set a new password. Do this immediately if using default password!
Optional: Use SSH Keys (More Secure)
SSH keys let you connect without typing a password. This is more secure and convenient.
On your local computer (not the Pi):
# Generate SSH key (if you don't have one)
ssh-keygen -t ed25519
# Copy key to your device
ssh-copy-id pi@192.168.1.100
Now you can connect without a password!
Troubleshooting SSH
“Connection refused”
- SSH not enabled → Enable it using methods above
- Wrong IP address → Double-check with
hostname -I - Firewall blocking → Check if you have a firewall active with
sudo ufw status(Note: UFW is not installed by default on Raspberry Pi OS and generally not needed for home networks)
“Connection timed out”
- Device is off → Turn it on
- Wrong IP address → Check router’s device list
- Different network → Make sure both devices on same WiFi/LAN
“Permission denied”
- Wrong username → Default is
pifor Raspberry Pi - Wrong password → Default is
raspberry(but you should change it!)
Installing Docker
Note About This Section
If you’re using SSH: All the commands below work exactly the same! Just type them in your SSH window instead of a local terminal.
If you have a monitor/keyboard: You can follow along directly on your device.
Step 1: Open the Terminal
What is a terminal? It’s a text-based window where you type commands to control your device.
- On Raspberry Pi: Click the terminal icon (looks like a black box) at the top of the screen
- On Ubuntu/Linux: Press
Ctrl+Alt+Tor search for “Terminal” in your applications
Step 2: Update Your System
Copy and paste this command into the terminal, then press Enter:
sudo apt update && sudo apt upgrade -y
What this does: Updates all software on your device to the latest versions.
Note: You may be asked for your password. Type it (you won’t see it on screen) and press Enter.
Step 3: Install Docker
What is Docker? It’s a tool that runs programs in isolated containers, making installation much easier.
Copy and paste these commands one at a time:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
What this does: Downloads and runs Docker’s automatic installer. This will take a few minutes.
Step 4: Add Your User to Docker Group
This lets you use Docker without typing sudo every time:
sudo usermod -aG docker $USER
Important: After running this command, you must log out and log back in for it to work.
- Raspberry Pi: Click the power icon → Logout → Log back in
- Ubuntu: Click your username → Log Out → Log back in
- SSH: Type
exitand reconnect
Step 5: Enable Docker to Start Automatically
These commands make Docker start whenever you turn on your device:
sudo systemctl enable docker
sudo systemctl start docker
Step 6: Test Docker Installation
Let’s make sure Docker is working:
docker --version
You should see something like “Docker version 24.0.7”
Now test it with a simple command:
docker run hello-world
Success! If you see “Hello from Docker!” everything is working correctly.
Setting a Static IP Address (CRITICAL!)
Why You Need a Static IP
IMPORTANT: By default, your router assigns IP addresses dynamically (DHCP). This means your Raspberry Pi’s IP address can change after a reboot or power outage.
What happens if the IP changes:
- Your router’s DNS setting will point to the old IP (ads won’t be blocked)
- You won’t be able to access the AdGuard Home dashboard
- Your network will break until you update the DNS settings
Solution: Set a static IP address so it NEVER changes.
Option 1: Set Static IP on Your Router (Recommended)
This is the easiest and most reliable method. Most routers allow you to “reserve” an IP address for a specific device.
For Mesh Systems
TP-Link Deco 6 Example:
- Open the Deco app
- Tap on the “Network” tab at the bottom
- Find your Raspberry Pi/device in the device list
- Tap on it to open device details
- Scroll down and tap “Reserve IP” or “Address Reservation”
- Toggle it ON
- The current IP will be reserved permanently
Other Mesh Systems: If you’re using a different mesh system (Google WiFi, Eero, Netgear Orbi, etc.), the process is similar. Look for “Address Reservation,” “IP Reservation,” or “Static IP” in your mesh system’s app settings. Search Google for: “YOUR_MESH_MODEL reserve IP address” or check your device’s manual.
For Regular Routers
General Steps (varies by router brand):
Find your device’s MAC address:
ip link showLook for your network interface (eth0 for ethernet, wlan0 for WiFi) The MAC address looks like:
b8:27:eb:xx:xx:xxOr simpler:
ifconfig | grep etherAccess your router’s admin panel:
- Usually:
192.168.1.1,192.168.0.1, or192.168.1.254 - Enter admin credentials
- Usually:
Find DHCP Reservation / Static IP / Address Reservation:
- Common locations:
- “Advanced” → “LAN Setup” → “Address Reservation”
- “DHCP Server” → “Address Reservation”
- “Network” → “DHCP” → “Static Lease”
- “LAN” → “DHCP Reservation”
- Common locations:
Add a reservation:
- MAC Address: Enter the MAC address you found
- IP Address: Enter the IP you want to use (e.g.,
192.168.1.100) - Save settings
Reboot your router and device
Router-Specific Examples:
Search Google for:
- “TP-Link [MODEL] DHCP reservation”
- “Netgear [MODEL] static IP address”
- “Asus [MODEL] address reservation”
Option 2: Set Static IP on the Device
Use this if: Your router doesn’t support DHCP reservations OR you prefer to configure it on the device itself.
On Raspberry Pi (Raspberry Pi OS):
Find your network details:
ip route | grep defaultThis shows your gateway (router IP), usually
192.168.1.1cat /etc/resolv.confThis shows your current DNS server
Edit the network configuration:
sudo vim /etc/dhcpcd.confScroll to the bottom and add (replace with your values):
interface eth0 static ip_address=192.168.1.100/24 static routers=192.168.1.1 static domain_name_servers=1.1.1.1 8.8.8.8What each line means:
interface eth0- Ethernet connection (usewlan0for WiFi)static ip_address=192.168.1.100/24- The static IP you wantstatic routers=192.168.1.1- Your router’s IP (gateway)static domain_name_servers=1.1.1.1 8.8.8.8- Temporary DNS (Cloudflare and Google)
Save and exit:
- Press
Esc, then type:wqand pressEnter
- Press
Reboot:
sudo rebootVerify the IP is set:
hostname -I
On Ubuntu/Debian (using Netplan):
Find your network interface:
ip aLook for your interface (usually
eth0,enp0s3, etc.)Edit Netplan configuration:
sudo vim /etc/netplan/01-netcfg.yamlReplace the content with:
network: version: 2 ethernets: eth0: dhcp4: no addresses: - 192.168.1.100/24 gateway4: 192.168.1.1 nameservers: addresses: [1.1.1.1, 8.8.8.8]Note: Replace
eth0with your interface name, and adjust IPs for your network.Save and apply:
sudo netplan applyVerify:
ip a
What IP Address Should You Use?
Choose an IP outside your router’s DHCP range:
Most routers use:
- DHCP range:
192.168.1.100-192.168.1.200(or similar) - You can use:
192.168.1.10-192.168.1.99(before the DHCP range)
Check your router’s DHCP range:
- Access router admin panel
- Look for DHCP settings
- Note the “Start IP” and “End IP”
- Pick an IP outside this range
Common safe choices:
192.168.1.2(first available after router)192.168.1.10192.168.1.50
Write down your static IP! You’ll need it for the rest of this guide.
Next Steps
Your system is now ready! You have SSH access, Docker installed, and a static IP configured. In Part 3, we’ll install AdGuard Home and configure your network to use it.
Continue to Part 3: Installing AdGuard Home →
Series Navigation: ← Part 1: Prerequisites | Part 2 of 4 | Next: Installing AdGuard →