Installing Portainer Business Edition with Docker

Introduction:
Portainer Business Edition offers advanced features and enterprise-grade capabilities for Docker container management. In this guide, we’ll walk you through the installation process for Portainer Business Edition using Docker.

Step 1: Stop Existing Portainer Container (Optional)

If you have an existing Portainer container that you want to replace, you can stop it using the following command:

docker stop portainer

Step 2: Create Docker Volume for Portainer Data

Create a Docker volume to store Portainer’s data persistently:

docker volume create portainer_data

Step 3: Install Portainer Business Edition

Run the Portainer Business Edition container with the following command:

docker run -d -p 9000:9000 \
  --name=portainer \
  --restart=always \
  --pull=always \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v portainer_data:/data \
  portainer/portainer-ee:latest

Explanation of options used:

  • -d: Run the container in the background (detached mode).
  • -p 9000:9000: Map port 9000 from the container to port 9000 on the host system. This allows you to access Portainer’s web interface at http://localhost:9000.
  • --name=portainer: Assign the name “portainer” to the container for easy management.
  • --restart=always: Configure the container to automatically restart if it stops unexpectedly.
  • --pull=always: Always pull the latest version of the Portainer Business Edition image before starting the container.
  • -v /var/run/docker.sock:/var/run/docker.sock: Mount the Docker socket on the host to the container. This allows Portainer to interact with the Docker engine on the host.
  • -v portainer_data:/data: Mount the Docker volume “portainer_data” to the “/data” directory inside the container. This volume stores Portainer’s data, ensuring persistence across container restarts.
  • portainer/portainer-ee:latest: Specifies the Docker image to use for running Portainer Business Edition.

Step 4: Access Portainer Web Interface

Once the Portainer container is up and running, open a web browser and navigate to http://localhost:9000. You will be directed to Portainer’s web interface. Follow the setup wizard to create an admin user and configure Portainer.

Congratulations! You have successfully installed Portainer Business Edition using Docker. With Portainer Business Edition’s advanced features, you can now manage your Docker containers and services with enhanced capabilities and support.

Experience the full potential of Docker management with Portainer Business Edition! Happy containerizing!




Installing Portainer Community Edition with Docker

Introduction:
Portainer is a powerful open-source container management tool that simplifies Docker deployment and administration. In this guide, we’ll walk you through the installation process for Portainer Community Edition using Docker.

Step 1: Stop Existing Portainer Container (Optional)

If you have an existing Portainer container that you want to replace, you can stop it using the following command:

docker stop portainer

Step 2: Create Docker Volume for Portainer Data

Create a Docker volume to store Portainer’s data persistently:

docker volume create portainer_data

Step 3: Install Portainer Community Edition

Run the Portainer Community Edition container with the following command:

docker run -d -p 9000:9000 \
  --name=portainer \
  --restart=always \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v portainer_data:/data \
  portainer/portainer-ce

Explanation of options used:

  • -d: Run the container in the background (detached mode).
  • -p 9000:9000: Map port 9000 from the container to port 9000 on the host system. This allows you to access Portainer’s web interface at http://localhost:9000.
  • --name=portainer: Assign the name “portainer” to the container for easy management.
  • --restart=always: Configure the container to automatically restart if it stops unexpectedly.
  • -v /var/run/docker.sock:/var/run/docker.sock: Mount the Docker socket on the host to the container. This allows Portainer to interact with the Docker engine on the host.
  • -v portainer_data:/data: Mount the Docker volume “portainer_data” to the “/data” directory inside the container. This volume stores Portainer’s data, ensuring persistence across container restarts.
  • portainer/portainer-ce: Specifies the Docker image to use for running Portainer Community Edition.

Step 4: Access Portainer Web Interface

Once the Portainer container is up and running, open a web browser and navigate to http://localhost:9000. You will be directed to Portainer’s web interface. Follow the setup wizard to create an admin user and configure Portainer.

