<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Ubuntu &amp;mdash; UrbanLife</title>
    <link>https://paper.wf/urbanlife/tag:Ubuntu</link>
    <description>A place to document my experience in this urban plain.</description>
    <pubDate>Tue, 12 May 2026 06:30:59 +0000</pubDate>
    <item>
      <title>How to enable HTTPS for a local network Nextcloud instance</title>
      <link>https://paper.wf/urbanlife/how-to-enable-https-for-a-local-network-nextcloud-instance</link>
      <description>&lt;![CDATA[This post will go over the basic steps to enable HTTPS for an intranet Nextcloud service. I have to mess with this every three months when Let&#39;s Encrypt expires my certs, and it&#39;s always annoying.&#xA;&#xA;This kind of setup might be useful for when you self-host a Nextcloud instance and don&#39;t want to open your home network to the public. I use Zerotier to provide a static IP address and connect to my Nextcloud server.&#xA;&#xA;Environment:&#xA;&#xA;Ubuntu 22.04.1 LTS&#xA;Nextcloud 24.0.7snap1&#xA;#DNS is managed using #Namecheap&#xA;Zerotier for external network access&#xA;&#xA;Step 1 - Generate new certs&#xA;&#xA;This will start the cert generation process using the challenge method to prove domain ownership.&#xA;&#xA;~$ sudo certbot certonly --manual --preferred-challenges dns&#xA;Enter the FULL domain for the certs&#xA;Copy the value that it returns for the next step&#xA;&#xA;Step 2 - Create TXT records&#xA;&#xA;On whatever DNS service you use, create a TXT record using the &#34;acme-challenge&#34; domain Let&#39;s Encrypt created and the random string it generated.&#xA;&#xA;Create TXT record.&#xA;    Domain should be acme-challenge.your domain&#xA;    Value should be whatever random string was generated by LetsEncrypt&#xA;Verify that the record has been updated by using https://toolbox.googleapps.com/apps/dig&#xA;&#xA;  NOTE: For subdomains, only the &#34;subdomain&#34; portion is needed for the domain record&#xA;&#xA;  NOTE: When verifying, you should see the value of the TXT record. If you don&#39;t wait until the record has been verified, you&#39;ll need to start the process over again.&#xA;&#xA;Step 3 - Copy the certs into Nextcloud&#xA;&#xA;We will now copy the generated certs into the Nextcloud directory.&#xA;&#xA;Copy the certs from where Let&#39;s Encrypt dumped them&#xA;    /etc/letsencrypt/live/your domain into /var/snap/nextcloud/common&#xA;Rename privkey.pem to key.pem&#xA;&#xA;  NOTE_: Certs must be a directory that the Nextcloud snap has access to. The easiest is to place them into /var/snap/nextcloud/common. These can be removed once the process is over.&#xA;&#xA;Step 4 - Apply the certs&#xA;&#xA;We will now apply the new certs.&#xA;&#xA;Disable HTTPS for Nextcloud&#xA;~$ sudo nextcloud.disable-https&#xA;&#xA;Stop the Nextcloud snap service&#xA;    ~$ sudo snap stop nextcloud&#xA;&#xA;Enable HTTPS with new certs&#xA;    ~ $ sudo nextcloud.enable-https custom -s \n&#xA;    /path to cert.pem\n&#xA;    /path to key.pem  \n&#xA;    /path to chain.pem&#xA;&#xA;Start Nextcloud&#xA;    ~$ sudo snap start nextcloud&#xA;&#xA;You should now be able to access Nextcloud using HTTPS.&#xA;&#xA;Hopefully someone else finds this helpful! Most people don’t have this setup (#Nextcloud Snap with #zerotier) and it took a lot of tinkering to get it to work.&#xA;&#xA;The main source that used was this blog from David Augustat. It’s a nice read on how to set up HTTPS for #intranet #domains for general use cases!&#xA;&#xA;https://davidaugustat.com/web/set-up-lets-encrypt-on-intranet-website]]&gt;</description>
      <content:encoded><![CDATA[<p>This post will go over the basic steps to enable HTTPS for an intranet Nextcloud service. I have to mess with this every three months when Let&#39;s Encrypt expires my certs, and it&#39;s always annoying.</p>

<p>This kind of setup might be useful for when you self-host a Nextcloud instance and don&#39;t want to open your home network to the public. I use Zerotier to provide a static IP address and connect to my Nextcloud server.</p>

<p>Environment:</p>
<ul><li><a href="/urbanlife/tag:Ubuntu" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Ubuntu</span></a> 22.04.1 LTS</li>
<li><a href="/urbanlife/tag:Nextcloud" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Nextcloud</span></a> 24.0.7snap1</li>
<li><a href="/urbanlife/tag:DNS" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">DNS</span></a> is managed using <a href="/urbanlife/tag:Namecheap" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Namecheap</span></a></li>
<li><a href="/urbanlife/tag:Zerotier" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Zerotier</span></a> for external network access</li></ul>

<h2 id="step-1-generate-new-certs" id="step-1-generate-new-certs">Step 1 – Generate new certs</h2>

<p>This will start the cert generation process using the challenge method to prove domain ownership.</p>
<ol><li><code>~$ sudo certbot certonly --manual --preferred-challenges dns</code></li>
<li>Enter the FULL domain for the certs</li>
<li>Copy the value that it returns for the next step</li></ol>

<h2 id="step-2-create-txt-records" id="step-2-create-txt-records">Step 2 – Create TXT records</h2>

<p>On whatever DNS service you use, create a TXT record using the “acme-challenge” domain Let&#39;s Encrypt created and the random string it generated.</p>
<ol><li>Create TXT record.
<ol><li>Domain should be <code>_acme-challenge.&lt;your domain&gt;</code></li>
<li>Value should be whatever random string was generated by LetsEncrypt</li></ol></li>
<li>Verify that the record has been updated by using <a href="https://toolbox.googleapps.com/apps/dig" rel="nofollow">https://toolbox.googleapps.com/apps/dig</a></li></ol>

<blockquote><p><em>NOTE</em>: For subdomains, only the “subdomain” portion is needed for the domain record</p>

<p><em>NOTE</em>: When verifying, you should see the value of the TXT record. If you don&#39;t wait until the record has been verified, you&#39;ll need to start the process over again.</p></blockquote>

<h2 id="step-3-copy-the-certs-into-nextcloud" id="step-3-copy-the-certs-into-nextcloud">Step 3 – Copy the certs into Nextcloud</h2>

<p>We will now copy the generated certs into the Nextcloud directory.</p>
<ol><li>Copy the certs from where Let&#39;s Encrypt dumped them
<code>/etc/letsencrypt/live/&lt;your domain&gt;</code> into <code>/var/snap/nextcloud/common</code></li>
<li>Rename <code>privkey.pem</code> to <code>key.pem</code></li></ol>

<blockquote><p><em>NOTE</em>: Certs must be a directory that the Nextcloud snap has access to. The easiest is to place them into <code>/var/snap/nextcloud/common</code>. These can be removed once the process is over.</p></blockquote>

<h2 id="step-4-apply-the-certs" id="step-4-apply-the-certs">Step 4 – Apply the certs</h2>

<p>We will now apply the new certs.</p>
<ol><li><p>Disable HTTPS for Nextcloud</p>

<pre><code class="language-bash">~$ sudo nextcloud.disable-https
</code></pre></li>

<li><p>Stop the Nextcloud snap service</p>

<pre><code class="language-bash">~$ sudo snap stop nextcloud
</code></pre></li>

<li><p>Enable HTTPS with new certs</p>

<pre><code class="language-bash">~ $ sudo nextcloud.enable-https custom -s \n
/&lt;path to cert.pem&gt;\n
/path to key.pem&gt; \n
/&lt;path to chain.pem&gt;
</code></pre></li>

<li><p>Start Nextcloud</p>

<pre><code class="language-bash">~$ sudo snap start nextcloud
</code></pre></li></ol>

<p>You should now be able to access Nextcloud using HTTPS.</p>

<p>Hopefully someone else finds this helpful! Most people don’t have this setup (<a href="/urbanlife/tag:Nextcloud" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Nextcloud</span></a> Snap with <a href="/urbanlife/tag:zerotier" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">zerotier</span></a>) and it took a lot of tinkering to get it to work.</p>

<p>The main source that used was this blog from David Augustat. It’s a nice read on how to set up HTTPS for <a href="/urbanlife/tag:intranet" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">intranet</span></a> <a href="/urbanlife/tag:domains" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">domains</span></a> for general use cases!</p>

<p><a href="https://davidaugustat.com/web/set-up-lets-encrypt-on-intranet-website" rel="nofollow">https://davidaugustat.com/web/set-up-lets-encrypt-on-intranet-website</a></p>
]]></content:encoded>
      <guid>https://paper.wf/urbanlife/how-to-enable-https-for-a-local-network-nextcloud-instance</guid>
      <pubDate>Wed, 07 Dec 2022 01:57:43 +0000</pubDate>
    </item>
  </channel>
</rss>