<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>instance &amp;mdash; Epic Worlds</title>
    <link>https://itwasntme223.writeas.com/tag:instance</link>
    <description>The official blog of Jonathan Snyder, the muse&#39;s bitch. </description>
    <pubDate>Sun, 19 Apr 2026 23:52:48 +0000</pubDate>
    <image>
      <url>https://i.snap.as/Ma5Uxu3U.png</url>
      <title>instance &amp;mdash; Epic Worlds</title>
      <link>https://itwasntme223.writeas.com/tag:instance</link>
    </image>
    <item>
      <title>Installing Peer Tube Behind a Reverse Proxy</title>
      <link>https://itwasntme223.writeas.com/installing-peer-tube-behind-a-reverse-proxy-t7tk?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[Finally, I got my #infosec #blog up and running again. It has been so long since I accidentally took it down by messing up the A records but that’s a story for another post. I wanted to write up tips and tricks of things that I ran into while attempting to install my own #peertube #instance that was not explained well in the documentation available on the main website.&#xA;&#xA;To be clear, this isn’t any sort of knocking the people who make it, it’s just not mentioned and I don’t know if that’s because for people used to this stuff it’s common knowledge or it just hasn’t been updated. Here we go!&#xA;&#xA;Before we begin, a few points about what I’m going to talk about. This is not going to be a full installation tutorial but a supplement to go along with the official documentation. This also assumes that the setup you are using is having one internet-facing server that is directing traffic upstream to other machines on the network so that they are not exposed.&#xA;&#xA;The server this is written for is Ubuntu 22.04 and I am using the Nginx that comes with the apt-get command. At the time of this writing, it’s Nginx 1.18.1.&#xA;&#xA;## Issue #1 - Default NodeJS Version Is Not High Enough&#xA;&#xA;The first part of the tutorial provided by PeerTube points you to the dependencies that you will need to initially install. Do not just use the copy-paste they have to install the default. The .deb files that are available are not the right version that it needs.&#xA;&#xA;When I ran sudo apt-get install nodejs, the server installed version 12.x. You need at least 16.x to install. When you go manually install NodeJS yourself so that you can run Yarn, do not install the latest version 20.x. It is NOT compatible with Yarn when you get to the install process later. I installed the latest version to be up-to-date, and the Yarn prompt in terminal stated that it was expecting between 16.x to 19.x. I had to re-do my key ring and install 19.x to work.&#xA;&#xA;## Issue #2 - Created PeerTube User Not Set with Correct Permissions&#xA;&#xA;The dependencies portion of the installation will create the user and group that you need but will not provide the correct permissions (chmod) on the folder. One time when I was running it, it didn’t give the folder to the group. It wants the folder to be drwxr-xr-x. You will not only need to set that yourself, but I recommend chown-ing the folder to the peertube user just to be safe. If you do not, it’ll throw errors later about not owning everything and could mess up your entire install (which happened to me the first time around).&#xA;&#xA;Run the command:&#xA;&#xA;sudo chmod 755 /var/www/peertube&#xA;sudo chown peertube:peertube /var/www/peertube&#xA;&#xA;That way, you can be absolutely sure nothing is going to get messed up with the install. Proceed from that point with the rest of the install.&#xA;&#xA;## Issue #3 - Prepping the production.yaml Correctly for Reverse Proxy&#xA;&#xA;When you get to the point where you are to edit the production.yaml file, there are a few steps you need to take to make sure it is ready for setup and the reverse proxy.&#xA;&#xA;To understand what I have set up, we’re going to assume we have two servers: one named 192.168.1.1, which is our internet-facing machine, and 192.168.1.2, which is the machine hosting the PeerTube instance. You are going to want 192.168.1.1 to be able to send all the traffic to the other machine.&#xA;&#xA;Setting Up for Reverse Proxy&#xA;&#xA;You will want to make sure the following is in the webserver portion of the YAML file.&#xA;&#xA;webserver:&#xA;  https: true&#xA;  hostname: &#39;yourpeertube.instance&#39;&#xA;  port: 443&#xA;&#xA;Though with many programs you can run behind a reverse proxy, the upstream machine doesn’t have to be on 443 as the SSL and security work is being handled on the machine taking the traffic. In the case of PeerTube, you must hand the traffic from 443 to 443 and have https set to true even though you do not have any certificates on the upstream location.&#xA;&#xA;If you do not do this, you will get streaming errors with your HLS.js in the PeerTube log. They will look like:&#xA;&#xA;HLS.js error: networkError - fatal: true - manifestLoadError&#xA;&#xA;The other symptom is that your video will play in the browser you uploaded it to but not on any other machine or browser.&#xA;&#xA;In the trust proxy: section, you want to add the line - &#39;192.168.1.1&#39; right under - &#39;loopback&#39;. Pay attention to formatting as YAML needs the proper indentation.&#xA;&#xA;The last part is to go to database: and make sure the correct password for your database you set up earlier is actually there. In my last three installation attempts, the instructions did not properly set the password. You can enter it manually.&#xA;&#xA;## Issue #4 - Proper Reverse Proxy with Nginx&#xA;&#xA;This really isn’t an issue but more to save you time figuring out what needs to be proxypass to the upstream machine.&#xA;&#xA;Upstream Machine&#xA;&#xA;On the machine hosting, strip out all the SSL certificate markers and everything, but leave it listening to 443. (This includes the SSL and http2 after the port listening entry.)&#xA;&#xA;It should look something like this:&#xA;&#xA;server {&#xA;  listen 443;&#xA;  listen [::]:443;&#xA;  servername yourpeertube.instance;&#xA;  # ... THE REST OF THE CONFIGURATION.&#xA;}&#xA;&#xA;Do not worry about the SSL part. As a reminder, it’s going to be handled by the internet-facing machine. We are presently setting up the hosting machine.&#xA;&#xA;Setting Up Internet-Facing Machine&#xA;&#xA;This is a full example of the reverse proxy that has helped my server function. Please make sure to add your information where it says yourpeertube.instance.&#xA;&#xA;server {&#xA;  if ($host = yourpeertube.instance) {&#xA;    return 301 https://$host$requesturi;&#xA;  }&#xA;&#xA;  listen 80;&#xA;  listen [::]:80;&#xA;  servername yourpeertube.instance;&#xA;  return 404;&#xA;}&#xA;&#xA;server {&#xA;  listen 443 ssl http2;&#xA;  listen [::]:443 ssl http2;&#xA;  servername yourpeertube.instance;&#xA;&#xA;  addheader Access-Control-Allow-Origin &#34;&#34;;&#xA;  addheader Access-Control-Allow-Methods &#34;&#34;;&#xA;&#xA;  sslcertificate     /etc/letsencrypt/live/yourpeertube.instance/fullchain.pem;&#xA;  sslcertificatekey /etc/letsencrypt/live/yourpeertube.instance/privkey.pem;&#xA;&#xA;  location ~/ {&#xA;    proxysetheader X-Forwarded-For $proxyaddxforwardedfor;&#xA;    proxysetheader Host $host;&#xA;    proxysetheader X-Real-IP $remoteaddr;&#xA;    proxypass http://192.168.4.2:443; # Make sure to change this to your actual internal IP&#xA;    clientmaxbody_size 0;&#xA;  }&#xA;}&#xA;&#xA;Ending&#xA;&#xA;There you have it. After I got this all setup, I was able to communicate with my server, upload videos, and the #fediverse portion worked to perfection. If you have any questions, you can reach out to me at my social media.&#xA;&#xA;[1]: https://docs.joinpeertube.org/install/any-os &#34;PeerTube Installation Instructions&#34;&#xA;[2]: https://social.vivaldi.net/itwasntme223 &#34;Itwasntme223 Social media&#34;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Finally, I got my <a href="https://itwasntme223.writeas.com/tag:infosec" class="hashtag"><span>#</span><span class="p-category">infosec</span></a> <a href="https://itwasntme223.writeas.com/tag:blog" class="hashtag"><span>#</span><span class="p-category">blog</span></a> up and running again. It has been so long since I accidentally took it down by messing up the A records but that’s a story for another post. I wanted to write up tips and tricks of things that I ran into while attempting to install my own <a href="https://itwasntme223.writeas.com/tag:peertube" class="hashtag"><span>#</span><span class="p-category">peertube</span></a> <a href="https://itwasntme223.writeas.com/tag:instance" class="hashtag"><span>#</span><span class="p-category">instance</span></a> that was not explained well in the documentation available on the main website.</p>

