Blog

  • 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?

  • Installing OMV-Extras on OpenMediaVault: A Comprehensive Guide

    Installing OMV-Extras on OpenMediaVault: A Comprehensive Guide

    1. What is OMV-Extras?

    OMV-Extras is a powerful plugin for OpenMediaVault (OMV) that significantly expands its capabilities. It offers a range of additional features and tools, making your NAS more versatile and efficient.

    1. Why Install OMV-Extras?
    • Expand OMV functionality: Access a wider range of plugins and applications.
    • Simplify installation: Streamline the process of installing various software packages.
    • Enhance performance: Optimize your NAS for specific tasks.
    1. Prerequisites:
    • An OpenMediaVault server up and running. If you don’t have one, you can find out how to install OpenMediaVault in the box below.
    • Basic understanding of Linux command line (for command-line method).
    • SSH access to your OMV server (for command-line method).
    Step-by-Step Guide to Install OpenMediaVault on Proxmox and Enabling SMB Share
    A comprehensive guide for installing OpenMediaVault on Proxmox and setting up an SMB share for easy file sharing across your network

     

    1. Installation of OMV-Extras using command-line:

    Step1: Open a terminal window and SSH into your OMV server.

    Step2: Execute the following command:

    wget -O - https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/install | bash
    Install OMV-Extras in Openmediavault

    Wait for the installation process to complete.

    1. Verifying Installation:

    Check if the omv-extras plugin is listed in the “System -> Plugins” section of the OMV web interface to ensure OMV-Extras is installed correctly.

    1. Additional Tips:
    • Always back up your system before making significant changes.
    • Refer to the official OMV-Extras documentation for detailed instructions and troubleshooting.
    • Explore the available plugins and tools to maximize the benefits of OMV-Extras.

    By following these steps, you should have successfully installed OMV-Extras on your OpenMediaVault server. Enjoy the expanded capabilities and features it brings!

  • How to Install Docker and Docker Compose on Ubuntu Server using get-docker.sh Script

    How to Install Docker and Docker Compose on Ubuntu Server using get-docker.sh Script

    Docker and Docker Compose are powerful tools for developers and system administrators alike. They enable you to run applications in isolated containers, promoting consistency, portability, and efficient resource management. Today, we’ll explore how to effortlessly install both on your Ubuntu server using the official get-docker.sh script.

    Benefits of Using get-docker.sh:

    • Simple and Efficient: This script automates the installation process, saving you time and effort compared to manual configuration.
    • Official Source: Downloading from the official Docker repository ensures you’re getting the latest stable version and reliable updates.
    • Streamlined Workflow: Once installed, you’ll be ready to leverage containerized applications and development environments with ease.

    Prerequisites:

    • An Ubuntu server with internet access.
    • Administrative (sudo) privileges.
    • Basic familiarity with the terminal and sudo commands.

    Step 1: Update Your System

    First, SSH into your server and update your package index to ensure you have the latest information about available packages.

    sudo apt update && sudo apt dist-upgrade

    Step 2: Download and Run the get-docker.sh Script

    The get-docker.sh script is an official Docker installation script that simplifies the installation process.

    Download the script:

    curl -fsSL https://get.docker.com -o get-docker.sh

    Run the script:

    sh get-docker.sh

    This script will install Docker Engine, Docker CLI, Docker Compose and containerd.

    Docker and Docker Compose installation process

    When the installation finish, you will see Docker version on the terminal screen as follow:

    Docker and Docker Compose installation finished

    Step 3: Verify Docker Installation

    After the installation is complete, verify that Docker is installed correctly by running the following commands:

    docker --versiondocker compose version

    You should see the version number of Docker and Docker Compose, confirming that it is installed correctly.

    Conclusion:

    By following these steps, you’ve successfully installed Docker and Docker Compose on your Ubuntu server using the get-docker.sh script. Now, you’re ready to leverage the power of containerized applications and development environments to streamline your workflow and enhance your development experience.

    Additional Notes:

    • Remember to restart your terminal session after installation for the changes to take effect.
    • Consult the official Docker and Docker Compose documentation for further details and advanced usage.

    I hope this blog post has been helpful! Feel free to leave any comments or questions below.

  • OpenMediaVault installed on laptop – how to turn screen off automatically

    OpenMediaVault installed on laptop – how to turn screen off automatically

    I’ve just set up OMV on an old laptop, but even if I close the lid the screen stays on. I’m wanting to have it turned off as fully as possible – not just to save the screen but to save whatever processing power it takes if that makes sense.

    1. Introduction

    In order to save energy and protect the laptop screen, I need to set the screen to the Blank state after 1 min and turn it off after 2 min. Any keypress will turn it back on. Make it auto-start after reboot. The magic command what will do all the work:

    setterm --blank 1 --powerdown 2

    If you get error:

    setterm: terminal xterm-256color does not support --blank

    You are probably trying this command by SSH. You must run it from local of your machine, or do next stage of this guide.

    2. Make it auto-start

    Insert command in executable file

    Insert command in executable file. Store it for example in hidden folder of your home directory /home/USER/.boot-scripts/screen-off.sh (Create the folder using mkdir command first):

    sudo mkdir /home/USER/.boot-scripts/sudo nano /home/USER/.boot-scripts/screen-off.sh

    Paste this to screen-off.sh file:

    #!/bin/bashsetterm --blank 1 --powerdown 2

    Save the file by Ctrl+O, Enter, then Ctrl+X

    And make script file executable by systemctl

    Create file /etc/systemd/system/screen-off.service

    sudo nano /etc/systemd/system/screen-off.service

    Paste this to screen-off.service file:

    [Unit]Description=Blank screen after 1 min and turn it off after 2 min. Any keypress will turn it back on.After=ssh.service[Service]Type=oneshotEnvironment=TERM=linuxStandardOutput=ttyTTYPath=/dev/consoleExecStart=/home/USER/.boot-scripts/screen-off.sh[Install]WantedBy=local.target

    Save the file by Ctrl+O, Enter, then Ctrl+X

    Make it executable:

    sudo chmod +x /home/USER/.boot-scripts/screen-off.shsudo chmod +x /etc/systemd/system/screen-off.service

    And finally get it working and enabled on boot:

    sudo systemctl start screen-off.servicesudo systemctl enable screen-off.service

    To disable it:

    sudo systemctl disable screen-off.service

    3. Other way to automatically turn screen off on boot

    Linux has a boot parameter consoleblank=XX which powers off the tty after XX seconds.
    To use this parameter: Edit /etc/default/grub

    sudo nano /etc/default/grub

    Then add consoleblank=60 to the GRUB_CMDLINE_LINUX_DEFAULT= parameter. For example

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash consoleblank=60"

    Then update GRUB and reboot by run:

    sudo update-grubsudo reboot

    With this, the display should turn off after one minute (adjust the number if this is too short for you). This will work both on the login prompt, and when someone is logged in.

  • Installing Ubuntu Server VM on Proxmox: A Step-by-Step Guide

    Installing Ubuntu Server VM on Proxmox: A Step-by-Step Guide

    Setting up a virtual machine (VM) running Ubuntu Server on Proxmox VE can transform your homelab into a versatile and efficient environment for various applications. Proxmox VE is a powerful open-source virtualization platform that combines KVM for virtual machines and LXC for containers. This guide will walk you through the process of installing Ubuntu Server on a Proxmox VM, covering everything from initial setup to post-installation configuration.

    Why Use Proxmox VE and Ubuntu Server?

    Proxmox VE:

    • Flexible Virtualization: Supports both KVM for full virtualization and LXC for lightweight container-based virtualization.
    • Easy Management: Provides a web-based interface for easy management of your virtual environment.
    • Scalable: Suitable for both small home labs and large production environments.

    Ubuntu Server:

    • Stability and Support: Offers a stable and well-supported server operating system.
    • Ease of Use: Known for its user-friendly setup and strong community support.
    • Versatility: Ideal for a wide range of applications from web hosting to development environments.

    Prerequisites

    Before you begin, ensure you have the following:

    1. Proxmox VE Installed: Ensure Proxmox VE is installed and running on your server. If you need to install it, follow the Proxmox installation guide.
    2. Ubuntu Server ISO Image: Download the latest Ubuntu Server ISO from the official Ubuntu website.
    3. Storage Space: Ensure you have enough storage available on your Proxmox host for the VM and its data.
    4. Network Configuration: Make sure your Proxmox host is connected to the network and has internet access for downloading updates and packages.

    Step-by-Step Installation Guide

    1. Upload the Ubuntu Server ISO to Proxmox

    1. Access Proxmox Web Interface:
      • Open your web browser and navigate to the Proxmox VE web interface. This is typically accessible at https://<your-proxmox-ip>:8006.
    2. Login:
      • Enter your Proxmox username and password to log in.
    3. Upload the ISO:
      • Go to the “Datacenter” view in the left-hand menu.
      • Select your Proxmox node and then click on the “Local” storage under “Storage” in the left-hand menu.
      • Click the “Content” tab and then click “Upload.”
      • Choose “ISO Image” as the type, browse to the Ubuntu Server ISO file you downloaded, and upload it.

    2. Create a New Virtual Machine

    1. Start the VM Creation Wizard:
      • Click on “Create VM” in the top right corner of the Proxmox web interface.
    2. Configure VM Settings:
      • General Tab:
        • Node: Select the Proxmox node where you want to create the VM.
        • VM ID: Proxmox will assign a default ID, but you can change it if needed.
        • Name: Give your VM a meaningful name (e.g., “Ubuntu-Server”).
      • OS Tab:
        • ISO Image: Select the Ubuntu Server ISO image you uploaded earlier.
        • Guest OS Type: Choose “Linux” and “5.x/6.x/7.x/8.x” as the version, which is suitable for Ubuntu Server.
      • System Tab:
        • BIOS: Choose “OVMF (UEFI)” or “SeaBIOS” depending on your preference. “SeaBIOS” is generally suitable for most setups.
        • Machine: Select “i440fx” or “q35” (use “i440fx” for compatibility).
        • Qemu Agent: Enabled.
      • Disks Tab:
        • Bus/Device: Choose “SCSI” or “IDE” for the disk bus. “SCSI” is recommended for better performance.
        • Disk Size: Allocate sufficient disk space for your needs (e.g., 32 GB).
        • Discard: enable this option if you use SSD.
        • SSD Emulation: enable this option if you use SSD.
      • CPU Tab:
        • Sockets: Allocate the number of CPU sockets (e.g., 1).
        • Cores: Specify the number of cores per socket (e.g., 2).
      • Memory Tab:
        • Memory Size: Allocate RAM for the VM (e.g., 2048 MB).
      • Network Tab:
        • Model: Choose “virtio” for better performance.
        • Bridge: Select the network bridge (e.g., “vmbr0”) to connect the VM to your network.
    3. Confirm and Create VM: Review your settings and click “Finish” to create the VM.

    3. Install Ubuntu Server on the VM

    Start the VM:

      • Select your newly created VM from the Proxmox web interface.
      • Click the “Start” button to boot up the VM.

    Open the Console: Click on the “Console” tab to access the VM’s display and interact with it.

    Begin Installation: The VM should boot from the Ubuntu Server ISO. Follow the on-screen instructions to start the installation process.

    Choose Language and Keyboard Layout: Select your preferred language and keyboard layout.

    Network Configuration:

      • Automatic: The installer will automatically configure the network.
      • Manual: If you need static IP settings, choose “Manual” and enter your network details.

    Configure Storage: Choose “Guided – Use Entire Disk” to let Ubuntu automatically partition the disk. Remember to adjust the ubuntu-lv line as below to make sure that Ubuntu Server will be installed into the entire disk.

    Set Up User: Create a user account and set a password.

    Install Updates and Software: Choose to install OpenSSH server.

    Install GRUB: When prompted, install the GRUB boot loader to the disk to enable the system to boot into Ubuntu Server.

    Complete Installation: Once installation is complete, the VM will prompt you to remove the ISO image and reboot. Do so, and your VM will boot into Ubuntu Server. On the first boot, remember to leave the system finish cloud-init initiating.

    Complete installation of Ubuntu Server 24.04 LTS on Proxmox

    4. Post-Installation Configuration

    Log in to your newly installed Ubuntu Server VM using the credentials you set up during installation. Then first update the system after installation:

    sudo apt update && sudo apt dist-upgrade

    Install QEMU Guest Agent:

    sudo apt install qemu-guest-agent

    Check QEMU Guest Agent installed:

    systemctl status qemu-guest-agent.service

    Start QEMU Guest Agent service:

    sudo systemctl start qemu-guest-agent.service

    Turn the system off:

    sudo poweroff

    Check the QEMU Guest Agent of the VM in enabled in Proxmox (if not -> enable it). Then start the VM, check the QEMU Guest Agent started successfully:

    systemctl status qemu-guest-agent.service

    Conclusion

    You have successfully created and installed an Ubuntu Server VM on Proxmox VE. Your VM is now ready for further configuration and deployment of applications. Proxmox VE’s powerful management features will help you efficiently manage and scale your virtual environment, while Ubuntu Server provides a stable and versatile platform for your server needs.

    If you encounter any issues or need further assistance, both the Proxmox and Ubuntu communities offer extensive resources and support. Enjoy your new virtual server and the endless possibilities it brings to your homelab!

  • How to Install Proxmox Backup Server as a VM and backup to NAS

    Setting up a Proxmox Backup Server (PBS) as a virtual machine (VM) within Proxmox Virtual Environment (PVE) is a great way to manage your backups efficiently. This guide will walk you through the process of installing PBS as a VM and configuring it to back up your Proxmox VMs and LXC containers to a Network Attached Storage (NAS).

    Step 1: Prepare the Proxmox Backup Server ISO

    1. Download the ISO: First, download the Proxmox Backup Server ISO from the official Proxmox website.
    2. Upload the ISO to Proxmox: Navigate to your Proxmox web interface, go to the storage section, and upload the ISO file.
    Upload the Proxmox Backup Server ISO image to the Proxmox host

    Step 2: Create a Virtual Machine for Proxmox Backup Server

    1. Create a New VM: In the Proxmox web interface, click on “Create VM”.
    2. Configure VM Settings:
      • Node: Select the node where you want to create the VM.
      • VM ID: Assign a unique ID for the VM.
      • Name: Give your VM a name, e.g., ProxmoxBackupServer.
      • Check Start At Boot box to make sure the PBS automatically start when the system boot.
    3. OS Configuration:
      • ISO Image: Select the Proxmox Backup Server ISO you uploaded.
      • Guest OS Type: Choose Linux and Other Linux 6.x or higher kernel.
    4. System Configuration: leave it as default
    5. Hard Disk:
      • Bus/Device: Choose VirtIO Block.
      • Storage: Select your storage location.
      • Disk Size: Allocate sufficient disk space (e.g., 32GB or more).
      • SSD Emulation: checked.
    6. CPU:
      • Cores: Assign at least 2 cores.
      • Type: Set to host for better performance.
    7. Memory:
      • RAM: Allocate at least 4GB.
      • Ballooning Device: unchecked.
    8. Network:
      • Model: Choose VirtIO (paravirtualized).

    Step 3: Install Proxmox Backup Server

    1. Start the VM: Boot the VM from the ISO.
    2. Follow the Installation Wizard: Complete the installation by setting the root password, email, time zone, and network settings.
    3. Access the Web Interface: Once installed, access the PBS web interface via https://<PBS_IP>:8007.

    Step 4: Add a CIFS for SMB mount and Configure NAS for Backup Storage in Proxmox Backup Server

    Install CIFS Utils:

    After PBS installation finished, login (or SSH) as root and install CIFS Utils:

    apt install cifs-utils

    Create a Mount Directory:

    mkdir /mnt/omvnas

    Add SMB credentials to mount NAS:

    Create .smbcreds to store NAS login data:

    nano /etc/samba/.smbcreds

    Put the username and password to the file and Save (Ctrl+O, Enter, Ctrl+X):

    username=smb_usernamepassword=smb_password

    Change file permission to be read-only by root:

    chmod 400 /etc/samba/.smbcreds

    Mount the SMB Share:

    Create shared folder on OMVNAS, then mount it to the /mnt/omvnas folder. Remember to replace //IP-OF-NAS/SHARE-NAME to your actual NAS shared folder:

    mount -t cifs -o rw,vers=3.0,credentials=/etc/samba/.smbcreds,uid=34,gid=34 //IP-OF-NAS/SHARE-NAME /mnt/omvnas
    Step-by-Step Guide to Install OpenMediaVault on Proxmox and Enabling SMB Share
    A comprehensive guide for installing OpenMediaVault on Proxmox and setting up an SMB share for easy file sharing across your network

     

    Check if the shared folder is mounted successfully by make a new directory name “test” using the command in terminal, and check it appear in your NAS:

    mkdir /mnt/omvnas/test

    Make the Mount Persistent:

    Edit the fstab file to automatically mount the folder when the PBS server boot:

    nano /etc/fstab

    Add this line to the fstab file and Save. Remember to replace //IP-OF-NAS/SHARE-NAME to your actual NAS shared folder:

    //IP-OF-NAS/SHARE-NAME /mnt/omvnas cifs vers=3.0,credentials=/etc/samba/.smbcreds,uid=34,gid=34,defaults 0 0

    These steps will ensure your SMB share is mounted and accessible in Proxmox Backup Server.

    Step 5: Configure Proxmox Backup Server

    1. Initial Setup:
      • Login: Use the root credentials to log in.
      • Network Configuration: Ensure the network settings are correct.
    2. Create a Datastore:
      • Navigate to Datastore: In the PBS web interface, go to Datastore and create a new datastore.
      • Path: Specify the path where backups will be stored.

    Step 6: Add Proxmox Backup Server to Proxmox VE

    Add Storage in PVE
      • Navigate to Datacenter: In the Proxmox web interface, go to Datacenter > Storage.
      • Add Storage: Click on Add and select Proxmox Backup Server.
      • Configuration: Enter the PBS ID pbs-main, PBS IP , username (root@pam), password, and datastore namepbs-main.
      • Fingerprint: Paste the PBS fingerprint here (to get it: go to Proxmox Backup Server, under Configuration -> Certificates -> View Certificate , copy the Fingerprint)
    Copy the Fingerprint of Proxmox Backup Server

    Step 7: Configure Backup Jobs

    1. Create Backup Jobs:
      • Navigate to Datacenter: In the Proxmox web interface, go to Datacenter > Backup.
      • Add a New Job: Click on Add and configure the backup job.
      • Storage: choose the PBS storage created in the previous step: pbs-main
      • Schedule: Set the schedule for the backups.
      • Selection: Choose the VMs and LXC containers to back up.

    Step 9: Verify and Monitor Backups

    1. Run a Test Backup: Manually trigger a backup job to ensure everything is working correctly.
    2. Monitor Backups: Use the PBS web interface to monitor backup status and logs.

    By following these steps, you can efficiently set up a Proxmox Backup Server as a VM within Proxmox and configure it to back up your VMs and LXC containers to a NAS. This setup ensures that your data is securely backed up and easily recoverable in case of any issues.

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