Creating a Docker Container on a Peplink Device

Some Peplink devices have the ability to support features like KVM, caching (MediaFast), hosting (ContentHub), and Docker. If you're unfamiliar with Docker, it's a platform that allows you to run applications in containers on just about any host device in existence. 

In this article, we're going to show you how to start, run, and manage a Docker container (AdGuard Home in this example) on a Peplink device. 

Does my Peplink device support Docker? 

In order to determine if your Peplink device has Edge Computing capabilities (this is what Peplink calls the suite of capabilities that includes Docker), you can check the Peplink device comparison tool:

 

Screenshot 2024-12-06 at 7.31.37 PM.png

Simply select the device(s) you have and then scroll down to the bottom while looking for the "Edge Computing" row:

Screenshot 2024-12-06 at 7.33.33 PM.png

As you see above, if Edge Computing is marked "Yes" and it shows Docker in the parenthesis, you're good to go! 

Note: Some Peplink devices that support Docker do not have onboard storage to host Docker containers. These devices will have USB ports where you can connect a thumb drive or external hard drive. 

 

Lab Design

Our lab for this project is pretty straightforward. We have a Peplink BR2 Pro (which supports Docker and has onboard storage), a Raspberry Pi we will be using as a test client device, and a connection to the internet via the BR2's WAN port. No special configurations are required on this device for this lab.

Topology

Blank diagram.png

Network Design

We are using a single network/subnet, similar to how the Peplink device is configured by default. In our case, we are using 192.168.51.0/24 where 192.168.51.1 is the Peplink's IP address and 192.168.51.5 is the IP address we will be assigning to our docker container.

DHCP will be managed by the Peplink as normal, and we will show you how to update the DHCP offer to include the AdGuard Home DNS server as part of this guide.

 

Prerequisites

  • A Peplink device with Edge Compute (Docker) capabilities
  • External USB storage (if your Peplink device does not have onboard storage for Edge Compute)
  • An internet connection to your Peplink device
  • Your Peplink device is in an InControl2 account where you have Administrator privileges
  • (Optional, but helpful) Local device administrative access either locally or via InControl2
  • (Optional, but helpful) A basic understanding of Docker and using Docker Run

Code we will be using

We will only be using a docker run command. See below:

docker run --name adguardhome\
    --restart unless-stopped\
    --ip 192.168.51.5\
    -v /workdir:/opt/adguardhome/work\
    -v /confdir:/opt/adguardhome/conf\
    -p 53:53/tcp -p 53:53/udp\
    -p 80:80/tcp -p 443:443/tcp -p 443:443/udp -p 3000:3000/tcp\
    -p 853:853/tcp\
    -p 784:784/udp -p 853:853/udp -p 8853:8853/udp\
    -p 5443:5443/tcp -p 5443:5443/udp\
    -d adguard/adguardhome

The majority of the command comes from the Docker Hub listing for AdGuard Home with a few small changes:

  • Added '--ip 192.168.51.5' to give our container a fixed IP address.
    Note: Peplink does not allow Docker containers to use the host network, so we are forced to assign an IP address to the container in this manner. We are also not required to use the '--network' flag as, for this guide, we want the container to be on the native, untagged VLAN. 
  • Removed '-p 67:67/udp -p 68:68/tcp -p 68:68/udp' as we will not be using this container as a DHCP server

Step-by-Step Guide

If you want to view this guide full-screen and not embedded in the article here, click here.

 



Have more questions? Submit a request