<p>To be clear, this isn’t any sort of knocking the people who make it, it’s just not mentioned and I don’t know if that’s because for people used to this stuff it’s common knowledge or it just hasn’t been updated. Here we go!</p>

<p>Before we begin, a few points about what I’m going to talk about. This is not going to be a full installation tutorial but a supplement to go along with the <a href="https://docs.joinpeertube.org/install/any-os" title="PeerTube Installation Instructions">official documentation</a>. This also assumes that the setup you are using is having one internet-facing server that is directing traffic upstream to other machines on the network so that they are not exposed.</p>

<p>The server this is written for is Ubuntu 22.04 and I am using the Nginx that comes with the <code>apt-get</code> command. At the time of this writing, it’s Nginx 1.18.1.</p>

<h2 id="issue-1-default-nodejs-version-is-not-high-enough" id="issue-1-default-nodejs-version-is-not-high-enough">Issue #1 – Default NodeJS Version Is Not High Enough</h2>

<p>The first part of the tutorial provided by PeerTube points you to the dependencies that you will need to initially install. Do not just use the copy-paste they have to install the default. The <code>.deb</code> files that are available are not the right version that it needs.</p>

<p>When I ran <code>sudo apt-get install nodejs</code>, the server installed version 12.x. You need at least 16.x to install. When you go manually install NodeJS yourself so that you can run Yarn, <strong>do not install the latest version 20.x</strong>. It is NOT compatible with Yarn when you get to the install process later. I installed the latest version to be up-to-date, and the Yarn prompt in terminal stated that it was expecting between 16.x to 19.x. I had to re-do my key ring and install 19.x to work.</p>

