managing twingate

How to Deploy a Connector on a QNAP NAS

Install a Connector on a QNAP NAS device to enable remote access to your network

QNAP NAS devices, despite their name (“network attached storage”) aren’t only for adding shared storage on a network. QNAP NAS devices are actually servers that can provide a variety of different services beyond file sharing - and this includes hosting a Twingate Connector!

Installing a Twingate Connector on a QNAP NAS allows you to make the NAS, and any other device on the same network (e.g. computers, webcams, network-connected printers), remotely accessible in a manner that is more secure and easy than other options, like setting up a VPN server or port forwarding on a router.

QNAP devices run on an operating system called QTS, which is based on Linux. Let’s cover how to install and provision a Connector on QTS.

Prerequisites

Twingate configuration

Before we deploy the Connector to the QNAP, we need to create a new Twingate Remote Network. Let’s call it “Home” (pick “On Premise” or “Other” for the location parameter).

New Network
New Network

You will see two Connectors created by default in this new Remote Network. Click on Deploy Connector on one of these Connectors to obtain the configuration for our Docker deployment:

Deploy Connector
Deploy Connector

We will be deploying the standard Twingate Connector Docker container to the QNAP, so you can leave the default option selected.

Scroll down and click on Generate Tokens. You will need to re-authenticate before seeing the tokens.

Generate Tokens
Generate Tokens

Scroll down to the bottom of the page and copy the docker run command to a text editor as we will need to use some of these values in the Docker container setup on the QNAP side. You can leave this page open while you deploy the Connector.

Deploy a Connector

Login to your QNAP device and open Container Station; within it, create the Twingate container by clicking the Create button and searching for “Twingate”:

Install Image
Install Image

Once you have located the twingate/connector image, click Install; then select latest as the image version:

Select Image Version
Select Image Version

In the next screen, use the Connector name in the Name setting. Set CPU & Memory Limit to your desired value (and depending on the physical resources available on your particular QNAP device).

Select Image Version
Select Image Version

Next, click Advanced Settings at the bottom of the page. This is where we will be configuring the settings required to connect and authenticate the Connector with Twingate:

Select Image Version
Select Image Version

From within the advanced settings, go to the Environment section.

Add Variables
Add Variables

Add three of the environment variables from the docker run command retrieved previously:

  • TWINGATE_NETWORK
  • TWINGATE_ACCESS_TOKEN
  • TWINGATE_REFRESH_TOKEN
Add Variables
Add Variables

Next, click on Network. Below is an example of a network configuration, which you may want to alter depending on your setup and requirements. The hostname can be whatever you like, and as an example we will use the Connector name as the hostname:

Container Network
Container Network

This concludes the configuration part. Click the continue and OK button to spin up the container.

Run the container

With all the settings now in place, Container Station downloads the Connector image and sets it up on the QNAP device:

Downloading Container
Downloading Container

After a few moments, the container starts running:

Running Container
Running Container

If you click on the container you should see that it has started and the Connector within it successfully authenticated with Twingate:

Container Logs
Container Logs

Head back over to your Twingate Admin Console, and you should see that the Connector is now connected:

Check Connection
Check Connection

You can now access your network with a device that has a Twingate Client installed and is signed into your Twingate account. In order to access the QNAP NAS, you need to add it as a Resource in the Twingate Admin Console, using the IP address you would use to access it when you are directly connected to the local network it’s on. You can follow the Resources guide for more information on how to add Resources.

Last updated 21 days ago