<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Архивы Traefik - Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</title>
	<atom:link href="https://boxvirt.com/category/traefik/feed/" rel="self" type="application/rss+xml" />
	<link>https://boxvirt.com/category/traefik/</link>
	<description>Practical self-hosted infrastructure guides for Proxmox, OPNsense, and Docker.</description>
	<lastBuildDate>Sat, 02 Aug 2025 21:48:50 +0000</lastBuildDate>
	<language>ru-RU</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://boxvirt.com/wp-content/uploads/2025/07/cropped-ChatGPT-Image-12-июл.-2025-г.-19_41_55-32x32.png</url>
	<title>Архивы Traefik - Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</title>
	<link>https://boxvirt.com/category/traefik/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Ultimate Guide: Setting Up Traefik as a Reverse Proxy in Docker (with Let&#8217;s Encrypt, Cloudflare, and Secure Services)</title>
		<link>https://boxvirt.com/ultimate-guide-setting-up-traefik-as-a-reverse-proxy-in-docker-with-lets-encrypt-cloudflare-and-secure-services/</link>
					<comments>https://boxvirt.com/ultimate-guide-setting-up-traefik-as-a-reverse-proxy-in-docker-with-lets-encrypt-cloudflare-and-secure-services/#respond</comments>
		
		<dc:creator><![CDATA[eXtre]]></dc:creator>
		<pubDate>Sat, 02 Aug 2025 21:48:49 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Traefik]]></category>
		<category><![CDATA[Setup]]></category>
		<guid isPermaLink="false">https://boxvirt.com/?p=134</guid>

					<description><![CDATA[<p>Introduction: Why a Reverse Proxy? In modern self-hosted environments, you&#8217;re often running multiple services — like a photo gallery (e.g., Immich), media server (e.g., Jellyfin), and dashboards. If [&#8230;]</p>
<p>Сообщение <a href="https://boxvirt.com/ultimate-guide-setting-up-traefik-as-a-reverse-proxy-in-docker-with-lets-encrypt-cloudflare-and-secure-services/">Ultimate Guide: Setting Up Traefik as a Reverse Proxy in Docker (with Let&#8217;s Encrypt, Cloudflare, and Secure Services)</a> появились сначала на <a href="https://boxvirt.com">Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">Introduction: Why a Reverse Proxy?</h3>



<p>In modern self-hosted environments, you&#8217;re often running multiple services — like a photo gallery (e.g., Immich), media server (e.g., Jellyfin), and dashboards. If all these services expose themselves directly on different ports, things quickly get messy. Enter the reverse proxy.</p>



<p>A reverse proxy routes incoming HTTP/HTTPS traffic to the right container based on domain or path. It allows you to:</p>



<ul class="wp-block-list">
<li>Use <strong>pretty domain names</strong> like <code>photos.example.com</code></li>



<li>Enforce <strong>HTTPS with Let&#8217;s Encrypt</strong></li>



<li>Route requests internally by hostname instead of IP and port</li>



<li>Apply <strong>access control, rate limits</strong>, or <strong>basic authentication</strong> centrally</li>
</ul>



<p>And Traefik does all that, <strong>automatically</strong>, with minimal config.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f680.png" alt="🚀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why Traefik Over Nginx?</h3>



<p>While Nginx is popular and powerful, it&#8217;s static by default. Every new service requires you to edit config files and reload.</p>



<p>Traefik, on the other hand:</p>



<ul class="wp-block-list">
<li>Automatically discovers Docker containers</li>



<li>Supports <strong>dynamic routing</strong> using Docker labels</li>



<li>Comes with built-in <strong>Let&#8217;s Encrypt integration</strong></li>



<li>Has a <strong>web dashboard</strong> to visualize routes</li>



<li>Requires <strong>minimal config</strong></li>
</ul>



<p>Traefik was <strong>designed for containerized environments</strong> from the start.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/2699.png" alt="⚙" class="wp-smiley" style="height: 1em; max-height: 1em;" /> How Traefik Works Internally</h3>



<p>Traefik is composed of three key concepts:</p>



<h4 class="wp-block-heading">1. <strong>EntryPoints</strong></h4>



<p>These define which ports Traefik listens on (e.g., <code>:80</code>, <code>:443</code>). You can think of these as your public gateways.</p>



<h4 class="wp-block-heading">2. <strong>Routers</strong></h4>



<p>Routers match incoming requests (host, path, method) and forward them to services. They also define TLS settings and middleware.</p>



<h4 class="wp-block-heading">3. <strong>Services</strong></h4>



<p>These are the actual Docker containers (or upstream backends) that respond to the requests.</p>



<h4 class="wp-block-heading">4. <strong>Middlewares</strong> (Optional)</h4>



<p>These are like plugins: things that transform requests (e.g., strip path, redirect HTTP to HTTPS, basic auth, etc).</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f4e6.png" alt="📦" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Installing Traefik with Docker Compose</h3>



<p>Let’s build a fully functional Traefik setup using Docker Compose.</p>



<pre class="wp-block-code"><code>docker-compose.yml
<code>version: '3.9'

services:
  traefik:
    image: traefik:v3.0
    container_name: traefik
    command:
      - --api.dashboard=true
      - --api.insecure=false
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false
      - --certificatesresolvers.cloudflare.acme.dnschallenge=true
      - --certificatesresolvers.cloudflare.acme.dnschallenge.provider=cloudflare
      - --certificatesresolvers.cloudflare.acme.email=you@example.com
      - --certificatesresolvers.cloudflare.acme.storage=/letsencrypt/acme.json
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./letsencrypt:/letsencrypt
    environment:
      - CF_API_EMAIL=you@example.com
      - CF_API_KEY=your_cloudflare_api_key
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.rule=Host(`traefik.yourdomain.com`)"
      - "traefik.http.routers.traefik.entrypoints=websecure"
      - "traefik.http.routers.traefik.tls.certresolver=cloudflare"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.middlewares.traefik-auth.basicauth.users=admin:$$apr1$$6yLkU..."
      - "traefik.http.routers.traefik.middlewares=traefik-auth"</code></code></pre>



<p>You also need to create the directory <code>./letsencrypt</code> and touch <code>acme.json</code> with permissions <code>600</code>.</p>



<pre class="wp-block-code"><code>mkdir letsencrypt
chmod 600 letsencrypt/acme.json</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f510.png" alt="🔐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Securing the Dashboard</h3>



<p>Never expose the dashboard to the public without auth. Use basic auth like above or restrict access to specific IPs.</p>



<p>Alternative example:</p>



<pre class="wp-block-code"><code><code>- "traefik.http.routers.traefik.middlewares=dashboard-auth"
- "traefik.http.middlewares.dashboard-auth.basicauth.usersfile=/users.htpasswd"</code></code></pre>



<p>Generate passwords with:</p>



<pre class="wp-block-code"><code>htpasswd -nb admin strongpassword</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f30d.png" alt="🌍" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Deploying a Sample Service Behind Traefik</h3>



<pre class="wp-block-code"><code><code>services:
  whoami:
    image: traefik/whoami
    container_name: whoami
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.whoami.rule=Host(`whoami.yourdomain.com`)"
      - "traefik.http.routers.whoami.entrypoints=websecure"
      - "traefik.http.routers.whoami.tls.certresolver=cloudflare"</code></code></pre>



<p>Start both containers:</p>



<pre class="wp-block-code"><code>docker compose up -d</code></pre>



<p>Now visit <code>https://whoami.yourdomain.com</code> — you’ll see the container response.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f527.png" alt="🔧" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Additional Features to Explore</h3>



<ul class="wp-block-list">
<li>Middleware: redirect, stripPrefix, basicAuth</li>



<li>Rate-limiting</li>



<li>Retry and load balancing</li>



<li>Redirect HTTP to HTTPS automatically</li>



<li>Wildcard TLS certificates</li>



<li>Forward headers to preserve real IP</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f4d8.png" alt="📘" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Conclusion</h3>



<p>Traefik makes deploying, securing, and managing multiple services in Docker easy and dynamic. With a few Docker labels and one compose file, you get:</p>



<ul class="wp-block-list">
<li>Auto-routing by domain</li>



<li>HTTPS with Let&#8217;s Encrypt</li>



<li>Centralized auth and middleware</li>



<li>Visibility via dashboard</li>
</ul>



<p>Traefik replaces hours of nginx tinkering with a <strong>declarative, scalable, and elegant</strong> solution.</p>
<p>Сообщение <a href="https://boxvirt.com/ultimate-guide-setting-up-traefik-as-a-reverse-proxy-in-docker-with-lets-encrypt-cloudflare-and-secure-services/">Ultimate Guide: Setting Up Traefik as a Reverse Proxy in Docker (with Let&#8217;s Encrypt, Cloudflare, and Secure Services)</a> появились сначала на <a href="https://boxvirt.com">Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://boxvirt.com/ultimate-guide-setting-up-traefik-as-a-reverse-proxy-in-docker-with-lets-encrypt-cloudflare-and-secure-services/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Running Traefik in an LXC Container (Part 2): Docker Integration &#038; Service Discovery</title>
		<link>https://boxvirt.com/running-traefik-in-an-lxc-container-part-2-docker-integration-service-discovery/</link>
					<comments>https://boxvirt.com/running-traefik-in-an-lxc-container-part-2-docker-integration-service-discovery/#respond</comments>
		
		<dc:creator><![CDATA[eXtre]]></dc:creator>
		<pubDate>Sun, 27 Jul 2025 09:21:37 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Proxmox]]></category>
		<category><![CDATA[Traefik]]></category>
		<category><![CDATA[LXC Container]]></category>
		<guid isPermaLink="false">https://boxvirt.com/?p=95</guid>

					<description><![CDATA[<p>Introduction Modern web infrastructure demands seamless automation, flexible security, and robust observability across every layer. Traefik, with its dynamic routing and native cloud provider integrations, is a top-tier [&#8230;]</p>
<p>Сообщение <a href="https://boxvirt.com/running-traefik-in-an-lxc-container-part-2-docker-integration-service-discovery/">Running Traefik in an LXC Container (Part 2): Docker Integration &amp; Service Discovery</a> появились сначала на <a href="https://boxvirt.com">Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="introduction">Introduction</h2>



<p>Modern web infrastructure demands seamless automation, flexible security, and robust observability across every layer. Traefik, with its dynamic routing and native cloud provider integrations, is a top-tier reverse proxy for cutting-edge self-hosted setups. In this continuation, we explore comprehensive configurations to run Traefik as a production-grade proxy with full automation for SSL, dynamic configuration reloading, and managed service control via systemd inside an LXC container.</p>



<h2 class="wp-block-heading" id="essential-building-blocks">Essential Building Blocks</h2>



<p>To run a highly available, secure Traefik reverse proxy, you’ll need:</p>



<ul class="wp-block-list">
<li><strong>A registered domain name</strong> (be mindful of renewal, not just purchase price)</li>



<li><strong>External DNS provider:</strong> Cloudflare is demonstrated, but Traefik supports many. DNS-based ACME challenges offer automated SSL for any subdomain.</li>



<li><strong>A public (routable/white) IP address</strong></li>



<li><strong>Split DNS</strong>: Optional but highly recommended to ensure local domain queries stay on-premises.</li>
</ul>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><em>Tip: Investigate domain renewal costs, not just the initial price—renewals can be significantly higher!</em></p>
</blockquote>



<h2 class="wp-block-heading" id="dns-setup-with-cloudflare">DNS Setup with Cloudflare</h2>



<ul class="wp-block-list">
<li>Move your domain to Cloudflare or another supported DNS provider.</li>



<li>In Cloudflare, generate a custom API token with only the minimum required permissions.</li>



<li>Store the token securely; you can’t view it again once generated.</li>
</ul>



<p>Cloudflare might occasionally be blocked in certain regions—consult the official Traefik documentation for alternatives.</p>



<h2 class="wp-block-heading">Exporting the Cloudflare Token</h2>



<p>Before starting Traefik, declare the token so Traefik’s ACME provider can manage DNS entries for certificate challenges:</p>



<pre class="wp-block-preformatted"><code>export CLOUDFLARE_DNS_API_TOKEN="your-cloudflare-token"<br></code></pre>



<h2 class="wp-block-heading">Static Configuration:&nbsp;<code>/etc/traefik/traefik.yaml</code></h2>



<p>A robust static config example:</p>



<pre class="wp-block-preformatted"><code>global:<br>  checkNewVersion: true<br>  sendAnonymousUsage: true<br><br>api:<br>  dashboard: true<br>  insecure: false<br>  debug: true<br>  disableDashboardAd: true<br><br>entryPoints:<br>  web:<br>    address: ":80"<br>    http:<br>      redirections:<br>        entryPoint:<br>          to: websecure<br>          scheme: https<br>  websecure:<br>    address: ":443"<br>  metrics:<br>    address: ":8082"<br><br>metrics:<br>  prometheus:<br>    entryPoint: metrics<br><br>serversTransport:<br>  insecureSkipVerify: true<br><br>providers:<br>  file:<br>    directory: /etc/traefik/dynamic<br>    watch: true<br><br>certificatesResolvers:<br>  cloudflare:<br>    acme:<br>      caServer: https://acme-v02.api.letsencrypt.org/directory<br>      email: your-email@example.com<br>      storage: /etc/traefik/acme.json<br>      dnsChallenge:<br>        provider: cloudflare<br>        resolvers:<br>          - "1.1.1.1:53"<br>          - "1.0.0.1:53"<br><br>log:<br>  level: "INFO"<br>  filePath: "/var/log/traefik/traefik.log"<br>  maxSize: 100<br>  compress: true<br><br>accessLog:<br>  addInternals: true<br>  filePath: "/var/log/traefik/access.log"<br>  bufferingSize: 100<br></code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><em>The config decouples static and dynamic settings, ensures all HTTP gets redirected to HTTPS, and enables Prometheus metrics and access logging for deep observability.</em></p>
</blockquote>



<h2 class="wp-block-heading">Dynamic Configuration:&nbsp;<code>/etc/traefik/dynamic/config.yaml</code></h2>



<p>A typical dynamic configuration might enable a protected dashboard and a service like Radarr:</p>



<pre class="wp-block-preformatted"><code>http:<br>  routers:<br>    dashboard:<br>      entryPoints: [websecure]<br>      rule: "Host(`traefik-dashboard.domain.example`)"<br>      service: api@internal<br>      middlewares: [auth]<br>      tls:<br>        certResolver: cloudflare<br><br>    radarr:<br>      entryPoints: [websecure]<br>      rule: "Host(`radarr.domain.example`)"<br>      middlewares: [default-headers, https-redirect]<br>      tls:<br>        certResolver: cloudflare<br>      service: radarr<br><br>  services:<br>    radarr:<br>      loadBalancer:<br>        servers:<br>          - url: "http://192.168.1.100:7878"<br>        passHostHeader: true<br><br>  middlewares:<br>    auth:<br>      basicAuth:<br>        users:<br>          - "admin:$apr1$hashedpassword"<br>    https-redirect:<br>      redirectScheme:<br>        scheme: https<br>        permanent: true<br>    default-headers:<br>      headers:<br>        frameDeny: true<br>        browserXssFilter: true<br>        contentTypeNosniff: true<br>        forceSTSHeader: true<br>        stsIncludeSubdomains: true<br>        stsPreload: true<br>        stsSeconds: 15552000<br>        customFrameOptionsValue: SAMEORIGIN<br>        customRequestHeaders:<br>          X-Forwarded-Proto: https<br><br>tls:<br>  options:<br>    default:<br>      minVersion: VersionTLS12<br>      curvePreferences: [X25519, CurveP256, CurveP384, CurveP521]<br>      sniStrict: true<br>      cipherSuites:<br>        - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384<br>        - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256<br>        - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256<br>        - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256<br>        - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256<br><br>  stores:<br>    default:<br>      defaultGeneratedCert:<br>        resolver: cloudflare<br>        domain:<br>          main: domain.example<br>          sans:<br>            - "*.domain.example"<br></code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><em>Passwords for basicAuth must be hashed, e.g. via:</em></p>



<pre class="wp-block-preformatted"><code>openssl passwd -1 "your-password"<br></code></pre>
</blockquote>



<h2 class="wp-block-heading" id="launching-traefik-as-a-systemd-service">Launching Traefik as a Systemd Service</h2>



<p>To ensure Traefik starts on boot and runs as a managed background service, create&nbsp;<code>/etc/systemd/system/traefik-proxy.service</code>:</p>



<pre class="wp-block-preformatted"><code>[Unit]<br>Description=Start Traefik Proxy<br>Documentation=https://doc.traefik.io/traefik/<br><br>[Service]<br>Environment="CLOUDFLARE_DNS_API_TOKEN=your-cloudflare-token"<br>ExecStart=/usr/local/bin/traefik<br>Restart=always<br><br>[Install]<br>WantedBy=multi-user.target<br></code></pre>



<ul class="wp-block-list">
<li>Use <code>systemctl start traefik-proxy</code> to start, <code>systemctl status traefik-proxy</code> to check status, and <code>systemctl disable traefik-proxy</code> to prevent autostart.</li>



<li>Monitor SSL issuance and proxy logs in <code>/var/log/traefik/</code>.</li>
</ul>



<h2 class="wp-block-heading" id="key-best-practices-and-pitfalls">Key Best Practices and Pitfalls</h2>



<ul class="wp-block-list">
<li><strong>Secure your API tokens and config files</strong>—exposure can allow attackers to hijack all your domains!</li>



<li><strong>Log and monitor frequently</strong> for certificate renewals and failed ACME challenges.</li>



<li><strong>Regularly backup</strong> your dynamic config and ACME storage—a lost acme.json file means certificate resets.</li>
</ul>



<h2 class="wp-block-heading" id="conclusion">Conclusion</h2>



<p>With this advanced setup, Traefik acts as a true cloud-native gateway, bridging dynamic service discovery, encrypted communication, and full automation inside a lightweight LXC container. Paired with Proxmox, this approach combines resource efficiency, operational security, and enterprise-grade observability. Iterate, expand, and enhance—your infrastructure now has a reverse proxy backbone that’s ready for anything!</p>
<p>Сообщение <a href="https://boxvirt.com/running-traefik-in-an-lxc-container-part-2-docker-integration-service-discovery/">Running Traefik in an LXC Container (Part 2): Docker Integration &amp; Service Discovery</a> появились сначала на <a href="https://boxvirt.com">Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://boxvirt.com/running-traefik-in-an-lxc-container-part-2-docker-integration-service-discovery/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Running Traefik in an LXC Container (Part 1): Lightweight Reverse Proxy on Proxmox</title>
		<link>https://boxvirt.com/running-traefik-in-an-lxc-container-part-1-lightweight-reverse-proxy-on-proxmox/</link>
					<comments>https://boxvirt.com/running-traefik-in-an-lxc-container-part-1-lightweight-reverse-proxy-on-proxmox/#respond</comments>
		
		<dc:creator><![CDATA[eXtre]]></dc:creator>
		<pubDate>Sun, 27 Jul 2025 09:17:02 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Proxmox]]></category>
		<category><![CDATA[Traefik]]></category>
		<category><![CDATA[LXC Container]]></category>
		<category><![CDATA[Reverse Proxy]]></category>
		<guid isPermaLink="false">https://boxvirt.com/?p=92</guid>

					<description><![CDATA[<p>Introduction Architecting self-hosted environments often means juggling security, automation, and developer productivity. One core element of modern web infrastructure is the reverse proxy—a front-line component that routes, authenticates, [&#8230;]</p>
<p>Сообщение <a href="https://boxvirt.com/running-traefik-in-an-lxc-container-part-1-lightweight-reverse-proxy-on-proxmox/">Running Traefik in an LXC Container (Part 1): Lightweight Reverse Proxy on Proxmox</a> появились сначала на <a href="https://boxvirt.com">Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading" id="introduction">Introduction</h2>



<p>Architecting self-hosted environments often means juggling security, automation, and developer productivity. One core element of modern web infrastructure is the reverse proxy—a front-line component that routes, authenticates, and secures all incoming connections.&nbsp;<strong>Traefik</strong>, praised for its dynamic configurability and seamless container integration, is the tool of choice for many cloud-native enthusiasts.</p>



<p>This in-depth article walks you through deploying Traefik inside a Linux Container (LXC), discussing not only the hands-on how-to, but the broader design logic and key pitfalls to avoid.</p>



<h2 class="wp-block-heading" id="why-traefik-in-lxc">Why Traefik in LXC?</h2>



<p>Containers offer lightweight, isolated environments for services. Running Traefik within LXC brings multiple advantages:</p>



<ul class="wp-block-list">
<li><strong>Resource Efficiency:</strong> LXC containers spin up faster and consume less overhead than classic VMs.</li>



<li><strong>Isolation:</strong> Keep your reverse proxy separate for easier upgrades, failure domains, and maintenance.</li>



<li><strong>Central Control:</strong> Manage SSL, routing, and authentication centrally for all downstream services.</li>
</ul>



<h2 class="wp-block-heading" id="preparing-the-lxc-container">Preparing the LXC Container</h2>



<h2 class="wp-block-heading">Step 1: Create and Secure the LXC</h2>



<ul class="wp-block-list">
<li>Spin up a new LXC container using your virtualization platform (Proxmox, for example).</li>



<li>Assign basic network and storage resources.</li>



<li>Ensure your container&#8217;s OS is up-to-date and hardened:</li>



<li></li>



<li>apt update &amp;&amp; apt upgrade -y</li>
</ul>



<h2 class="wp-block-heading">Step 2: Install Docker (Optional)</h2>



<p>While LXC is great for most services, Traefik shines when managing Docker-based containers. Installing Docker inside LXC enables dynamic service discovery.</p>



<ul class="wp-block-list">
<li>apt install docker.io -y </li>



<li>systemctl enable &#8212;now docker</li>
</ul>



<p>Make sure to adjust LXC privileges and kernel modules if Docker faces issues (LXC may require&nbsp;<code>nesting=1</code>&nbsp;and some cgroups settings).</p>



<h2 class="wp-block-heading" id="traefik-dynamic-reverse-proxy-simply-explained">Traefik: Dynamic Reverse Proxy, Simply Explained</h2>



<p><strong>Traefik</strong>&nbsp;auto-discovers services and dynamically updates routes as containers go live or shut down. Its key concepts:</p>



<ul class="wp-block-list">
<li><strong>EntryPoints:</strong> Which ports Traefik listens to (typically 80/443).</li>



<li><strong>Routers:</strong> Rules for how requests are matched (by host, path, etc.).</li>



<li><strong>Services:</strong> Where traffic gets forwarded.</li>



<li><strong>Middleware:</strong> Request processing rules (JWT authentication, rewrite URLs, add headers).</li>
</ul>



<p>Traefik’s configuration typically includes a static file (for entryPoints and provider setup) and a dynamic one (to express routers, services, middleware).</p>



<h2 class="wp-block-heading" id="hands-on-setting-up-traefik-in-lxc">Hands-On: Setting Up Traefik in LXC</h2>



<h2 class="wp-block-heading">Step 1: Directory Structure</h2>



<p>Establish a directory (e.g.,&nbsp;<code>/opt/traefik</code>) for configs, certificates, and logs. Best practice: separate static and dynamic config files for clarity and version control.</p>



<p>Make sure your domain and DNS wildcard are set up correctly (<code>*.yourdomain.com</code>).</p>



<p>Generate <code>acme.json</code>:</p>



<pre class="wp-block-preformatted"><code>touch /etc/traefik/acme.json<br>chmod 600 /etc/traefik/acme.json</code></pre>



<h2 class="wp-block-heading">Step 2: Compose Your docker-compose.yml</h2>



<p>Here’s a refined example for a Traefik container:</p>



<pre class="wp-block-preformatted"><code>version: '3'<br><br>services:<br>  traefik:<br>    image: traefik:latest<br>    restart: unless-stopped<br>    command:<br>      - "--providers.docker=true"<br>      - "--entrypoints.web.address=:80"<br>      - "--entrypoints.websecure.address=:443"<br>      - "--certificatesresolvers.myresolver.acme.httpchallenge=true"<br>      - "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"<br>    ports:<br>      - "80:80"<br>      - "443:443"<br>    volumes:<br>      - /var/run/docker.sock:/var/run/docker.sock:ro<br>      - ./config:/etc/traefik<br>      - ./acme.json:/acme.json"<br>    networks:<br>      - proxy<br><br>networks:<br>  proxy:<br>    external: true<br></code></pre>



<p><strong>Best practices:</strong></p>



<ul class="wp-block-list">
<li><strong>Least privilege:</strong> Mount Docker socket read-only if needed.</li>



<li><strong>ACME storage:</strong> Secure <code>acme.json</code> with proper file permissions!</li>



<li><strong>External network:</strong> Use Docker networks to group all reverse-proxied containers logically.</li>
</ul>



<h2 class="wp-block-heading">Step 3: Configure Traefik’s Dashboard and Security</h2>



<ul class="wp-block-list">
<li>Enable the Traefik dashboard on a non-public URL or restrict access via middleware and IP whitelisting.</li>



<li>Always apply HTTPS and, if possible, enable basic or OAuth authentication for dashboard endpoints.</li>
</ul>



<h2 class="wp-block-heading">Step 4: Automate SSL and Routing</h2>



<ul class="wp-block-list">
<li>Define <code>certificatesResolvers</code> for Let’s Encrypt certificates—Traefik can automate issuance and renewal.</li>



<li>Use labels in Docker Compose to automatically register new services with </li>



<li></li>



<li><code>labels: </code></li>



<li><code>- "traefik.enable=true" </code></li>



<li><code>- "traefik.http.routers.myapp.rule=Host(`myapp.example.com`)" </code></li>



<li><code>- "traefik.http.services.myapp.loadbalancer.server.port=8080"</code></li>
</ul>



<h2 class="wp-block-heading">Step 5: Logging and Monitoring</h2>



<ul class="wp-block-list">
<li>Map a logs directory and enable access/error logging in your config files.</li>



<li>Leverage Prometheus metrics and alerting if running at scale.</li>
</ul>



<h2 class="wp-block-heading" id="troubleshooting--expert-tips">Troubleshooting &amp; Expert Tips</h2>



<ul class="wp-block-list">
<li><strong>Networking quirks:</strong> LXC containers may require custom bridges or NAT rules if you run multi-host clusters.</li>



<li><strong>Security:</strong> Regularly update Traefik for CVE patches; segment your networks tightly.</li>



<li><strong>Backup:</strong> Include your config and certificate stores in regular backups—losing SSL keys can disrupt all access.</li>
</ul>



<h2 class="wp-block-heading" id="conclusion">Conclusion</h2>



<p>Deploying Traefik in an LXC container is a modern, scalable approach to exposing and securing self-hosted services. With Docker integration, dynamic config, and enterprise-grade SSL automation built in, Traefik makes reverse proxying powerful yet accessible.</p>



<p>Whether you’re crafting your home lab or laying the groundwork for production infrastructure, understanding these patterns will put you ahead of the game. Experiment, iterate, and customize—Traefik is as flexible as your architecture requires.</p>
<p>Сообщение <a href="https://boxvirt.com/running-traefik-in-an-lxc-container-part-1-lightweight-reverse-proxy-on-proxmox/">Running Traefik in an LXC Container (Part 1): Lightweight Reverse Proxy on Proxmox</a> появились сначала на <a href="https://boxvirt.com">Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://boxvirt.com/running-traefik-in-an-lxc-container-part-1-lightweight-reverse-proxy-on-proxmox/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Self-Hosting Linkwarden: Secure Bookmarking on Your Own Server</title>
		<link>https://boxvirt.com/self-hosting-linkwarden-secure-bookmarking-on-your-own-server/</link>
					<comments>https://boxvirt.com/self-hosting-linkwarden-secure-bookmarking-on-your-own-server/#respond</comments>
		
		<dc:creator><![CDATA[eXtre]]></dc:creator>
		<pubDate>Fri, 18 Jul 2025 19:46:09 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Proxmox]]></category>
		<category><![CDATA[Traefik]]></category>
		<category><![CDATA[Linkwarden]]></category>
		<guid isPermaLink="false">https://boxvirt.com/?p=46</guid>

					<description><![CDATA[<p>Tired of losing important links or depending on third-party services like Pocket or Raindrop? Linkwarden is a privacy-friendly, self-hosted alternative that lets you store, organize, and search bookmarks [&#8230;]</p>
<p>Сообщение <a href="https://boxvirt.com/self-hosting-linkwarden-secure-bookmarking-on-your-own-server/">Self-Hosting Linkwarden: Secure Bookmarking on Your Own Server</a> появились сначала на <a href="https://boxvirt.com">Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Tired of losing important links or depending on third-party services like Pocket or Raindrop? <strong>Linkwarden</strong> is a privacy-friendly, self-hosted alternative that lets you store, organize, and search bookmarks — all on your own terms.</p>



<p>This guide walks you through deploying Linkwarden with Docker and Traefik, configuring it for SSL, and accessing it from anywhere securely.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f9f0.png" alt="🧰" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why Use Linkwarden?</h3>



<ul class="wp-block-list">
<li><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f4c1.png" alt="📁" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Save links with titles, tags, notes, and screenshots</li>



<li><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f510.png" alt="🔐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Self-hosted = complete data privacy</li>



<li><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f310.png" alt="🌐" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Access anywhere with SSL</li>



<li><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f9ed.png" alt="🧭" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Fast full-text search</li>



<li><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f465.png" alt="👥" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Multi-user support</li>



<li><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f4f7.png" alt="📷" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Automatic page archiving (via browser extension)</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f433.png" alt="🐳" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Deployment with Docker Compose</h3>



<p>Create a directory:</p>



<pre class="wp-block-preformatted"><code>mkdir -p ~/linkwarden &amp;&amp; cd ~/linkwarden<br></code></pre>



<p>Then create a <code>docker-compose.yml</code> file:</p>



<pre class="wp-block-preformatted"><code>version: '3.9'<br>services:<br>  linkwarden:<br>    image: ghcr.io/linkwarden/linkwarden:latest<br>    container_name: linkwarden<br>    restart: unless-stopped<br>    environment:<br>      - DATABASE_URL=postgres://user:pass@db:5432/linkwarden<br>    depends_on:<br>      - db<br>    ports:<br>      - 3000:3000<br>    volumes:<br>      - ./data:/data<br><br>  db:<br>    image: postgres:15<br>    environment:<br>      - POSTGRES_DB=linkwarden<br>      - POSTGRES_USER=user<br>      - POSTGRES_PASSWORD=pass<br>    volumes:<br>      - ./pgdata:/var/lib/postgresql/data<br></code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f6e0.png" alt="🛠" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Setup &amp; Access</h3>



<ol class="wp-block-list">
<li>Start containers:</li>
</ol>



<pre class="wp-block-preformatted"><code>docker compose up -d<br></code></pre>



<ol start="2" class="wp-block-list">
<li>Access via <code>http://your-server-ip:3000</code></li>



<li>Register an account</li>



<li>(Optional) Install the <a class="" href="https://github.com/linkwarden/linkwarden">Linkwarden Chrome/Firefox extension</a></li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f512.png" alt="🔒" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Securing with HTTPS via Traefik</h3>



<p>If you&#8217;re already using Traefik (e.g., for other Docker apps), add a label block to your service:</p>



<pre class="wp-block-preformatted"><code>labels:<br>  - "traefik.enable=true"<br>  - "traefik.http.routers.linkwarden.rule=Host(`links.yourdomain.com`)"<br>  - "traefik.http.routers.linkwarden.entrypoints=websecure"<br>  - "traefik.http.routers.linkwarden.tls.certresolver=myresolver"<br></code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f4f2.png" alt="📲" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Use Cases</h3>



<ul class="wp-block-list">
<li>Personal bookmarking vault</li>



<li>Team research archive</li>



<li>Curated collection of articles, videos, and PDFs</li>



<li>Save content offline for future reference</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/2699.png" alt="⚙" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Tips &amp; Extras</h3>



<ul class="wp-block-list">
<li>Use <code>Plausible</code> or <code>Umami</code> to self-host stats</li>



<li>Integrate with Nginx Proxy Manager</li>



<li>Enable auto backups with <code>borg</code> or <code>restic</code></li>



<li>Add Redis for performance boost</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h3 class="wp-block-heading"><img src="https://s.w.org/images/core/emoji/16.0.1/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Conclusion</h3>



<p>Linkwarden is a powerful, minimalist bookmark manager that respects your privacy and puts you in control. It’s fast, Docker-friendly, and actively maintained by the open-source community. If you’re serious about decluttering your digital brain — host your own Linkwarden server and keep your internet organized for good.</p>
<p>Сообщение <a href="https://boxvirt.com/self-hosting-linkwarden-secure-bookmarking-on-your-own-server/">Self-Hosting Linkwarden: Secure Bookmarking on Your Own Server</a> появились сначала на <a href="https://boxvirt.com">Boxvirt - Proxmox &amp; OPNsense Infrastructure Guides</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://boxvirt.com/self-hosting-linkwarden-secure-bookmarking-on-your-own-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