Congratulations! You have successfully installed Portainer Community Edition using Docker. You can now start managing your Docker containers and services through the intuitive Portainer interface.

Enjoy the simplicity and power of Docker management with Portainer Community Edition! Happy containerizing!




Setting Up Pi-hole with Docker for Network-Wide Ad Blocking

Introduction:
Pi-hole is a popular network-level ad blocker that helps you block advertisements at the DNS level. With Docker, you can easily deploy Pi-hole on your network for ad-free browsing on all your connected devices. In this guide, we’ll walk you through the process of setting up Pi-hole using Docker.

Step 1: Install Pi-hole with Docker

To install Pi-hole and run it in Docker, execute the following command:

docker run -d --name=pihole \
  -e TZ=Europe/Copenhagen \
  -e WEBPASSWORD=xxxxxxx \
  -e SERVERIP=192.168.0.224 \
  -e FTLCONF_LOCAL_IPV4=192.168.0.227 \
  -v pihole_data:/etc/pihole \
  -v pihole_dnsmasq:/etc/dnsmasq.d \
  -p 81:80 \
  -p 53:53/tcp \
  -p 53:53/udp \
  --net=host \
  --restart=unless-stopped \
  pihole/pihole:latest

Explanation of options used:

  • -d: Run the container in the background (detached mode).
  • --name=pihole: Assign the name “pihole” to the container for easy management.
  • -e TZ=Europe/Copenhagen: Set the timezone to “Europe/Copenhagen” inside the container.
  • -e WEBPASSWORD=xxxxxxx: Set a custom web admin password for Pi-hole. Replace “xxxxxxx” with your desired password.
  • -e SERVERIP=192.168.0.224: Set the IP address of the Docker host (Raspberry Pi) where Pi-hole will run. Replace “192.168.0.224” with your Raspberry Pi’s IP address.
  • -v pihole_data:/etc/pihole: Create a Docker volume named “pihole_data” and mount it to the “/etc/pihole” directory inside the container. This volume allows you to persist Pi-hole’s data and configurations.
  • -v pihole_dnsmasq:/etc/dnsmasq.d: Create a Docker volume named “pihole_dnsmasq” and mount it to the “/etc/dnsmasq.d” directory inside the container. This volume is used to customize DNS settings and blocklists.
  • -p 81:80: Map port 80 from the container to port 81 on the host system. This allows you to access Pi-hole’s web interface at http://localhost:81.
  • -p 53:53/tcp -p 53:53/udp: Map port 53 from the container to both TCP and UDP port 53 on the host system. This enables Pi-hole to handle DNS requests. Or “–net=host \” for local network install.
  • --restart=unless-stopped: Configure the container to automatically restart if it stops unexpectedly.
  • pihole/pihole:v5.6: Specifies the Docker image to use for running Pi-hole (version 5.6).

Step 2: Access Pi-hole Web Interface

Once the Pi-hole container is up and running, open a web browser and navigate to http://localhost:81. You will be directed to Pi-hole’s web interface. Use the custom web admin password you set in the Docker command to log in.

Congratulations! You have successfully deployed Pi-hole on your network using Docker. Your network devices will now benefit from network-wide ad blocking, providing a seamless and ad-free browsing experience.

Remember to configure your devices to use your Raspberry Pi’s IP address (192.168.0.224) as the DNS server to take advantage of Pi-hole’s ad-blocking capabilities.

Enjoy ad-free browsing and network-level ad blocking with Pi-hole and Docker! Happy browsing!




Deploying Pi.Alert Application with Docker

Introduction:
Pi.Alert is a powerful application for Raspberry Pi that enables you to monitor and control your network devices. In this guide, we’ll walk you through the process of setting up Pi.Alert using Docker. We’ll cover two deployment options, each with its own configuration.

Step 1: Deploy Pi.Alert with Docker and Persistent Data

To deploy Pi.Alert with persistent data, use the following Docker command:

