Tag: Homelab

  • How to Install Home Assistant on Proxmox

    How to Install Home Assistant on Proxmox

    Home Assistant is a powerful open-source platform for smart home automation. Running it on Proxmox VE, a robust virtualization environment, offers flexibility and efficiency. This guide will walk you through the process of setting up Home Assistant on Proxmox VE.

    1. Creating and Setting Up a Virtual Machine (VM)

    First, let’s create a new VM specifically for Home Assistant:

    • CPU: Allocate at least 2 cores.
    • RAM: Assign a minimum of 2GB.
    • Storage: Allocate at least 32GB of storage.
    • Network: Use the default network settings.

    Steps:

    Log in to your Proxmox VE web interface. Click on “Create VM” in the top right corner and fill in the VM details (e.g., VM ID, Name).

    On the OS tab, choose “Do not use any media“.

    On the System tab, choose OVMF (UEFI) for the BIOS, local-lvm for EFI Storage and Uncheck the Pre-Enroll keys.

    On the Disks tab, delete the default one:

    No disk for the Home Assistant VM

    Configure the settings of CPU to 2 cores, and Memory to 2048 MB as recommended.

    Under the “Network” tab, choose vmbr0 (depend on your network system).

    Then click Next, and click Finish.

    2. Download Home Assistant OS image and attach to HomeAssistant VM

    First, download the Home Assistant OS image to your Proxmox server:

    Go to the Home Assistant OS image from the official Home Assistant website. Right click on the KVM/Proxmox and Copy link.

    In the Proxmox web interface, click on the pve and open Shell, then type in wget <space> <paste copied link>, then hit Enter.

    wget https://github.com/home-assistant/operating-system/releases/download/13.2/haos_ova-13.2.qcow2.xz

    Wait a litte time for the downloading to finish. After that, type “ls” to list the file. Use your mouse to select and copy filename (haos_ova-13.2.qcow2.xz). After that, run this command to unzip it:

    unxz haos_ova-13.2.qcow2.xz

    Wait a moment for the command completed and list the file using “ls” command again, you will see the file haos_ova-13.2.qcow2.

    Now import the qcow2 image to Home Assistant VM as a disk using the command: qm importdisk <HA VM id> haos_ova-13.2.qcow2 local-lvm

    qm importdisk 104 haos_ova-13.2.qcow2 local-lvm

    Wait for the command finish, head back to Proxmox interface and you will see Unused Disk 0 under Hardware tab of the Home Assistant VM.

    Click on Edit button, and because my disk is a SSD so I check on Discard check box, if you run a a HDD then just leave it unchecked.

    Then click Add, and this will create a Hard Disk (scsi0)

    3. Configuring the VM for Home Assistant

    Now, let’s configure the VM to ensure compatibility with Home Assistant:

    Head to Option tab, double click on the “Boot Order” to open it, uncheck ide2 cdrom, net0, and check scsi0 disk the prioritize the Home Assistant OS disk to boot from. Then click OK to save setting.

    Under “Options”, enable “QEMU Guest Agent”.

    4. Installing Home Assistant OS on Proxmox

    With the VM configured, it’s time to install Home Assistant OS. Start the VM and open the console. Wait for Home Assistant OS installtion finish and you can see IP and port to access Home Assistant on the screen.

    5. Accessing and Setting Up Home Assistant

    Once the installation is complete, access the Home Assistant UI by open a web browser and navigate to http://<your_vm_ip>:8123. You may need to wait about 20 minutes for preparing Home Assistant.

    After the preparing process finish, now you can complete the initial setup by click on “Create My Smart Home” button to start creating an account and configuring your home.

    You also may need to secure your Home Assistant instance by setting up SSL and enabling two-factor authentication.

    6. Additional Tips

    To optimize your Home Assistant setup, consider the following tips:

    • Automated Backups: Set up automated backups to ensure your data is safe.
    • Adjusting VM Resources: Monitor and adjust the VM resources as needed for optimal performance.
    • Adding Integrations: Explore and add integrations for various smart devices to enhance your smart home experience.

    Conclusion

    Running Home Assistant on Proxmox VE provides a flexible and efficient way to manage your smart home. With this setup, you can easily scale resources and take advantage of Proxmox’s powerful features. For more advanced configurations, check out the Home Assistant documentation and the Proxmox VE wiki.

    I hope this helps! If you have any questions or need further assistance, feel free to ask.

  • How to Use Cloudflare DDNS with Docker

    How to Use Cloudflare DDNS with Docker

    Are you tired of dealing with dynamic IP addresses and want a reliable way to access your home server or services remotely? Cloudflare DDNS (Dynamic DNS) is a great solution!

    In this guide, we’ll walk you through setting up Cloudflare DDNS using Docker.

    Step-by-Step Guide

    Step 1: Create a Domain on Cloudflare:

      • Sign up for a Cloudflare account if you don’t already have one.
      • Add your domain to Cloudflare and choose the free plan.
      • Change your domain’s name servers to Cloudflare’s name servers.

    Step 2: Log in to your Cloudflare account, navigate to API Token page: https://dash.cloudflare.com/profile/api-tokens

    Step 3: Scroll down to the bottom of the page and click on “Get started” button in the Custom token section.

    Step 4: Config the parameters as below, then click Continue to summary

    Step 5: Click on Create Token on the next screen, the Copy and Save the Token:

    Step 6: Deploy the Cloudflare DDNS Docker Container using Portainer Stack or Docker Compose.

    • Set PROXIED=false if you use DDNS for DNS only.
    • Set PROXIED=true if you use DDNS for other services such as web…
    version: '2'services:  cloudflare-ddns:    image: oznu/cloudflare-ddns:latest    restart: always    environment:      - API_KEY=xxxxxxx #Paste your API token here      - ZONE=example.com # Your main domain      - SUBDOMAIN=subdomain # Only subdomain here if any (do not include main domain)      - PROXIED=false # False For DNS only; true for web

    Step 7: Verify the Setup:

      • Check the logs of the Docker container to ensure it’s running and updating the DNS records every few minutes.
      • You can view the logs with the command: docker logs <container_id>.

    Step 8: Access Your Services:

    Use your domain name (e.g., your_subdomain.your_domain.com) instead of your dynamic IP address to access your home server or services.

    Conclusion

    Setting up Cloudflare DDNS with Docker is a straightforward process that can save you a lot of headaces with dynamic IP addresses. With this setup, you’ll have a reliable way to access your home server or services from anywhere in the world.

    Feel free to ask if you have any questions or need further assistance!

  • How to install Komga in OpenMediaVault Using Docker Compose

    How to install Komga in OpenMediaVault Using Docker Compose

    Komga is a free and open-source media server for your comics, manga, magazines, and books. It supports comic book archives such as CBZ and CBR (except solid archives, for RAR5 see below); eBooks in EPUB format; and PDF files.

    This article provides a concise guide on how to install Komga in OpenMediaVault (OMV) using Docker Compose.

    Prerequisites

    • OpenMediaVault installed and running
    • Docker and Docker Compose installed on OMV
    • Basic knowledge of using the OMV web interface

    Step-by-Step Guide

    1. Create Necessary Folders

    1. Go to Storage > Shared Folders.
    2. Create another folder named komga for Komga’s configuration and data.

    2. Create Docker Compose File

    Navigate to Services > Compose > Files and add the following content to the file:

    version: '3.3'services:  komga:    image: gotson/komga    container_name: komga    volumes:      - /path/to/komga/config:/config      - /path/to/komga/data:/data    ports:      - 25600:25600    restart: unless-stopped

    Remeber to replace /path/to/komga/config and /path/to/komga/data with the actual paths to your komga folder.

    In my case, because I have already add global environment file for OpenMediaVault docker, so my compose file is simple as the picture below:

    My compose file for Komga in OpenMediaVault

    After carefully finish editing all the parameters, Save the compose file and click Up button to deploy Komga container.

    Deloy the Komga container in OpenMediaVault

    3. Initial login and setup

    Open your web browser and starting to use Komga. At this time, Komga should now be running and accessible at http://<your-OMV-IP>:25600.

    At the first step, Komga will ask you to create a user account. Choose an email and password, then click on Create User Account and start using Komga.

    Komga overview

    Conclusion

    You have successfully installed Komga on OpenMediaVault using Docker Compose. You can now start adding your comics, manga, and books to Komga and enjoy your media library.

  • Installing qBittorrent on openmediavault Using Docker Compose

    qBittorrent is a popular, open-source BitTorrent client that offers a clean interface and a wide range of features. It is designed to be a lightweight alternative to other BitTorrent clients while providing the same level of functionality. With qBittorrent, users can manage their torrent downloads efficiently, thanks to features like an integrated search engine, RSS feed support, and remote control via a web user interface. In this blog post, we will go through step-by-step to install qBittorrent on OpenMediaVault using Docker Compose, as well as some initial setting for it.

    Step-by-Step Guide to Install qBittorrent on openmediavault Using Docker Compose

    Prerequisites:

    Step 1: Prepare Your Environment

    1. Log in to openmediavault: Access your openmediavault web interface.
    2. Enable Docker Repo: Navigate to System > omv-extras and enable the Docker repository. Click Save and then Apply.
    3. Install Docker and Docker Compose: Go to System > Plugins, search for docker and openmediavault-compose, and install both plugins.

    Step 2: Create a Docker Compose File

    Go to Services -> Compose -> Files, then click New to create new docker-compose.yaml file for qBittorrent.

    For me, I use the docker-compose content from linuxserver: https://hub.docker.com/r/linuxserver/qbittorrent

    ---services:  qbittorrent:    image: lscr.io/linuxserver/qbittorrent:latest    container_name: qbittorrent    environment:      - PUID=1000      - PGID=1000      - TZ=Etc/UTC      - WEBUI_PORT=8080      - TORRENTING_PORT=6881    volumes:      - /path/to/qbittorrent/appdata:/config      - /path/to/downloads:/downloads #optional    ports:      - 8080:8080      - 6881:6881      - 6881:6881/udp    restart: unless-stopped

    Paste the above content to Remember to change the parameters according to your system. Then click Save.

    Step 3: Deploy the qBittorrent Container

    Click “Up” button to pull the docker image and deploy the container. Wait for it’s status change to “Up”.

    Step 4: Access the qBittorrent Web Interface

    1. Open Your Browser: Navigate to http://<your-server-ip>:8080 to access the qBittorrent web interface.
    2. Login: The default username is admin and the default password is automatically generated. You can get the password by SSH into OpenMediaVault and run the following command to read to qBittorrent container log and get the password there.
    docker logs qbittorrent

    Make sure to change these credentials after your first login for security reasons.

    Change Default Credentials: Go to Options > Web UI and change the default username and password.

    Set Download Locations: Configure your download locations under Downloads to ensure your files are saved in the correct directories. For me I also config other settings as below:

    Config OpenTracker: udp://tracker.opentrackr.org:1337/announce

    Configure Bandwidth Limits: Set appropriate upload and download speed limits under Speed to manage your network usage.

    Enable IP Filtering: For added security, enable IP filtering under Connection.

    By following these steps, you should have a fully functional qBittorrent setup on your openmediavault server using Docker Compose. Enjoy your efficient and powerful torrent management system!

  • How to Install Docker, Docker Compose, and Portainer on OpenMediaVault Using OMV-Extras

    How to Install Docker, Docker Compose, and Portainer on OpenMediaVault Using OMV-Extras

    OpenMediaVault (OMV) is a powerful and flexible NAS (Network Attached Storage) solution based on Debian Linux. By leveraging OMV-Extras, you can easily install Docker, Docker Compose, and Portainer to manage your containers efficiently. This guide will walk you through the steps to get everything set up.

    Prerequisites

    • A running instance of OpenMediaVault (preferably version 6 or later).
    • Basic knowledge of SSH and command-line operations.
    • Internet access to download necessary packages.

    Step 1: Install OMV-Extras

    OMV-Extras is a plugin that extends the functionality of OpenMediaVault by adding additional repositories and plugins.

    SSH into your OMV server: Open a terminal and connect to your OMV server using SSH.

    ssh your-username@your-omv-ip

    Install OMV-Extras: Run the following commands to download and install OMV-Extras.

    wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash

    Step 3: Enable Docker Repository

    1. Access OMV Web Interface: Open your web browser and navigate to the OMV web interface (usually http://your-omv-ip).
    2. Enable Docker Repo: Go to System > OMV-Extras and enable the Docker repository. Click Save and then Apply.

    Step 3: Install Docker Compose

    Docker Compose is now part of the openmediavault-compose plugin. Search for openmediavault-compose in the plugins section, select it and click on Install button, check the Confirm box and click Yes to install it.

    Wait for the OpenMediaVault Compose plugin installation complete, then press Close.

    Now the Compose section should appear under Plugin menu:

    Step 4: Create user for docker

    Go to Users -> Users > Create User to create a new user call appuser. For the Shell scetion, we don’t need this account using terminal so choose usr/sbin/nologin. For Groups, choose users. Then click Save, and Apply.

    Step 5: Configure Docker

    1. Create a Shared Folder for Docker: Go to Storage > Shared Folders and create a new shared folder named dockerdata on your desired volume.
    2. Create a shared folder for compose file: dockerdata/appdata as shown in the pictures above.
    3. Similarly, create a shared folder for compose file: dockerdata/backup_compose.
    4. Create a shared folder for docker file: dockerdata/docker
    5. Create a shared folder for data file in the main HDD (to define a path to a shared folder using the CHANGE_TO_COMPOSE_DATA_PATH variable): data
    6. Set Docker Storage Path: Go to Services > Docker > Settings. Set the Docker storage path to the shared folders you have created. Click Save and then Apply.

    Step 5: Install Portainer

    Portainer is a lightweight management UI that allows you to easily manage your Docker environments.

    1. Install Portainer: Go to Services > Compose > Files. Click on Add from example and select portainer. Name it portainer and click Save.
    2. Deploy Portainer: In the same Compose section, click on the Up arrow to deploy Portainer. This will download and start the Portainer container.
    3. Access Portainer: Open your web browser and navigate to http://your-omv-ip:9000. Follow the setup instructions to configure Portainer.

    Conclusion

    By following these steps, you should have Docker, Docker Compose, and Portainer up and running on your OpenMediaVault server. This setup allows you to manage your containers efficiently and take full advantage of the powerful features OMV offers.

  • Reverse Proxy vs. Cloudflare Tunnel: Choosing the Right Solution for Exposing Homelab Services to the Internet

    Reverse Proxy vs. Cloudflare Tunnel: Choosing the Right Solution for Exposing Homelab Services to the Internet

    Homelab enthusiasts often face the challenge of securely exposing their services to the internet. Whether it’s a self-hosted website, a personal media server, or an automation system, making these services accessible from outside your local network requires careful consideration. Two popular solutions for this are Reverse Proxies and Cloudflare Tunnels. Each has its own advantages and drawbacks, making it essential to understand their differences to choose the most suitable one for your homelab setup.

    Introduction to Reverse Proxy

    A reverse proxy is a server that sits between the client and your web server, forwarding client requests to the appropriate server and returning the server’s response to the client. This setup is commonly used to balance the load across multiple servers, provide caching, enhance security, and simplify access to internal resources.

    Reverse Proxy Flow (image by Cloudflare)

    When setting up a homelab, reverse proxies play a crucial role in managing and securing web traffic. Several popular reverse proxies are widely used in the homelab community due to their versatility and powerful features:

    1. NGINX: Known for its performance and scalability, NGINX is a popular choice for both web servers and reverse proxies. It’s highly configurable, supports load balancing, SSL termination, and caching, making it ideal for complex homelab setups.
    2. Apache HTTP Server: As one of the oldest and most reliable web servers, Apache also functions as a robust reverse proxy. It offers extensive modules for various functionalities, including security, URL rewriting, and content delivery, making it a flexible option.
    3. Traefik: Traefik is a modern reverse proxy designed specifically for dynamic environments. It integrates seamlessly with containerized services, such as Docker and Kubernetes, automatically managing routes and SSL certificates, making it perfect for homelabs that rely on microservices.
    4. Caddy: Caddy is known for its simplicity and automatic HTTPS management. It’s a user-friendly reverse proxy that requires minimal configuration, making it an excellent choice for beginners or those looking for a straightforward setup with secure defaults.

    These reverse proxies cater to different needs, offering a range of features that can enhance the performance, security, and manageability of your homelab services.

    Pros of Reverse Proxy
    • Increased Control: With a reverse proxy, you have complete control over your configuration, including SSL certificates, access rules, and load balancing.
    • Flexibility: Reverse proxies can handle complex setups, allowing you to route different subdomains or paths to specific services.
    • Performance Optimization: By caching content and compressing data, reverse proxies can improve performance and reduce bandwidth usage.
    Cons of Reverse Proxy
    • Complex Setup: Configuring a reverse proxy requires knowledge of networking and server management. You’ll need to manage DNS records, SSL certificates, and firewall settings.
    • Security Risks: Exposing a reverse proxy to the internet can introduce security vulnerabilities if not properly configured and maintained.
    • Maintenance: Regular updates and monitoring are required to keep the reverse proxy secure and functional.
    • Can not expose your services if your network is behind Carrier-Grade NAT (CGNAT).

    Introduction to Cloudflare Tunnel

    Cloudflare Tunnel is a service provided by Cloudflare that creates a secure tunnel between your local network and Cloudflare’s network, allowing you to expose your services to the internet without opening any ports on your router. This is achieved by installing a small client on your local machine that maintains a persistent connection to Cloudflare, which then routes incoming traffic to your services.

    How does Cloudflare Tunnel work (image by Cloudflare)
    Pros of Cloudflare Tunnel
    • Simplicity: Cloudflare Tunnel requires minimal setup. There’s no need to configure DNS, manage SSL certificates, or open ports on your router.
    • Security: Since the tunnel is initiated from within your network, there’s no need to expose your network to the internet, reducing potential attack vectors.
    • Global CDN and DDoS Protection: Cloudflare provides additional benefits like DDoS protection and content delivery network (CDN) integration, which can enhance the security and performance of your services.
    • When your network is behind Carrier-Grade NAT (CGNAT), Cloudflare Tunnel offers a significant advantage over a reverse proxy. With CGNAT, it’s often impossible to directly expose your services to the internet because you don’t have a public IP address. Cloudflare Tunnel bypasses this limitation by establishing an outbound connection from your network to Cloudflare’s servers, allowing you to securely expose your services without needing to configure port forwarding or deal with the complexities of CGNAT. This makes Cloudflare Tunnel a seamless and hassle-free solution for users in CGNAT environments.
    Cons of Cloudflare Tunnel
    • Limited Control: While Cloudflare simplifies setup, it also limits the amount of control you have over your configuration. Custom routing and advanced features may require a higher-tier plan or may not be available at all.
    • Dependency on Cloudflare: Your service’s availability becomes dependent on Cloudflare’s infrastructure. If Cloudflare experiences downtime or issues, your services may be affected.
    • Potential Costs: While Cloudflare Tunnel is free for many use cases, certain features or high-traffic scenarios may incur costs, especially if you need advanced functionality.

    How to Choose the Right Solution for Your Homelab

    When deciding between a reverse proxy and Cloudflare Tunnel for your homelab, consider the following factors:

    1. Technical Expertise:
      • If you have experience with server management, networking, and DNS, a reverse proxy might be the better option for you. It offers more control and flexibility but requires more hands-on work.
      • If you prefer a simpler solution that requires minimal configuration, Cloudflare Tunnel is a great choice. It’s easier to set up and manage, especially if you’re not comfortable with advanced networking concepts.
    2. Security Considerations:
      • If security is a top priority and you want to avoid exposing your network to the internet, Cloudflare Tunnel is the safer option. It minimizes the attack surface by not requiring open ports.
      • However, if you’re confident in your ability to secure a reverse proxy (e.g., through regular updates, SSL certificates, and strict firewall rules), a reverse proxy can be just as secure, with the added benefit of more granular control.
    3. Cost and Resources:
      • Cloudflare Tunnel is cost-effective for most small-scale homelab projects, but if your usage scales up or you need premium features, costs can add up.
      • A reverse proxy, on the other hand, typically only involves the cost of running your server (e.g., electricity, domain name, etc.), but you’ll need to invest more time and effort in maintenance.
    4. Performance Needs:
      • If you need global CDN support and DDoS protection, Cloudflare Tunnel provides these out of the box, which can be beneficial for publicly accessible services.
      • A reverse proxy can also be optimized for performance, but it requires more manual configuration and management.

    My Personal Setup: Combining Cloudflare Tunnel and Wireguard VPN

    In my homelab, I use a combination of Cloudflare Tunnel and Wireguard VPN to manage access to my services. Cloudflare Tunnel handles the public-facing web services, offering a simple and secure way to expose these services without opening any ports on my router. This setup leverages Cloudflare’s global network for performance and security, making it a robust choice for web services.

    For accessing my local network services that I prefer to keep private, I use Wireguard VPN. This allows me to connect securely to my internal network from anywhere, accessing services like file shares, automation systems, and other resources that I don’t want exposed to the broader internet. This hybrid approach provides both the security and simplicity I need while maintaining control over how my services are accessed.

    Conclusion

    Choosing between a reverse proxy and Cloudflare Tunnel depends largely on your technical skill level, security needs, and the scale of your homelab project. A reverse proxy offers greater control and flexibility, making it ideal for those with technical expertise who want to customize their setup. In contrast, Cloudflare Tunnel provides simplicity and robust security features with minimal effort, making it a perfect fit for those who prefer a hassle-free solution.

    Ultimately, both solutions are viable for exposing homelab services to the internet, and your choice should align with your specific requirements and comfort level. For those looking to balance security and ease of use, combining Cloudflare Tunnel for public services with a VPN like Wireguard for private network access could be the ideal approach.

  • Docker Networking Tutorial: Bridge, None, Host, IPvlan, Macvlan, Overlay

    Docker Networking Tutorial: Bridge, None, Host, IPvlan, Macvlan, Overlay

    Docker networking is a crucial aspect of containerization, enabling communication between containers and external applications. This tutorial covers the different Docker network drivers and their specific use cases, along with commands to create each type of network.

    Bridge Network

    docker bridge network

    The default network mode, the bridge network, connects containers on the same host. It creates a virtual network allowing containers to communicate with each other using IP addresses. However, it has limitations, especially in production environments. Creating a user-defined bridge network allows for DNS-based communication between containers, enhancing flexibility and ease of use. These are the advantages of user-defined bridge network in docker:

    1. Automatic DNS Resolution: Containers on a user-defined bridge network can resolve each other by name or alias, making it easier to manage and connect services.
    2. Better Isolation: User-defined bridges provide better isolation as only containers attached to the same user-defined network can communicate with each other.
    3. Attach/Detach Flexibility: Containers can be attached or detached from user-defined networks on the fly without needing to stop and recreate them.
    4. Configurable Settings: Each user-defined network creates a configurable bridge, allowing customization of settings like MTU and iptables rules.

    Command to create a Bridge network:

    docker network create --driver bridge my_bridge_network

    None Network

    The none network mode completely isolates the container from the host and other containers. Only the loopback interface is created, making it ideal for running batch jobs or data processing pipelines where network isolation is required.

    Command to create a None network:

    docker network create --driver none my_none_network

    Host Network

    In host network mode, the container shares the host’s networking namespace, appearing as a regular application on the host. This mode is used to optimize performance and is suitable for applications requiring high port usage. However, it lacks network isolation, which can be a drawback in certain scenarios.

    Command to create a Host network:

    docker network create --driver host my_host_network

    IPvlan Network

    IPvlan is a lightweight network virtualization technique that assigns IP addresses from the same CIDR range as the host. It eliminates the need for port mappings, making it easier to provide access for external-facing services. This mode is beneficial for applications requiring direct network access without additional complexity.

    Command to create an IPvlan network:

    docker network create -d ipvlan \  --subnet=192.168.1.0/24 \  --gateway=192.168.1.1 \  -o parent=eth0 my_ipvlan_network

    Macvlan Network

    Macvlan assigns a unique MAC address to each container’s virtual network interface, making it appear as a physical network interface. This mode is suitable for legacy applications or those monitoring network traffic, providing direct connectivity to the physical network.

    Command to create a Macvlan network:

    docker network create -d macvlan \  --subnet=192.168.1.0/24 \  --gateway=192.168.1.1 \  -o parent=eth0 my_macvlan_network

    Overlay Network

    The overlay network driver creates a distributed network among multiple Docker daemon hosts, allowing secure communication between containers on different hosts. It is commonly used with Docker Swarm but can also connect individual containers. This mode is ideal for managing containers at scale, especially in production environments.

    Command to create an Overlay network:

    docker network create -d overlay my_overlay_network

    Conclusion

    Understanding Docker networking modes is essential for optimizing container communication and performance. Each network driver has its unique advantages and use cases, making it crucial to choose the right one based on your application’s requirements.

  • How to Sync AdGuard Home Settings Across Multiple Instances

    How to Sync AdGuard Home Settings Across Multiple Instances

    AdGuard Home is a powerful tool for blocking ads and tracking across your network. If you manage multiple instances of AdGuard Home, keeping their settings synchronized can be challenging. Using Portainer and AdGuardHome-Sync, you can automate this process efficiently. In this blog post, we’ll guide you through the steps to sync your AdGuard Home settings using a Portainer stack.

    Prerequisites

    Before we start, ensure you have the following:

    • Multiple instances of AdGuard Home running.
    • Docker and Portainer installed on your system.
    • Basic understanding of Docker, Portainer, and YAML configuration files.

    Step-by-Step Guide

    Step 1: Create a Portainer Stack for AdGuardHome-Sync

    AdGuardHome-Sync is a tool designed to synchronize settings between multiple AdGuard Home instances. To deploy it using a Portainer stack, follow these steps:

      • Open Portainer and navigate to the Stacks section.
      • Click on Add stack and name it adguardhome-sync.

    Step 2: Paste the docker-compose content to the Web Editor form, as below. Remember to change origin and destination IP, port, username and password accordingly to your actual system.

    ---version: "2.1"services:  adguardhome-sync:    image: quay.io/bakito/adguardhome-sync    container_name: adguardhome-sync    command: run    environment:      - ORIGIN_URL=http://192.168.1.26:3000 #Your origin Adguard Home instance -> change as necessary      - ORIGIN_USERNAME=username #change as necessary      - ORIGIN_PASSWORD=password #change as necessary      - REPLICA_URL=http://192.168.1.27 #Your destination Adguard Home instance change as necessary      - REPLICA_USERNAME=dbtech #change as necessary      - REPLICA_PASSWORD=password #change as necessary      # Replicate to other instances if needed      - REPLICA1_URL=http://192.168.1.4 #change as necessary      - REPLICA1_USERNAME=username #change as necessary      - REPLICA1_PASSWORD=password #change as necessary      - CRON=*/1 * * * * # run every 1 minute      - RUNONSTART=true    ports:      - 9876:8080 #change as necessary    restart: unless-stopped    

    Step 3: Deploy the Stack

      • Click on Deploy the stack in Portainer.
      • This will start the AdGuardHome-Sync container with the specified configuration.

    Step 4: Verify Synchronization

    Check the container logs to ensure that the synchronization is working correctly.

    Tips and Tricks

    • Security: Ensure that your AdGuard Home instances are secured with strong passwords.
    • Monitoring: Regularly check the logs to monitor the synchronization process.
    • Updates: Keep your Docker images up to date to benefit from the latest features and security patches.

    By following these steps, you can easily keep your AdGuard Home instances synchronized, ensuring consistent ad-blocking and DNS filtering across your network. Happy syncing!

  • How to Install AdGuard Home on OpenMediaVault Using openmediavault-compose

    How to Install AdGuard Home on OpenMediaVault Using openmediavault-compose

    AdGuard Home is a comprehensive network-wide software that blocks ads and tracking services, enhancing privacy and security for all devices connected to a network. It operates as a DNS server, filtering out unwanted content before it reaches your devices, similar to a local version of a public DNS service like AdGuard DNS.

    Here’s a brief overview:

    1. Ad-Blocking: AdGuard Home blocks ads across all devices on your network, including smartphones, tablets, and smart TVs. This is especially useful for devices where traditional ad blockers may not work as effectively.
    2. Privacy Protection: By blocking tracking scripts and analytics systems, AdGuard Home prevents third parties from collecting your data, offering a higher level of privacy.
    3. DNS-Based Filtering: As a DNS server, AdGuard Home filters requests at the network level. This means that ads and trackers are blocked before they even reach your devices, reducing the amount of data downloaded and speeding up your internet connection.
    4. Customizability: Users can create custom filters, blocklists, and allowlists to tailor the blocking to their needs. It also supports parental control features, allowing users to block access to adult content.
    5. Open Source: AdGuard Home is open-source, allowing users to inspect the code, contribute to its development, and ensure that it operates transparently.
    6. Cross-Platform: It can be installed on various devices, including Raspberry Pi, Linux, Windows, macOS, and even in Docker containers, making it highly versatile.

    In summary, AdGuard Home provides a robust, customizable, and privacy-focused solution for blocking ads and tracking across your entire home network.

    In this guide, we’ll walk you through the steps to install AdGuard Home on OpenMediaVault (OMV) using openmediavault-compose. This setup will help you manage your network’s DNS and block ads efficiently.

    Prerequisites

    • OpenMediaVault installed and running
    • openmediavault-compose plugin installed
    • Basic understanding of Docker and networking

    Step 1: Create a MacVLAN Network

    First, we need to create a MacVLAN network for the AdGuard container. This allows the container to have its own IP address, making it easier to manage ports.

    1. Access OMV Compose Plugin: Go to the OMV web interface and navigate to the openmediavault-compose plugin.
    2. Create Network: Under the “Services -> Compose -> Networks” tab, create a new network. Name it local-network.
    3. Configure Network:
      • Driver: select macvlan.
      • Parent Network: Select your main network interface, in my case it is enp2s0.
      • Subnet: Enter your subnet (e.g., 192.168.1.0/24).
      • Gateway: Enter your gateway (e.g., 192.168.1.1).
      • IP range: Enter your expected IP for Adguard Home (e.g., 192.168.1.200/32).
      • Click Save.

    Step 2: Create Docker Compose File

    Now, we’ll create a Docker Compose file to configure and run the AdGuard Home container.

    1. Create Compose File: Go to Services -> Compose -> Files, create a new compose file and name it adguard.
    2. Add Configuration: Paste the following configuration into the compose file. Remember to change the ipv4_address to match your network configuration. Then click Save.
    ---services:    adguardhome:        container_name: adguardhome        image: adguard/adguardhome        networks:          adguardhome:            ipv4_address: 192.168.1.200  #Change this to your ip address        volumes:            - CHANGE_TO_COMPOSE_DATA_PATH/adguardhome/workdir:/opt/adguardhome/work            - CHANGE_TO_COMPOSE_DATA_PATH/adguardhome/confdir:/opt/adguardhome/conf        restart: unless-stopped        ports:            - 53:53/tcp            - 53:53/udp            - 67:67/udp            - 68:68/udp            - 80:80/tcp            - 443:443/tcp            - 443:443/udp            - 3000:3000/tcp            - 853:853/tcp            - 784:784/udp            - 853:853/udp            - 8853:8853/udp            - 5443:5443/tcp            - 5443:5443/udpnetworks:   adguardhome:      name: local-network  #This is the name of our macvlan      external: true

    Step 3: Deploy AdGuard Home

    Deploy the AdGuard Home container using the compose file.

    1. Deploy Container: In the openmediavault-compose plugin, select the adguard compose file and click “Up”.
    2. Verify Deployment: Ensure the container is running and accessible.

    Step 4: Configure AdGuard Home

    Finally, configure AdGuard Home through its web interface.

    1. Access Web Interface: Open a web browser and go to http://192.168.1.200:3000.
    2. Initial Setup: Follow the on-screen instructions to complete the initial setup.
    3. Set DNS Server: Point your router’s DNS settings to the AdGuard Home IP address (e.g., 192.168.1.200).

    Conclusion

    Congratulations! You’ve successfully installed and configured AdGuard Home on OpenMediaVault using openmediavault-compose. This setup will help you manage your network’s DNS and block ads effectively.

    Feel free to customize this blog post to better fit your style and audience! If you have any questions or need further assistance, let me know.

  • Setting Up WireGuard Easy with Portainer: A Step-by-Step Guide

    Setting Up WireGuard Easy with Portainer: A Step-by-Step Guide

    WireGuard Easy is a popular, user-friendly solution for setting up a WireGuard VPN. Combined with the power of Portainer, a container management platform, you can effortlessly deploy and manage your VPN. This guide will walk you through the process.

    Prerequisites

    • A server running Docker and Portainer.
    • Basic understanding of Docker and Portainer.
    • A domain name (optional, but recommended for easy access).

    Step-by-Step Guide to install Wireguard VPN using Portainer

    Step 1: Log in to your Portainer instance.

    Step 2: Create a New Stack:

      • Navigate to the “Stacks” section.
      • Click “Add stack”.
      • Give your stack a name (e.g., “wireguard-easy”).
      • Paste the Docker Compose file content to the Web editor form, using the content as below:
    volumes:  etc_wireguard:services:  wg-easy:    environment:      # Change Language:      # (Supports: en, ua, ru, tr, no, pl, fr, de, ca, es, ko, vi, nl, is, pt, chs, cht, it, th, hi)      - LANG=de      # ⚠️ Required:      # Change this to your host's public address      - WG_HOST=raspberrypi.local      # Optional:      # - PASSWORD_HASH=$$2y$$10$$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG (needs double $$, hash of 'foobar123'; see "How_to_generate_an_bcrypt_hash.md" for generate the hash)      # - PORT=51821      # - WG_PORT=51820      # - WG_CONFIG_PORT=92820      # - WG_DEFAULT_ADDRESS=10.8.0.x      # - WG_DEFAULT_DNS=1.1.1.1      # - WG_MTU=1420      # - WG_ALLOWED_IPS=192.168.15.0/24, 10.0.1.0/24      # - WG_PERSISTENT_KEEPALIVE=25      # - WG_PRE_UP=echo "Pre Up" > /etc/wireguard/pre-up.txt      # - WG_POST_UP=echo "Post Up" > /etc/wireguard/post-up.txt      # - WG_PRE_DOWN=echo "Pre Down" > /etc/wireguard/pre-down.txt      # - WG_POST_DOWN=echo "Post Down" > /etc/wireguard/post-down.txt      # - UI_TRAFFIC_STATS=true      # - UI_CHART_TYPE=0 # (0 Charts disabled, 1 # Line chart, 2 # Area chart, 3 # Bar chart)      # - UI_SHOW_LINKS=true      # - UI_ENABLE_SORT_CLIENTS=true    image: ghcr.io/wg-easy/wg-easy    container_name: wg-easy    volumes:      - etc_wireguard:/etc/wireguard    ports:      - "51820:51820/udp"      - "51821:51821/tcp"    restart: unless-stopped    cap_add:      - NET_ADMIN      - SYS_MODULE      # - NET_RAW # ⚠️ Uncomment if using Podman    sysctls:      - net.ipv4.ip_forward=1      - net.ipv4.conf.all.src_valid_mark=1
    • Change WG_HOST to your server’s public IP address or domain name.
    • For the PASSWORD_HASH, run this command in terminal to get yours. Remember to replace foobar123 with your own password
    sudo docker run ghcr.io/wg-easy/wg-easy wgpw foobar123

    After this command, your will receive password hash.

    Important : Please don’t wrap the generated hash password in single quotes when you use docker-compose.yml. Instead, replace each $ symbol with two $$ symbols. For example:

    - PASSWORD_HASH=$$2y$$10$$hBCoykrB95WSzuV4fafBzOHWKu9sbyVa34GJr8VV5R/pIelfEMYyG

    Step 3: Click Deploy the Stack and wait for the deployment complete.

    Access WireGuard Easy:

    Once the deployment is complete and the container’s State change to healthy, you can access the WireGuard Easy web interface at http://your_server_ip:51821. Use the password you have set before to login.

    Add new Wireguard Client

    The Web UI for managing WireGuard is extremely user-friendly and easy to use.

    • Click ‘New’ to create a client.
    • Click the QR code icon to view the QR code used for setting up the WireGuard client on a phone.
    • Click the ‘Download’ icon to download the configuration file, which is used to set up the WireGuard client on a computer.
    • Click the ‘Trash’ icon to delete a client.

    Configuring NAT Port for WireGuard

    To connect to the WireGuard VPN Server from outside, you need to configure port forwarding on your network router (if WireGuard is installed on a server at home) or configure the firewall if it’s installed on a Cloud virtual machine. Configure port forwarding on the router with the following details:

    • Protocol: UDP
    • Port: 51820
    • Address: IP of the machine running wg-easy

    Additional Tips

    • For enhanced security, consider using a strong password for the web UI.
    • Adjust WG_ALLOWED_IPS to control which traffic is allowed through the VPN.
    • Use a dynamic DNS service if your IP address changes frequently.
    • Refer to the WireGuard Easy documentation for more advanced configuration options.

    Conclusion

    By following these steps, you’ve successfully set up WireGuard Easy using Portainer. You can now manage your VPN and create client configurations with ease. Enjoy the benefits of secure and private internet access!

    Would you like to add more details to this blog post, such as configuring WireGuard clients or troubleshooting common issues?