<h2 id="issue-2-created-peertube-user-not-set-with-correct-permissions" id="issue-2-created-peertube-user-not-set-with-correct-permissions">Issue #2 – Created PeerTube User Not Set with Correct Permissions</h2>

<p>The dependencies portion of the installation will create the user and group that you need but will not provide the correct permissions (<code>chmod</code>) on the folder. One time when I was running it, it didn’t give the folder to the group. It wants the folder to be <code>drwxr-xr-x</code>. You will not only need to set that yourself, but I recommend <code>chown</code>-ing the folder to the <code>peertube</code> user just to be safe. If you do not, it’ll throw errors later about not owning everything and could mess up your entire install (which happened to me the first time around).</p>

<p>Run the command:</p>

<pre><code class="language-bash">sudo chmod 755 /var/www/peertube
sudo chown peertube:peertube /var/www/peertube
</code></pre>

<p>That way, you can be absolutely sure nothing is going to get messed up with the install. Proceed from that point with the rest of the install.</p>

<h2 id="issue-3-prepping-the-production-yaml-correctly-for-reverse-proxy" id="issue-3-prepping-the-production-yaml-correctly-for-reverse-proxy">Issue #3 – Prepping the <code>production.yaml</code> Correctly for Reverse Proxy</h2>

<p>When you get to the point where you are to edit the <code>production.yaml</code> file, there are a few steps you need to take to make sure it is ready for setup and the reverse proxy.</p>

<p>To understand what I have set up, we’re going to assume we have two servers: one named <code>192.168.1.1</code>, which is our internet-facing machine, and <code>192.168.1.2</code>, which is the machine hosting the PeerTube instance. You are going to want <code>192.168.1.1</code> to be able to send all the traffic to the other machine.</p>

