How to create a cloudflared Docker Container on Synology NAS

12 min read

Step 1: Install Docker on your Synology NAS

Before you can create a Docker container, you need to first install Docker on your Synology NAS. To do this, go to the Synology Package Center and search for Docker. Install Docker from the list of available packages.

Step 2: Create a new Docker container

After installing Docker, you can create a new container by going to the Docker application and selecting "Container". Click "Create" and choose a name for your container.

Step 3: Configure the container settings

Once you have created the container, you will need to configure its settings. Go to the "Settings" tab and make sure the "Enable auto-restart" option is checked. You can also configure the CPU and memory settings based on your needs.

Step 4: Install and configure cloudflared

Next, you will need to install and configure the cloudflared tool in the container. To do this, open the terminal in the container and run the following command:

curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-stable-linux-amd64.tgz | tar xz

This command will download the cloudflared package and extract it to the current directory. Next, you need to configure cloudflared by running the following command:

./cloudflared tunnel login

This command will prompt you to enter your Cloudflare account credentials. Once you have logged in, you can create a new tunnel by running the following command:

./cloudflared tunnel create mytunnel

Replace "mytunnel" with a name for your tunnel.

Step 5: Start the tunnel

Finally, you can start the tunnel by running the following command:

./cloudflared tunnel run mytunnel

This command will start the tunnel and make your Synology NAS accessible via Cloudflare's network.

That's it – you have now created a cloudflared Docker container on your Synology NAS. This will allow you to access your Synology NAS securely from anywhere in the world via Cloudflare's network.