docker run --name pialert -d \
  -v pialert_data:/home/pi/pialert/db \
  -v pialert_config:/home/pi/pialert/config \
  --net=host \
  jokobsk/pi.alert:latest

Explanation of options used:

  • --name pialert: Assigns the name “pialert” to the container for easy management.
  • -d: Runs the container in the background (detached mode).
  • -v pialert_data:/home/pi/pialert/db: Creates a Docker volume named “pialert_data” and mounts it to the “/home/pi/pialert/db” directory inside the container to persist data.
  • -v pialert_config:/home/pi/pialert/config: Creates a Docker volume named “pialert_config” and mounts it to the “/home/pi/pialert/config” directory inside the container to provide configuration data.
  • --net=host: Utilizes the host’s network stack for efficient communication with other services on the Raspberry Pi.
  • jokobsk/pi.alert:latest: Specifies the Docker image to use for running the Pi.Alert application.

Step 2: Deploy Pi.Alert with Docker and Environment Variables

To deploy Pi.Alert with environment variables, use the following Docker command:

docker run --name pialert -d --network=host \
  -v pialert_config:/home/pi/pialert/config \
  -v pialert_data:/home/pi/pialert/db \
  -e TZ=Europe/Berlin \
  -e PORT=20211 \
  jokobsk/pi.alert:latest

Explanation of options used:

  • --name pialert: Assigns the name “pialert” to the container for easy management.
  • -d: Runs the container in the background (detached mode).
  • --network=host: Uses the host network stack for efficient communication with other services on the Raspberry Pi.
  • -v pialert_config:/home/pi/pialert/config: Creates a Docker volume named “pialert_config” and mounts it to the “/home/pi/pialert/config” directory inside the container to provide configuration data.
  • -v pialert_data:/home/pi/pialert/db: Creates a Docker volume named “pialert_data” and mounts it to the “/home/pi/pialert/db” directory inside the container to persist data.
  • -e TZ=Europe/Berlin: Sets the timezone to “Europe/Berlin” inside the container.
  • -e PORT=20211: Sets the environment variable “PORT” to the value “20211” inside the container.
  • jokobsk/pi.alert:latest: Specifies the Docker image to use for running the Pi.Alert application.

Remember to configure your network settings by adding “192.168.0.1/24” under settings and saving the changes before running the container.

Conclusion:
You have successfully deployed Pi.Alert on your Raspberry Pi using Docker. Whether you chose the option with persistent data or environment variables, Pi.Alert is now ready to help you monitor and manage your network devices.

Explore Pi.Alert’s features and start enhancing your network management capabilities today! Happy monitoring!




Automate Container Updates with Ouroboros and Pushover Notifications

Introduction:
Keeping your Docker containers up-to-date with the latest versions is crucial for security and optimal performance. In this guide, we’ll introduce you to Ouroboros, a powerful Docker container that automates the update process. Additionally, we’ll show you how to receive Pushover notifications about container updates, so you can stay informed in real-time.

Step 1: Install Ouroboros with Docker

To install Ouroboros and run it in Docker, execute the following command:

docker run -d --name=ouroboros --hostname=ouroboros --network=host --restart=always -v /var/run/docker.sock:/var/run/docker.sock -e CLEANUP=true -e TZ='Europe/Copenhagen' -e INTERVAL=1440 pyouroboros/ouroboros:latest -N 'pover://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?priority=0'