<h3 id="setting-up-for-reverse-proxy" id="setting-up-for-reverse-proxy">Setting Up for Reverse Proxy</h3>

<p>You will want to make sure the following is in the <code>webserver</code> portion of the YAML file.</p>

<pre><code class="language-yaml">webserver:
  https: true
  hostname: &#39;yourpeertube.instance&#39;
  port: 443
</code></pre>

<p>Though with many programs you can run behind a reverse proxy, the upstream machine doesn’t have to be on 443 as the SSL and security work is being handled on the machine taking the traffic. <strong>In the case of PeerTube, you must hand the traffic from 443 to 443 and have <code>https</code> set to <code>true</code> even though you do not have any certificates on the upstream location.</strong></p>

<p>If you do not do this, you will get streaming errors with your HLS.js in the PeerTube log. They will look like:</p>

<pre><code>HLS.js error: networkError - fatal: true - manifestLoadError
</code></pre>

<p>The other symptom is that your video will play in the browser you uploaded it to but not on any other machine or browser.</p>

<p>In the <code>trust proxy:</code> section, you want to add the line <code>- &#39;192.168.1.1&#39;</code> right under <code>- &#39;loopback&#39;</code>. <em>Pay attention to formatting as YAML needs the proper indentation.</em></p>

<p>The last part is to go to <code>database:</code> and make sure the correct password for your database you set up earlier is actually there. In my last three installation attempts, the instructions did not properly set the password. You can enter it manually.</p>

<h2 id="issue-4-proper-reverse-proxy-with-nginx" id="issue-4-proper-reverse-proxy-with-nginx">Issue #4 – Proper Reverse Proxy with Nginx</h2>

<p>This really isn’t an issue but more to save you time figuring out what needs to be <code>proxy_pass</code> to the upstream machine.</p>

<h3 id="upstream-machine" id="upstream-machine">Upstream Machine</h3>

<p>On the machine hosting, strip out all the SSL certificate markers and everything, but leave it listening to 443. (This includes the SSL and <code>http2</code> after the port listening entry.)</p>

<p>It should look something like this:</p>

<pre><code class="language-nginx">server {
  listen 443;
  listen [::]:443;
  server_name yourpeertube.instance;
  # ... THE REST OF THE CONFIGURATION.
}
</code></pre>

<p>Do not worry about the SSL part. As a reminder, it’s going to be handled by the internet-facing machine. We are presently setting up the hosting machine.</p>

<h3 id="setting-up-internet-facing-machine" id="setting-up-internet-facing-machine">Setting Up Internet-Facing Machine</h3>

<p>This is a full example of the reverse proxy that has helped my server function. Please make sure to add your information where it says <em>yourpeertube.instance</em>.</p>

<pre><code class="language-nginx">server {
  if ($host = yourpeertube.instance) {
    return 301 https://$host$request_uri;
  }

  listen 80;
  listen [::]:80;
  server_name yourpeertube.instance;
  return 404;
}

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name yourpeertube.instance;

  add_header Access-Control-Allow-Origin &#34;*&#34;;
  add_header Access-Control-Allow-Methods &#34;*&#34;;

  ssl_certificate     /etc/letsencrypt/live/yourpeertube.instance/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/yourpeertube.instance/privkey.pem;

  location ~/ {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://192.168.4.2:443; # Make sure to change this to your actual internal IP
    client_max_body_size 0;
  }
}
</code></pre>

<h2 id="ending" id="ending">Ending</h2>

