<h2class="anchor anchorWithStickyNavbar_LWe7"id="enable">Enable<ahref="#enable"class="hash-link"aria-label="Direct link to Enable"title="Direct link to Enable"></a></h2>
<p>Save the enable token from the zrok console in the configuration file.</p>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="name-your-share">Name your Share<ahref="#name-your-share"class="hash-link"aria-label="Direct link to Name your Share"title="Direct link to Name your Share"></a></h2>
<p>This unique name becomes part of the domain name of the share, e.g. <code>https://my-prod-app.in.zrok.io</code>. A random name is generated if you don't specify one.</p>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="use-cases">Use Cases<ahref="#use-cases"class="hash-link"aria-label="Direct link to Use Cases"title="Direct link to Use Cases"></a></h2>
<p>You may change the target for the current backend mode, e.g. <code>proxy</code>, by editing the configuration file and restarting the service. The reserved subdomain will remain the same.</p>
<p>You may switch between backend modes or change authentication options by deleting <code>/var/lib/zrok-share/.zrok/reserved.json</code> and restarting the service. A new subdomain will be reserved.</p>
@ -105,20 +108,31 @@ target.</p>
</ol>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="create-the-docker-project">Create the Docker Project<ahref="#create-the-docker-project"class="hash-link"aria-label="Direct link to Create the Docker Project"title="Direct link to Create the Docker Project"></a></h2>
<ol>
<li>Make a folder on your computer to use as a Docker Compose project for your zrok public share with a reserved subdomain and switch to the new directory in your terminal.</li>
<li>Download <ahref="/zrok-public-reserved/compose.yml"target="_blank"rel="noopener noreferrer">the reserved public share <code>compose.yml</code> project file</a> into the same directory.</li>
<li>Copy your zrok account's enable token from the zrok web console to your clipboard and paste it in a file named <code>.env</code> in the same folder like this:</li>
</ol>
<li>
<p>Make a folder on your computer to use as a Docker Compose project for your zrok public share with a reserved subdomain and switch to the new directory in your terminal.</p>
</li>
<li>
<p>Download <ahref="/zrok-public-reserved/compose.yml"target="_blank"rel="noopener noreferrer">the reserved public share <code>compose.yml</code> project file</a> into the same directory.</p>
</li>
<li>
<p>Copy your zrok account's enable token from the zrok web console to your clipboard and paste it in a file named <code>.env</code> in the same folder like this:</p>
<li>Run the Compose project to start sharing the built-in demo web server. Be sure to <code>--detach</code> so the project runs in the background if you want it to auto-restart when your computer reboots.</li>
</ol>
</li>
<li>
<p>Name the Share</p>
<p>This unique name becomes part of the domain name of the share, e.g. <code>https://my-prod-app.in.zrok.io</code>. A random name is generated if you don't specify one.</p>
<p>Run the Compose project to start sharing the built-in demo web server. Be sure to <code>--detach</code> so the project runs in the background if you want it to auto-restart when your computer reboots.</p>
<li>Get the public share URL from the output of the <code>zrok-share</code> service or by peeking in the zrok console where the share will appear in the graph.</li>
</ol>
</li>
<li>
<p>Get the public share URL from the output of the <code>zrok-share</code> service or by peeking in the zrok console where the share will appear in the graph.</p>
<p>This concludes the minimum steps to begin sharing the demo web server. Read on to learn how to pivot to sharing any website or web service by leveraging additional zrok backend modes.</p>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="proxy-any-web-server">Proxy Any Web Server<ahref="#proxy-any-web-server"class="hash-link"aria-label="Direct link to Proxy Any Web Server"title="Direct link to Proxy Any Web Server"></a></h2>
<p>The simplest way to share your existing HTTP server is to set <code>ZROK_TARGET</code> (e.g. <code>https://example.com</code>) in the environment of the <code>docker compose up</code> command. When you restart the share will auto-configure for that URL.</p>
@ -136,27 +150,31 @@ features in <a href="https://blog.openziti.io/the-zrok-oauth-public-frontend" ta
<p>Caddy is the most powerful and flexible backend mode in zrok. You must reserve a new public subdomain whenever you switch the backend mode, so using <code>caddy</code> reduces the risk that you'll have to share a new frontend URL with your users.</p>
<p>With Caddy, you can balance the workload for websites or web services or share static sites and files or all of the above at the same time. You can update the Caddyfile and restart the Docker Compose project to start sharing the new configuration with the same reserved public subdomain.</p>
<ol>
<li>Create a Caddyfile. This example demonstrates proxying two HTTP servers with a weighted round-robin load balancer.</li>
</ol>
<li>
<p>Create a Caddyfile. This example demonstrates proxying two HTTP servers with a weighted round-robin load balancer.</p>
<li>Create a file <code>compose.override.yml</code>. This example adds two <code>httpbin</code> containers for load balancing, and mounts the Caddyfile into the container.</li>
</ol>
</li>
<li>
<p>Create a file <code>compose.override.yml</code>. This example adds two <code>httpbin</code> containers for load balancing, and mounts the Caddyfile into the container.</p>
<p>If you prefer to keep using the same zrok environment with the new share then delete <code>/mnt/.zrok/reserved.json</code> instead of the entire volume.</p>
<ol>
<li>Run the project to load the new configuration.</li>
</ol>
<li>
<p>Run the project to load the new configuration.</p>
<divclass="language-buttonless codeBlockContainer_Ckt0 theme-code-block"style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><divclass="codeBlockTitle_Ktv7">Output</div><divclass="codeBlockContent_biex"><pretabindex="0"class="prism-code language-buttonless codeBlock_bY9V thin-scrollbar"style="color:#F8F8F2;background-color:#282A36"><codeclass="codeBlockLines_e6Vv"><spanclass="token-line"style="color:#F8F8F2"><spanclass="token plain">INFO: zrok public URL: https://88s803f2qvao.in.zrok.io/</span><br></span></code></pre><divclass="buttonGroup__atx"><buttontype="button"aria-label="Copy code to clipboard"title="Copy"class="clean-btn"><spanclass="copyButtonIcons_eSgA"aria-hidden="true"><svgviewBox="0 0 24 24"class="copyButtonIcon_y97N"><pathfill="currentColor"d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svgviewBox="0 0 24 24"class="copyButtonSuccessIcon_LjdS"><pathfill="currentColor"d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><divrole="tabpanel"class="tabItem_Ymn6"hidden=""><p>On Windows, zrok frontdoor is implemented as a Docker Compose project which reserves a public subdomain for your website or service.</p><h2class="anchor anchorWithStickyNavbar_LWe7"id="goal">Goal<ahref="#goal"class="hash-link"aria-label="Direct link to Goal"title="Direct link to Goal"></a></h2>
</ol></div><divrole="tabpanel"class="tabItem_Ymn6"hidden=""><p>On Windows, zrok frontdoor is implemented as a Docker Compose project which reserves a public subdomain for your website or service.</p><h2class="anchor anchorWithStickyNavbar_LWe7"id="goal">Goal<ahref="#goal"class="hash-link"aria-label="Direct link to Goal"title="Direct link to Goal"></a></h2>
<p>Proxy a reserved public subdomain to a backend target with an always-on Docker Compose service.</p>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="how-it-works">How it Works<ahref="#how-it-works"class="hash-link"aria-label="Direct link to How it Works"title="Direct link to How it Works"></a></h2>
<p>The Docker Compose project uses your zrok account token to reserve a public subdomain and keep sharing the backend
@ -169,20 +187,31 @@ target.</p>
</ol>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="create-the-docker-project">Create the Docker Project<ahref="#create-the-docker-project"class="hash-link"aria-label="Direct link to Create the Docker Project"title="Direct link to Create the Docker Project"></a></h2>
<ol>
<li>Make a folder on your computer to use as a Docker Compose project for your zrok public share with a reserved subdomain and switch to the new directory in your terminal.</li>
<li>Download <ahref="/zrok-public-reserved/compose.yml"target="_blank"rel="noopener noreferrer">the reserved public share <code>compose.yml</code> project file</a> into the same directory.</li>
<li>Copy your zrok account's enable token from the zrok web console to your clipboard and paste it in a file named <code>.env</code> in the same folder like this:</li>
</ol>
<li>
<p>Make a folder on your computer to use as a Docker Compose project for your zrok public share with a reserved subdomain and switch to the new directory in your terminal.</p>
</li>
<li>
<p>Download <ahref="/zrok-public-reserved/compose.yml"target="_blank"rel="noopener noreferrer">the reserved public share <code>compose.yml</code> project file</a> into the same directory.</p>
</li>
<li>
<p>Copy your zrok account's enable token from the zrok web console to your clipboard and paste it in a file named <code>.env</code> in the same folder like this:</p>
<li>Run the Compose project to start sharing the built-in demo web server. Be sure to <code>--detach</code> so the project runs in the background if you want it to auto-restart when your computer reboots.</li>
</ol>
</li>
<li>
<p>Name the Share</p>
<p>This unique name becomes part of the domain name of the share, e.g. <code>https://my-prod-app.in.zrok.io</code>. A random name is generated if you don't specify one.</p>
<p>Run the Compose project to start sharing the built-in demo web server. Be sure to <code>--detach</code> so the project runs in the background if you want it to auto-restart when your computer reboots.</p>
<li>Get the public share URL from the output of the <code>zrok-share</code> service or by peeking in the zrok console where the share will appear in the graph.</li>
</ol>
</li>
<li>
<p>Get the public share URL from the output of the <code>zrok-share</code> service or by peeking in the zrok console where the share will appear in the graph.</p>
<p>This concludes the minimum steps to begin sharing the demo web server. Read on to learn how to pivot to sharing any website or web service by leveraging additional zrok backend modes.</p>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="proxy-any-web-server">Proxy Any Web Server<ahref="#proxy-any-web-server"class="hash-link"aria-label="Direct link to Proxy Any Web Server"title="Direct link to Proxy Any Web Server"></a></h2>
<p>The simplest way to share your existing HTTP server is to set <code>ZROK_TARGET</code> (e.g. <code>https://example.com</code>) in the environment of the <code>docker compose up</code> command. When you restart the share will auto-configure for that URL.</p>
@ -200,27 +229,31 @@ features in <a href="https://blog.openziti.io/the-zrok-oauth-public-frontend" ta
<p>Caddy is the most powerful and flexible backend mode in zrok. You must reserve a new public subdomain whenever you switch the backend mode, so using <code>caddy</code> reduces the risk that you'll have to share a new frontend URL with your users.</p>
<p>With Caddy, you can balance the workload for websites or web services or share static sites and files or all of the above at the same time. You can update the Caddyfile and restart the Docker Compose project to start sharing the new configuration with the same reserved public subdomain.</p>
<ol>
<li>Create a Caddyfile. This example demonstrates proxying two HTTP servers with a weighted round-robin load balancer.</li>
</ol>
<li>
<p>Create a Caddyfile. This example demonstrates proxying two HTTP servers with a weighted round-robin load balancer.</p>
<li>Create a file <code>compose.override.yml</code>. This example adds two <code>httpbin</code> containers for load balancing, and mounts the Caddyfile into the container.</li>
</ol>
</li>
<li>
<p>Create a file <code>compose.override.yml</code>. This example adds two <code>httpbin</code> containers for load balancing, and mounts the Caddyfile into the container.</p>
<p>If you prefer to keep using the same zrok environment with the new share then delete <code>/mnt/.zrok/reserved.json</code> instead of the entire volume.</p>
<ol>
<li>Run the project to load the new configuration.</li>
</ol>
<li>
<p>Run the project to load the new configuration.</p>
<h2class="anchor anchorWithStickyNavbar_LWe7"id="concepts">Concepts<ahref="#concepts"class="hash-link"aria-label="Direct link to Concepts"title="Direct link to Concepts"></a></h2>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.