pi-hole:setup_pi-hole_running_in_a_container_on_qnap_container_station
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pi-hole:setup_pi-hole_running_in_a_container_on_qnap_container_station [2020/07/24 10:33] – 185.104.185.238 | pi-hole:setup_pi-hole_running_in_a_container_on_qnap_container_station [2021/04/21 22:00] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Pi-Hole - Setup Pi-Hole running in a container on QNAP Container Station ====== | ====== Pi-Hole - Setup Pi-Hole running in a container on QNAP Container Station ====== | ||
+ | ===== Create an Ubuntu LXC Container ===== | ||
On the QNAP | On the QNAP | ||
Line 7: | Line 8: | ||
* Select the **Create** option from the left side of the menu and then scroll to the bottom of the window. | * Select the **Create** option from the left side of the menu and then scroll to the bottom of the window. | ||
* There are several types of Docker and LXC containers listed. | * There are several types of Docker and LXC containers listed. | ||
- | * Choose the LXC Ubuntu 18.04 container. | + | * Choose the **LXC** Ubuntu 18.04 container. |
- | * That's the underlying OS for the QNAP QTS Operating System on the NAS. | + | * Name the container, such as " |
- | * Nme the container " | + | * The memory can be set higher if needed. |
- | Then click on **Advanced Settings**. | + | {{: |
+ | |||
+ | <WRAP info> | ||
+ | **NOTE:** A LXC container is used instead of a Docker container. | ||
+ | |||
+ | LXC containers are not just an application instance. | ||
+ | |||
+ | * An LXC Container runs an OS instance, such as Ubuntu, on which you can install one or more applications. | ||
+ | * The LXC container uses a minimal amount of system resources. | ||
+ | * The OS the container runs can easily be updated. | ||
+ | * The applications running in the OS can easily be updated. | ||
+ | * To update Pi-Hole is as easy as running the standard **pihole -up** command. | ||
+ | |||
+ | Docker containers run a single application installation. | ||
+ | |||
+ | * A Docker Container is based upon a package image, and are therefore not as easy to modify. | ||
+ | * To update Pi-Hole, you would have to create a new container when a new version of Pi-Hole is released. | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | Click on **Advanced Settings**. | ||
* Change the network mode to **Bridge**. | * Change the network mode to **Bridge**. | ||
* Select **Use Static IP** and change the IP address to a unique address on your LAN. | * Select **Use Static IP** and change the IP address to a unique address on your LAN. | ||
+ | * In this example, 192.168.1.25 is used. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | Return to the **Overview** section in Container Station and after a few minutes you should see your container listed. | ||
+ | |||
+ | Click on the name of the container, which will enter the console. | ||
+ | |||
+ | Type **passwd** to change the password. | ||
- | Go back to the **Overview** section in Container Station and after a few minutes you should see your container listed. | + | <WRAP info> |
+ | **NOTE: | ||
+ | </ | ||
- | Click on the name of the container and you will enter the console. | ||
- | Type **passwd** to change the password. | + | ---- |
- | Before we can install Pi-hole, we need to update this very lightweight | + | ===== Update and Configure the Ubuntu |
- | First run updates: | + | Update Ubuntu: |
<code bash> | <code bash> | ||
- | sudo apt-get update | + | sudo apt update |
</ | </ | ||
- | Next install | + | Install |
<code bash> | <code bash> | ||
- | sudo apt-get install -y openssh-server | + | sudo apt install -y openssh-server |
</ | </ | ||
- | Now add a username other than the default. | + | Add a username other than the default. |
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
<code bash> | <code bash> | ||
Line 42: | Line 80: | ||
</ | </ | ||
- | Now grant the new user privilege: | + | Grant the new user root privileges: |
<code bash> | <code bash> | ||
Line 48: | Line 86: | ||
</ | </ | ||
- | Open a terminal back on your desktop computer and " | + | ---- |
+ | |||
+ | ===== SSH into the Ubuntu LXC Container ===== | ||
+ | |||
+ | " | ||
<code bash> | <code bash> | ||
Line 63: | Line 105: | ||
<code bash> | <code bash> | ||
- | sudo apt-get install curl | + | sudo apt install curl |
</ | </ | ||
- | Now you can install | + | Install |
<code bash> | <code bash> | ||
Line 72: | Line 114: | ||
</ | </ | ||
- | Select | + | <WRAP alert> |
+ | **ALERT: | ||
- | Accept all the rest of the defaults and be careful not to change them. This will assure | + | There is no guarantee |
- | The installation will continue for a few minutes after you answer | + | To be extra secure, |
- | After your installation completes, | + | <code bash> |
+ | curl -sSL https:// | ||
+ | </ | ||
+ | |||
+ | Then review the script yourself to ensure you are happy with it. | ||
+ | |||
+ | Then install it (making sure it has the right permissions to run). | ||
+ | |||
+ | <code bash> | ||
+ | chmod 777 pihole.sh | ||
+ | bash pihole.sh | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | Select the defaults until the DNS screen and then choose Cloudflare as the DNS. | ||
+ | |||
+ | * Accept all the rest of the defaults. | ||
+ | * The installation will continue for a while. | ||
+ | * When the installation completes, a message | ||
+ | * So log into your router and point the DNS settings to the IP address of this container. | ||
- | That will insert the Pi-Hole as the " | ||
When you return to the prompt in the " | When you return to the prompt in the " | ||
Line 88: | Line 151: | ||
</ | </ | ||
- | You can now close the " | + | <WRAP info> |
+ | **NOTE: | ||
+ | </ | ||
- | Go to your web browser | + | |
+ | ---- | ||
+ | |||
+ | ===== Access the Pi-Hole Website ===== | ||
+ | |||
+ | Within a web browser, enter the IP address of your Pi-Hole followed by /admin: | ||
<code bash> | <code bash> | ||
- | http://172.16.1.5/admin | + | http://192.168.1.25/admin |
</ | </ | ||
- | Select the login and you should be able to log in with the password you just set. | + | Click **login** and you should be able to log in with the password you just set. |
- | Since this is a " | + | <WRAP info> |
+ | **NOTE: | ||
+ | </ | ||
- | This LXC container is very lean and uses a minimal amount of system resources. | ||
- | Don' | + | <WRAP important> |
+ | **IMPORTANT: | ||
A good practice is to make the Pi-Hole DNS 1 and then Cloudflare 1.1.1.1 as DNS 2. | A good practice is to make the Pi-Hole DNS 1 and then Cloudflare 1.1.1.1 as DNS 2. | ||
That will assure DNS translation when your Pi-Hole is not running. | That will assure DNS translation when your Pi-Hole is not running. | ||
+ | |||
+ | </ | ||
---- | ---- |
pi-hole/setup_pi-hole_running_in_a_container_on_qnap_container_station.1595583207.txt.gz · Last modified: 2020/07/24 10:33 by 185.104.185.238