<p>There you have it. After I got this all setup, I was able to communicate with my server, upload videos, and the <a href="https://itwasntme223.writeas.com/tag:fediverse" class="hashtag"><span>#</span><span class="p-category">fediverse</span></a> portion worked to perfection. If you have any questions, you can reach out to me at my <a href="https://social.vivaldi.net/itwasntme223" title="Itwasntme223 Social media">social media</a>.</p>
]]></content:encoded>
      <guid>https://itwasntme223.writeas.com/installing-peer-tube-behind-a-reverse-proxy-t7tk</guid>
      <pubDate>Mon, 02 Jun 2025 16:24:27 +0000</pubDate>
    </item>
    <item>
      <title>Installing Peer Tube Behind a Reverse Proxy</title>
      <link>https://itwasntme223.writeas.com/installing-peer-tube-behind-a-reverse-proxy?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[Finally, I got my #infosec #blog up and running again. It has been so long since I accidentally took it down by messing up the A records but that’s a story for another post. I wanted to write up tips and tricks of things that I ran into while attempting to install my own #peertube #instance that was not explained well in the documentation available on the main website.&#xA;&#xA;To be clear, this isn’t any sort of knocking the people who make it, it’s just not mentioned and I don’t know if that’s because for people used to this stuff it’s common knowledge or it just hasn’t been updated. Here we go!&#xA;&#xA;Before we begin, a few points about what I’m going to talk about. This is not going to be a full installation tutorial but a supplement to go along with the official documentation. This also assumes that the setup you are using is having one internet-facing server that is directing traffic upstream to other machines on the network so that they are not exposed.&#xA;&#xA;The server this is written for is Ubuntu 22.04 and I am using the Nginx that comes with the apt-get command. At the time of this writing, it’s Nginx 1.18.1.&#xA;&#xA;## Issue #1 - Default NodeJS Version Is Not High Enough&#xA;&#xA;The first part of the tutorial provided by PeerTube points you to the dependencies that you will need to initially install. Do not just use the copy-paste they have to install the default. The .deb files that are available are not the right version that it needs.&#xA;&#xA;When I ran sudo apt-get install nodejs, the server installed version 12.x. You need at least 16.x to install. When you go manually install NodeJS yourself so that you can run Yarn, do not install the latest version 20.x. It is NOT compatible with Yarn when you get to the install process later. I installed the latest version to be up-to-date, and the Yarn prompt in terminal stated that it was expecting between 16.x to 19.x. I had to re-do my key ring and install 19.x to work.&#xA;&#xA;## Issue #2 - Created PeerTube User Not Set with Correct Permissions&#xA;&#xA;The dependencies portion of the installation will create the user and group that you need but will not provide the correct permissions (chmod) on the folder. One time when I was running it, it didn’t give the folder to the group. It wants the folder to be drwxr-xr-x. You will not only need to set that yourself, but I recommend chown-ing the folder to the peertube user just to be safe. If you do not, it’ll throw errors later about not owning everything and could mess up your entire install (which happened to me the first time around).&#xA;&#xA;Run the command:&#xA;&#xA;sudo chmod 755 /var/www/peertube&#xA;sudo chown peertube:peertube /var/www/peertube&#xA;&#xA;That way, you can be absolutely sure nothing is going to get messed up with the install. Proceed from that point with the rest of the install.&#xA;&#xA;## Issue #3 - Prepping the production.yaml Correctly for Reverse Proxy&#xA;&#xA;When you get to the point where you are to edit the production.yaml file, there are a few steps you need to take to make sure it is ready for setup and the reverse proxy.&#xA;&#xA;To understand what I have set up, we’re going to assume we have two servers: one named 192.168.1.1, which is our internet-facing machine, and 192.168.1.2, which is the machine hosting the PeerTube instance. You are going to want 192.168.1.1 to be able to send all the traffic to the other machine.&#xA;&#xA;Setting Up for Reverse Proxy&#xA;&#xA;You will want to make sure the following is in the webserver portion of the YAML file.&#xA;&#xA;webserver:&#xA;  https: true&#xA;  hostname: &#39;yourpeertube.instance&#39;&#xA;  port: 443&#xA;&#xA;Though with many programs you can run behind a reverse proxy, the upstream machine doesn’t have to be on 443 as the SSL and security work is being handled on the machine taking the traffic. In the case of PeerTube, you must hand the traffic from 443 to 443 and have https set to true even though you do not have any certificates on the upstream location.&#xA;&#xA;If you do not do this, you will get streaming errors with your HLS.js in the PeerTube log. They will look like:&#xA;&#xA;HLS.js error: networkError - fatal: true - manifestLoadError&#xA;&#xA;The other symptom is that your video will play in the browser you uploaded it to but not on any other machine or browser.&#xA;&#xA;In the trust proxy: section, you want to add the line - &#39;192.168.1.1&#39; right under - &#39;loopback&#39;. Pay attention to formatting as YAML needs the proper indentation.&#xA;&#xA;The last part is to go to database: and make sure the correct password for your database you set up earlier is actually there. In my last three installation attempts, the instructions did not properly set the password. You can enter it manually.&#xA;&#xA;## Issue #4 - Proper Reverse Proxy with Nginx&#xA;&#xA;This really isn’t an issue but more to save you time figuring out what needs to be proxypass to the upstream machine.&#xA;&#xA;Upstream Machine&#xA;&#xA;On the machine hosting, strip out all the SSL certificate markers and everything, but leave it listening to 443. (This includes the SSL and http2 after the port listening entry.)&#xA;&#xA;It should look something like this:&#xA;&#xA;server {&#xA;  listen 443;&#xA;  listen [::]:443;&#xA;  servername yourpeertube.instance;&#xA;  # ... THE REST OF THE CONFIGURATION.&#xA;}&#xA;&#xA;Do not worry about the SSL part. As a reminder, it’s going to be handled by the internet-facing machine. We are presently setting up the hosting machine.&#xA;&#xA;Setting Up Internet-Facing Machine&#xA;&#xA;This is a full example of the reverse proxy that has helped my server function. Please make sure to add your information where it says yourpeertube.instance.&#xA;&#xA;server {&#xA;  if ($host = yourpeertube.instance) {&#xA;    return 301 https://$host$requesturi;&#xA;  }&#xA;&#xA;  listen 80;&#xA;  listen [::]:80;&#xA;  servername yourpeertube.instance;&#xA;  return 404;&#xA;}&#xA;&#xA;server {&#xA;  listen 443 ssl http2;&#xA;  listen [::]:443 ssl http2;&#xA;  servername yourpeertube.instance;&#xA;&#xA;  addheader Access-Control-Allow-Origin &#34;&#34;;&#xA;  addheader Access-Control-Allow-Methods &#34;&#34;;&#xA;&#xA;  sslcertificate     /etc/letsencrypt/live/yourpeertube.instance/fullchain.pem;&#xA;  sslcertificatekey /etc/letsencrypt/live/yourpeertube.instance/privkey.pem;&#xA;&#xA;  location ~/ {&#xA;    proxysetheader X-Forwarded-For $proxyaddxforwardedfor;&#xA;    proxysetheader Host $host;&#xA;    proxysetheader X-Real-IP $remoteaddr;&#xA;    proxypass http://192.168.4.2:443; # Make sure to change this to your actual internal IP&#xA;    clientmaxbody_size 0;&#xA;  }&#xA;}&#xA;&#xA;Ending&#xA;&#xA;There you have it. After I got this all setup, I was able to communicate with my server, upload videos, and the #fediverse portion worked to perfection. If you have any questions, you can reach out to me at my social media.&#xA;&#xA;[1]: https://docs.joinpeertube.org/install/any-os &#34;PeerTube Installation Instructions&#34;&#xA;[2]: https://social.vivaldi.net/itwasntme223 &#34;Itwasntme223 Social media&#34;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Finally, I got my <a href="https://itwasntme223.writeas.com/tag:infosec" class="hashtag"><span>#</span><span class="p-category">infosec</span></a> <a href="https://itwasntme223.writeas.com/tag:blog" class="hashtag"><span>#</span><span class="p-category">blog</span></a> up and running again. It has been so long since I accidentally took it down by messing up the A records but that’s a story for another post. I wanted to write up tips and tricks of things that I ran into while attempting to install my own <a href="https://itwasntme223.writeas.com/tag:peertube" class="hashtag"><span>#</span><span class="p-category">peertube</span></a> <a href="https://itwasntme223.writeas.com/tag:instance" class="hashtag"><span>#</span><span class="p-category">instance</span></a> that was not explained well in the documentation available on the main website.</p>

