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

  1. Setting Up SSH (Headless Operation)
  2. Installing Docker
  3. Setting a Static IP Address

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:

Enabling SSH on Raspberry Pi

Method 1: Enable Before First Boot (Easiest for Headless Setup)

If you haven’t started your Raspberry Pi yet:

  1. Flash Raspberry Pi OS to SD card (using Raspberry Pi Imager)
  2. Open the SD card on your computer
  3. 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
  4. Eject SD card and put it in your Raspberry Pi
  5. 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:

  1. Open terminal on the Raspberry Pi
  2. Run this command:
    sudo raspi-config
    
  3. Navigate to: Interface Options → SSH
  4. Select: Yes (to enable SSH)
  5. Reboot: sudo reboot

Method 3: Enable from Desktop (Raspberry Pi OS with GUI)

  1. Click Raspberry Pi Menu (top-left)
  2. PreferencesRaspberry Pi Configuration
  3. Interfaces tab
  4. Enable SSH
  5. 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:

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)

  1. Open PowerShell (search for “PowerShell” in Start menu)

  2. Type:

    ssh pi@192.168.1.100
    

    (Replace 192.168.1.100 with your device’s IP address) (Replace pi with your username if different)

  3. First time: You’ll see “Are you sure you want to continue?” → Type yes

  4. Enter your password (default for Pi: raspberry)

Option 2: Using PuTTY (Classic Method)

  1. Download PuTTY from https://www.putty.org/
  2. Run PuTTY
  3. Enter your device’s IP address in “Host Name”
  4. Port: 22
  5. Click “Open”
  6. Login with your username and password

On Mac/Linux:

  1. Open Terminal

  2. Type:

    ssh pi@192.168.1.100
    

    (Replace 192.168.1.100 with your device’s IP address) (Replace pi with your username if different)

  3. First time: Type yes when asked

  4. Enter 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:

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”

“Connection timed out”

“Permission denied”


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.

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.

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:

Solution: Set a static IP address so it NEVER changes.

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:

  1. Open the Deco app
  2. Tap on the “Network” tab at the bottom
  3. Find your Raspberry Pi/device in the device list
  4. Tap on it to open device details
  5. Scroll down and tap “Reserve IP” or “Address Reservation”
  6. Toggle it ON
  7. 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):

  1. Find your device’s MAC address:

    ip link show
    

    Look for your network interface (eth0 for ethernet, wlan0 for WiFi) The MAC address looks like: b8:27:eb:xx:xx:xx

    Or simpler:

    ifconfig | grep ether
    
  2. Access your router’s admin panel:

    • Usually: 192.168.1.1, 192.168.0.1, or 192.168.1.254
    • Enter admin credentials
  3. 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”
  4. 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
  5. Reboot your router and device

Router-Specific Examples:

Search Google for:

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):

  1. Find your network details:

    ip route | grep default
    

    This shows your gateway (router IP), usually 192.168.1.1

    cat /etc/resolv.conf
    

    This shows your current DNS server

  2. Edit the network configuration:

    sudo vim /etc/dhcpcd.conf
    
  3. Scroll 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.8
    

    What each line means:

    • interface eth0 - Ethernet connection (use wlan0 for WiFi)
    • static ip_address=192.168.1.100/24 - The static IP you want
    • static 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)
  4. Save and exit:

    • Press Esc, then type :wq and press Enter
  5. Reboot:

    sudo reboot
    
  6. Verify the IP is set:

    hostname -I
    

On Ubuntu/Debian (using Netplan):

  1. Find your network interface:

    ip a
    

    Look for your interface (usually eth0, enp0s3, etc.)

  2. Edit Netplan configuration:

    sudo vim /etc/netplan/01-netcfg.yaml
    
  3. Replace 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 eth0 with your interface name, and adjust IPs for your network.

  4. Save and apply:

    sudo netplan apply
    
  5. Verify:

    ip a
    

What IP Address Should You Use?

Choose an IP outside your router’s DHCP range:

Most routers use:

Check your router’s DHCP range:

  1. Access router admin panel
  2. Look for DHCP settings
  3. Note the “Start IP” and “End IP”
  4. Pick an IP outside this range

Common safe choices:

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 →