This guide is opinionated, primarily aimed at [[Homelab]]s with a preference to [[LXC]] (system container) workloads, instead of application container workloads ([[Docker]], [[Kubernetes]], etc).
[[Traefik-Proxy]] is written in [[Go]] and is available as a single binary, making installation a very simple affair.
# [[7. PVE 8.x - Create LXC (CT)#Create LXC using webUI|Create LXCu]]
Follow the [[7. PVE 8.x - Create LXC (CT)#Create LXC using webUI|guide]] using the settings below. [[LXC]]s will only use the resources required, not the resources assigned.
<span class="fieldname">Template:</span> Debian 12
<span class="fieldname">Disk:</span> 32G
<span class="fieldname">CPU:</span> 2
<span class="fieldname">Memory:</span> 2048
<span class="fieldname">Swap:</span> 0
<span class="fieldname">Network:</span> static [[IPv4]]: <code class="o-code">192.168.0.11/24</code>
# [[4. Debian - Setup|Setup Debian]]
<button class="login-root">🖥>login</button> <code class="login-root">root</code> and follow the [[4. Debian - Setup|guide]] for a minimum setup (timezone and update).
# Install [[Traefik-Proxy]]
[Visit](https://github.com/traefik/traefik/releases) the [[Traefik-Proxy]] [[GitHub]] repository to grab the latest software image.
Copy the Link Address of the software image applicable to your environment.
![[traefik-proxy-install-0.png]]
In the [[Traefik-Proxy]] [[LXC]] type the following commands:
wget https://github.com/traefik/traefik/releases/download/v3.0.2/traefik_v3.0.2_linux_amd64.tar.gz - just replace the https: string with the earlier copied Link Address.
<code class="g-code">tar -zxvf traefik_v3.0.2_linux_amd64.tar.gz</code>
Below is a suggested directory structure. Use your own if you wish.
<code class="g-code">mv ./traefik /usr/local/bin</code> - where the single binary [[Traefik-Proxy]] executable is saved
<code class="g-code">mkdir /etc/traefik</code> - we will save a single static config file and all certificates in this directory
<code class="g-code">mkdir /etc/traefik/dynamic</code> - all dynamic config files will be saved in this directory
<code class="g-code">touch /etc/traefik/acme.json</code> - create a cert-store file to save all [[LE]] certificates
<code class="g-code">chmod 600 /etc/traefik/acme.json</code> - secure the [[LE]] cert-store file; [[Traefik-Proxy]] will not start unless this is done
> [!cli]+ <code class="g-code">nano /etc/traefik/traefik.yaml</code>
> Simple static config file to test [[Traefik-Proxy]]; a reminder, no [[Docker]] considerations at any point in this guide.
>
> - Consider enabling anonymous usage statistics to support and strengthen the [[Traefik-Proxy]] project
> - DEBUG will display debug messages in the console while [[Traefik-Proxy]] is running;
> - any YAML file in `/etc/traefik/dynamic` will be processed real-time by [[Traefik-Proxy]], and therefore allowing on-the-fly configuration changes of routes, services, middleware, tls and server transports
> - simple and insecure HTTP and HTTPS entryPoints
> - insecure dashboard and API access enabled
> - the config files are YAML formatted and therefore sensitive to spacing; if you get the spacing wrong, [[Traefik-Proxy]] will throw an error providing a line number reference, which in my experience is always inaccurate; in such cases you need to carefully scan your entire config for incorrect spacing, missing quotation marks, etc. Alternatively you could opt to use a different format to YAML.
>
> ```YAML
>#------------: https://doc.traefik.io/traefik/contributing/data-collection/
>global:
> checkNewVersion: true
> sendAnonymousUsage: true
>
>#------------: https://doc.traefik.io/traefik/operations/api/
> api:
> dashboard: true
> insecure: true
> debug: true
> disableDashboardAd: false
>
>#------------: https://doc.traefik.io/traefik/observability/logs/
>log:
> level: DEBUG # TRACE DEBUG INFO WARN ERROR FATAL PANIC
>
>#------------: https://doc.traefik.io/traefik/routing/entrypoints/
>entryPoints:
> http:
> address: ":80"
> https:
> address: ":443"
>
>#------------: https://doc.traefik.io/traefik/providers/file/
>providers:
> file:
> directory: /etc/traefik/dynamic
> watch: true
>```
<code class="g-code">traefik</code> - start [[Traefik-Proxy]]
# Test [[Traefik-Proxy]]
<code class="o-code">http://192.168.0.11:8080/dashboard/</code>
![[traefik-proxy-install-1.png]]
If everything went according to plan you now have a solid foundation to build your reverse-proxy operations. Learn the [[Traefik-Proxy]] basics in the [[Traefik-Proxy 3.x - Setup]] guide.
![[Traefik-Proxy#References]]
# Follow or Support me -> <a href='https://ko-fi.com/S6S0K9U5Q' target='_blank'><img height='36' style='border:0px;height:36px;float:right; ' src='https://storage.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>