<p>To be clear, this isn’t any sort of knocking the people who make it, it’s just not mentioned and I don’t know if that’s because for people used to this stuff it’s common knowledge or it just hasn’t been updated. Here we go!</p>

<p>Before we begin, a few points about what I’m going to talk about. This is not going to be a full installation tutorial but a supplement to go along with the <a href="https://docs.joinpeertube.org/install/any-os" title="PeerTube Installation Instructions">official documentation</a>. This also assumes that the setup you are using is having one internet-facing server that is directing traffic upstream to other machines on the network so that they are not exposed.</p>

<p>The server this is written for is Ubuntu 22.04 and I am using the Nginx that comes with the <code>apt-get</code> command. At the time of this writing, it’s Nginx 1.18.1.</p>

<h2 id="issue-1-default-nodejs-version-is-not-high-enough" id="issue-1-default-nodejs-version-is-not-high-enough">Issue #1 – Default NodeJS Version Is Not High Enough</h2>

<p>The first part of the tutorial provided by PeerTube points you to the dependencies that you will need to initially install. Do not just use the copy-paste they have to install the default. The <code>.deb</code> files that are available are not the right version that it needs.</p>

<p>When I ran <code>sudo apt-get install nodejs</code>, the server installed version 12.x. You need at least 16.x to install. When you go manually install NodeJS yourself so that you can run Yarn, <strong>do not install the latest version 20.x</strong>. It is NOT compatible with Yarn when you get to the install process later. I installed the latest version to be up-to-date, and the Yarn prompt in terminal stated that it was expecting between 16.x to 19.x. I had to re-do my key ring and install 19.x to work.</p>