Explanation of options used:

  • -d: Run the container in the background (detached mode).
  • --name=ouroboros: Assign the name “ouroboros” to the container for easy management.
  • --hostname=ouroboros: Set the hostname for the container to “ouroboros.”
  • --network=host: Utilize the host’s network stack for efficient communication with other Docker containers.
  • --restart=always: Configure the container to automatically restart if it stops unexpectedly.
  • -v /var/run/docker.sock:/var/run/docker.sock: Mount the Docker daemon socket into the container to enable communication with the Docker daemon for updates.
  • -e CLEANUP=true: Enable automatic cleanup of unused images after updates to optimize disk space usage.
  • -e TZ='Europe/Copenhagen': Set the timezone for the container to “Europe/Copenhagen.” Adjust this according to your location.
  • -e INTERVAL=1440: Set the interval (in minutes) for checking updates. In this example, updates are checked every 1440 minutes (24 hours).
  • -N 'pover://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx?priority=0': Enable Pushover notifications for container updates. Replace the ‘xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’ with your actual Pushover user key.

Step 2: Receive Pushover Notifications

With Ouroboros set up, you will now receive real-time Pushover notifications about container updates. Ensure you have the Pushover app installed on your device and configure it with the appropriate priority to suit your needs.

Conclusion:

By deploying Ouroboros and integrating Pushover notifications, you’ve automated the process of updating Docker containers to their latest versions while staying informed about any changes. This proactive approach helps maintain a secure and high-performing containerized environment.

Enjoy hassle-free updates and timely notifications with Ouroboros and Pushover! Happy container management!




Running Homer Dashboard with Docker for Personal Start Page

Introduction:
Homer is a customizable personal start page that allows you to organize and access your frequently used bookmarks and services in one place. In this guide, we’ll show you how to set up Homer Dashboard using Docker, making it easy to manage and access your favorite links and services.

Step 1: Install Docker
Before proceeding, ensure you have Docker installed on your system. If you haven’t installed Docker yet, follow the official Docker installation instructions for your operating system.

Step 2: Run Homer Dashboard Docker Container
Run the following command to create and start the Homer Dashboard Docker container:

docker run -d --restart always --name homer -p 8090:8080 -v homer_data:/www/assets b4bz/homer:latest

Explanation of options used:

  • -d: Run the container in the background (detached mode).
  • --restart always: Configure the container to automatically restart if it stops unexpectedly.
  • --name homer: Assign the name “homer” to the container for easy management.
  • -p 8090:8080: Map port 8080 from the container to port 8090 on the host system. This allows you to access Homer Dashboard at http://localhost:8090.
  • -v homer_data:/www/assets: Create a Docker volume named “homer_data” and mount it to the /www/assets directory inside the container. This volume allows you to persist Homer Dashboard customizations and data.
  • b4bz/homer:latest: Use the latest Homer Dashboard Docker image from Docker Hub.

Step 3: Access Homer Dashboard Web Interface
Once the Homer Dashboard container is running, you can access the web interface by opening a web browser and navigating to http://localhost:8090.

Step 4: Customize Homer Dashboard
Homer Dashboard is highly customizable. You can add, remove, and organize bookmarks and services according to your preferences. Make sure to explore the settings and customize the dashboard to suit your needs.

Conclusion:
You’ve successfully set up Homer Dashboard using Docker, providing a convenient and personalized start page to access your frequently used links and services. With Docker, managing Homer Dashboard becomes easy and allows you to keep your customizations and data safe through the Docker volume.

Happy organizing and accessing your favorite links!




Setting Up Home Assistant with Docker for Home Automation

Introduction:
Home Assistant is an open-source home automation platform that enables you to control and automate various smart devices in your home. Docker makes it easy to deploy and manage Home Assistant. In this guide, we’ll show you how to set up Home Assistant using Docker.

Step 1: Install Docker
Before proceeding, ensure you have Docker installed on your system. If you haven’t installed Docker yet, follow the official Docker installation instructions for your operating system.

Step 2: Run Home Assistant Docker Container
Run the following command to create and start the Home Assistant Docker container:

docker run --restart always -d --name homeassistant -v homeassistant_data:/config -e TZ=Europe/Copenhagen --net=host ghcr.io/home-assistant/home-assistant:latest

