Skip to main content

02. Installation with Caddy Reverse Proxy on OPNSense

Installation: Official Documentation

Alrigthie then! You want to install Netbird in your homelab such that you can safely access all your applications from the outside world ;) Now, there are two methods either install it with a reverse proxy included or behind an existing reverse proxy such as the Caddy reverse proxy (OPNSense plugin installation is here). Now, they both have their pros and cons, but in this tutorial we will install it behind Caddy on OPNSense. One of the reasons you might like to install Netbrid behind your Caddy reverse proxy is because you can then handle all your networking on your OPNSense box instead of being depended on your server as well. 

1. The first thing you want to do is SSH into a Docker VM you want to install Netbird on, which could simply be your DockerVM on which you also deploy all your applications. If you don't deploy your applications with a DockerVM then you could create a dedicated Netbird VM for this. For instance if you are running a "One Click Deployment Workflow" e.g ZimaOS etcetera for your deploying your applications.

2. Once, inside the VM we will create a new folder at a location of your pleasing. If you have installed Arcane as a docker dashboard then we recommend creating the netbird folder in the Arcane projects folder

3. Then cd into the folder and run the Netbird Installation script by copy pasting in their command which will walk you through the installation process. Even though we try to keep pages up to date if the command does not work check their official documentation if it is has changed and then please adjust it here ;) 

curl -fsSL https://github.com/netbirdio/netbird/releases/latest/download/getting-started.sh | bash

4. The first question will be the domain name you will use to access your Netbird's instance. Make sure you pointed this domain e.g netbird.example.org to your home's IP address. This must be done on the Domain Registrar of the domain!

6. Then the next question will ask you if you want to use an existing reverse proxy or not

Which reverse proxy will you use?
  [0] Traefik (recommended - automatic TLS, included in Docker Compose)
  [1] Existing Traefik (labels for external Traefik instance)
  [2] Nginx (generates config template)
  [3] Nginx Proxy Manager (generates config + instructions)
  [4] External Caddy (generates Caddyfile snippet)
  [5] Other/Manual (displays setup documentation)

Enter choice [0-5] (default: 0):

7. Well in the case of Caddy you will answer this question with 4

8. Then 

 

11. After the installation it will leave you with a Caddy

OPNSense

Perfect! Now, the installation of Netbird on the DockerVM is done, then now we need to tell our Caddy server on our OPNSense box to forward traffic to it via the caddy.text file that was created in the installation process.

1. First open the NetBird Caddyfile Snippet with 

nano