<h2 id="issue-2-created-peertube-user-not-set-with-correct-permissions" id="issue-2-created-peertube-user-not-set-with-correct-permissions">Issue #2 – Created PeerTube User Not Set with Correct Permissions</h2>

<p>The dependencies portion of the installation will create the user and group that you need but will not provide the correct permissions (<code>chmod</code>) on the folder. One time when I was running it, it didn’t give the folder to the group. It wants the folder to be <code>drwxr-xr-x</code>. You will not only need to set that yourself, but I recommend <code>chown</code>-ing the folder to the <code>peertube</code> user just to be safe. If you do not, it’ll throw errors later about not owning everything and could mess up your entire install (which happened to me the first time around).</p>

<p>Run the command:</p>

<pre><code class="language-bash">sudo chmod 755 /var/www/peertube
sudo chown peertube:peertube /var/www/peertube
</code></pre>

<p>That way, you can be absolutely sure nothing is going to get messed up with the install. Proceed from that point with the rest of the install.</p>

<h2 id="issue-3-prepping-the-production-yaml-correctly-for-reverse-proxy" id="issue-3-prepping-the-production-yaml-correctly-for-reverse-proxy">Issue #3 – Prepping the <code>production.yaml</code> Correctly for Reverse Proxy</h2>

<p>When you get to the point where you are to edit the <code>production.yaml</code> file, there are a few steps you need to take to make sure it is ready for setup and the reverse proxy.</p>

<p>To understand what I have set up, we’re going to assume we have two servers: one named <code>192.168.1.1</code>, which is our internet-facing machine, and <code>192.168.1.2</code>, which is the machine hosting the PeerTube instance. You are going to want <code>192.168.1.1</code> to be able to send all the traffic to the other machine.</p>

<h3 id="setting-up-for-reverse-proxy" id="setting-up-for-reverse-proxy">Setting Up for Reverse Proxy</h3>