Explanation of options used:

  • --restart always: Configure the container to automatically restart if it stops unexpectedly.
  • -d: Run the container in the background (detached mode).
  • --name homeassistant: Assign the name “homeassistant” to the container for easy management.
  • -v homeassistant_data:/config: Create a Docker volume named “homeassistant_data” and mount it to the /config directory inside the container. This volume allows you to persist Home Assistant configurations and data.
  • -e TZ=Europe/Copenhagen: Set the timezone for Home Assistant. Replace “Europe/Copenhagen” with your desired timezone.
  • --net=host: Use the host’s network stack to simplify network configuration. This is required for Home Assistant to communicate with local devices and services effectively.
  • ghcr.io/home-assistant/home-assistant:latest: Use the latest Home Assistant Docker image from the GitHub Container Registry (ghcr.io).

Step 3: Access Home Assistant Web Interface
Once the Home Assistant container is running, you can access the web interface by opening a web browser and navigating to http://localhost:8123 or http://<your_server_ip>:8123.

Step 4: Set Up Home Assistant
Follow the on-screen instructions to set up your Home Assistant instance. You’ll need to create an account and configure various settings to get started with home automation.

Conclusion:
You’ve successfully set up Home Assistant using Docker, allowing you to control and automate smart devices in your home. Docker provides a convenient way to manage and deploy Home Assistant, and with Home Assistant’s user-friendly interface, you can easily create customized automation routines and monitor your smart home devices.

Happy home automation!




Setting Up Grafana with Prometheus Data Source in Docker

Introduction:
Grafana is a popular open-source data visualization and monitoring tool. In this guide, we’ll show you how to set up Grafana using Docker and configure it to use Prometheus as a data source.

Step 1: Install Grafana with Docker
To install Grafana and run it in Docker, use the following command:

docker run -d --name=grafana -p 3000:3000 -v grafana_data:/data grafana/grafana

Explanation of options used:

  • -d: Run the container in the background (detached mode).
  • --name=grafana: Assign the name “grafana” to the container for easy management.
  • -p 3000:3000: Map port 3000 from the container to the host system. This allows you to access Grafana’s web interface at http://localhost:3000.
  • -v grafana_data:/data: Create a Docker volume named “grafana_data” and mount it to the /data directory inside the container. This volume allows you to persist Grafana’s data and configurations.

Step 2: Access Grafana Web Interface
Once the Grafana container is running, you can access the web interface by opening a web browser and navigating to http://localhost:3000.

Step 3: Change Default Admin Credentials
Log in to Grafana using the default admin credentials (username: “admin,” password: “admin”). You’ll be prompted to change the password upon initial login.

Step 4: Add Prometheus Data Source
To add Prometheus as a data source in Grafana, follow these steps:

  1. Click on the gear icon (Configuration) in the left sidebar, then select “Data Sources.”
  2. Click on the “Add data source” button.
  3. Choose “Prometheus” from the list of data sources.
  4. In the “HTTP” section, set the URL to the address of your Prometheus server, in this case, http://192.168.0.223:9090.
  5. Click “Save & Test” to verify the connection to Prometheus. If successful, you’ll see a green notification.

Step 5: Start Creating Dashboards
With Prometheus as the data source, you can start creating dashboards and visualizations in Grafana to monitor and analyze your data.

Conclusion:
You’ve successfully set up Grafana using Docker and configured it to use Prometheus as a data source. Grafana provides a user-friendly interface for visualizing data from various sources, and with Prometheus as a backend, you can easily create powerful monitoring dashboards.

Happy data visualization and monitoring!




Setting Up GlusterFS Distributed File System on Raspberry Pi Cluster

Introduction:
GlusterFS is a distributed file system designed to work across multiple nodes, providing high availability and scalability. In this guide, we’ll show you how to set up GlusterFS on a Raspberry Pi cluster to create a shared storage pool.

Note: Ensure you have configured the hosts file on the server and worker nodes, as mentioned in the instructions.

Step 1: Install GlusterFS
On the server and worker nodes, install GlusterFS with the following commands:

sudo apt update
sudo apt install -y glusterfs-server
sudo systemctl enable --now glusterd

Step 2: Peer All Nodes
From the master node (RPISWARM), peer all the nodes to the GlusterFS pool:

gluster peer probe RPIWORK1
gluster peer probe RPIWORK2
gluster peer probe RPIWORK3

Step 3: Create Gluster Volume
On the master node (RPISWARM), create the Gluster volume across the GlusterFS pool:

sudo mkdir -p /gluster/volumes
sudo gluster volume create staging-gfs replica 4 RPISWARM:/gluster/volumes RPIWORK1:/gluster/volumes RPIWORK2:/gluster/volumes RPIWORK3:/gluster/volumes force

Step 4: Start the Gluster Volume
On the master node (RPISWARM), start the Gluster volume:

sudo gluster volume start staging-gfs

Step 5: Auto Start GlusterFS Mount on Reboot
On the master node (RPISWARM), add an entry to the /etc/fstab file to auto-mount the GlusterFS volume:

sudo su
echo 'localhost:/staging-gfs /mnt glusterfs defaults,_netdev,backupvolfile-server=localhost 0 0' >> /etc/fstab
mount.glusterfs localhost:/staging-gfs /mnt
chown -R root:docker /mnt
exit

Step 6: Verify GlusterFS Mount
Verify that the GlusterFS volume is mounted with:

df -h
sudo mount.glusterfs localhost:/staging-gfs /mnt

Conclusion:
You’ve successfully set up GlusterFS on your Raspberry Pi cluster, creating a distributed file system that provides shared storage across multiple nodes. GlusterFS enables you to distribute data across the nodes, improving data availability and performance. With this configuration, you can leverage the power of GlusterFS to build resilient and scalable storage solutions for your Raspberry Pi cluster.

Happy distributed file system management!




Running Ghost Blog with Docker in Development Mode

Introduction:
Ghost is a popular open-source publishing platform designed for creating and managing blogs. With Docker, you can easily set up and run Ghost in a containerized environment. In this guide, we’ll show you how to run Ghost in development mode using Docker.

Step 1: Install Docker
Before proceeding, ensure you have Docker installed on your system. If you haven’t installed Docker yet, follow the official Docker installation instructions for your operating system.

Step 2: Run Ghost Blog Container
Run the following command to create and start the Ghost blog container in development mode:

docker run -d --restart always --name ghost -p 2368:2368 -v ghost_data:/var/lib/ghost/content -e NODE_ENV=development ghost:latest

Explanation of options used:

  • -d: Run the container in the background (detached mode).
  • --restart always: Configure the container to automatically restart if it stops unexpectedly.
  • --name ghost: Assign the name “ghost” to the container for easy management.
  • -p 2368:2368: Map port 2368 from the container to the host system. This allows you to access the Ghost blog from http://localhost:2368.
  • -v ghost_data:/var/lib/ghost/content: Create a Docker volume named “ghost_data” and mount it to the /var/lib/ghost/content directory inside the container. This volume allows you to persist Ghost blog data, including posts and images.
  • -e NODE_ENV=development: Set the environment variable NODE_ENV to “development.” This tells Ghost to run in development mode, which provides additional debugging information and enables certain development features.

Step 3: Access Ghost Blog
Once the Ghost blog container is running, you can access the blog by opening a web browser and navigating to http://localhost:2368. From here, you can set up and customize your Ghost blog.

Step 4: Clean Up (Optional)
If you want to stop and remove the Ghost blog container while preserving the data, use the following commands:

docker stop ghost
docker rm ghost

Conclusion:
You’ve successfully set up and run the Ghost blog in development mode using Docker. Ghost’s development mode allows you to test and experiment with your blog’s configuration and theme without affecting the production environment. Docker provides a portable and isolated environment for running Ghost, making it easy to manage and deploy your blog.

Happy blogging!