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.
Peer-to-peer connections help you to provide a better experience for your users and to stay within the Fair Use Policy for bandwidth consumption. Learn how to support peer-to-peer connections.
Prerequisites
-
Twingate account (our Starter plan is free for small projects)
-
QNAP device setup and configured, see QNAP’s getting started guide
-
Container Station deployed and setup on QNAP
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).
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:
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.
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”:
Once you have located the twingate/connector image, click Install; then select latest as the 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).
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:
From within the advanced settings, go to the Environment section.
Add three of the environment variables from the docker run command retrieved previously:
TWINGATE_NETWORKTWINGATE_ACCESS_TOKENTWINGATE_REFRESH_TOKEN
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:
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:
After a few moments, the container starts running:
If you click on the container you should see that it has started and the Connector within it successfully authenticated with Twingate:
Head back over to your Twingate Admin Console, and you should see that the Connector is now connected:
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