<p>You will want to make sure the following is in the <code>webserver</code> portion of the YAML file.</p>

<pre><code class="language-yaml">webserver:
  https: true
  hostname: &#39;yourpeertube.instance&#39;
  port: 443
</code></pre>

<p>Though with many programs you can run behind a reverse proxy, the upstream machine doesn’t have to be on 443 as the SSL and security work is being handled on the machine taking the traffic. <strong>In the case of PeerTube, you must hand the traffic from 443 to 443 and have <code>https</code> set to <code>true</code> even though you do not have any certificates on the upstream location.</strong></p>

<p>If you do not do this, you will get streaming errors with your HLS.js in the PeerTube log. They will look like:</p>

<pre><code>HLS.js error: networkError - fatal: true - manifestLoadError
</code></pre>

<p>The other symptom is that your video will play in the browser you uploaded it to but not on any other machine or browser.</p>

<p>In the <code>trust proxy:</code> section, you want to add the line <code>- &#39;192.168.1.1&#39;</code> right under <code>- &#39;loopback&#39;</code>. <em>Pay attention to formatting as YAML needs the proper indentation.</em></p>

<p>The last part is to go to <code>database:</code> and make sure the correct password for your database you set up earlier is actually there. In my last three installation attempts, the instructions did not properly set the password. You can enter it manually.</p>

<h2 id="issue-4-proper-reverse-proxy-with-nginx" id="issue-4-proper-reverse-proxy-with-nginx">Issue #4 – Proper Reverse Proxy with Nginx</h2>

<p>This really isn’t an issue but more to save you time figuring out what needs to be <code>proxy_pass</code> to the upstream machine.</p>

<h3 id="upstream-machine" id="upstream-machine">Upstream Machine</h3>

<p>On the machine hosting, strip out all the SSL certificate markers and everything, but leave it listening to 443. (This includes the SSL and <code>http2</code> after the port listening entry.)</p>

<p>It should look something like this:</p>

<pre><code class="language-nginx">server {
  listen 443;
  listen [::]:443;
  server_name yourpeertube.instance;
  # ... THE REST OF THE CONFIGURATION.
}
</code></pre>

<p>Do not worry about the SSL part. As a reminder, it’s going to be handled by the internet-facing machine. We are presently setting up the hosting machine.</p>

<h3 id="setting-up-internet-facing-machine" id="setting-up-internet-facing-machine">Setting Up Internet-Facing Machine</h3>

<p>This is a full example of the reverse proxy that has helped my server function. Please make sure to add your information where it says <em>yourpeertube.instance</em>.</p>

<pre><code class="language-nginx">server {
  if ($host = yourpeertube.instance) {
    return 301 https://$host$request_uri;
  }

  listen 80;
  listen [::]:80;
  server_name yourpeertube.instance;
  return 404;
}

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name yourpeertube.instance;

  add_header Access-Control-Allow-Origin &#34;*&#34;;
  add_header Access-Control-Allow-Methods &#34;*&#34;;

  ssl_certificate     /etc/letsencrypt/live/yourpeertube.instance/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/yourpeertube.instance/privkey.pem;

  location ~/ {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://192.168.4.2:443; # Make sure to change this to your actual internal IP
    client_max_body_size 0;
  }
}
</code></pre>

<h2 id="ending" id="ending">Ending</h2>

<p>There you have it. After I got this all setup, I was able to communicate with my server, upload videos, and the <a href="https://itwasntme223.writeas.com/tag:fediverse" class="hashtag"><span>#</span><span class="p-category">fediverse</span></a> portion worked to perfection. If you have any questions, you can reach out to me at my <a href="https://social.vivaldi.net/itwasntme223" title="Itwasntme223 Social media">social media</a>.</p>
]]></content:encoded>
      <guid>https://itwasntme223.writeas.com/installing-peer-tube-behind-a-reverse-proxy</guid>
      <pubDate>Mon, 02 Jun 2025 16:24:27 +0000</pubDate>
    </item>
  </channel>
</rss>