PeerTube is one of the social-networking systems that forms part of the so-called Fediverse. Whereas Mastodon is a micro-blogging system much like Twitter, and diaspora* is similar to Facebook, PeerTube is a video-sharing system similar to YouTube. The critical differences about all of these systems compared to their better-known commercial counterparts are that (1) they are decentralized, so that no one person or organization controls them; and (2) they are federated, so they all intercommunicate. This second point is somewhat like the FidoNet or ProLine BBSs of old, with the important difference that the communication happens in real time.
This guide is based on @mrmarkuzâ guide on installing PeerTube (How to install PeerTube on Nethserver), but using Docker instead to avoid messing with dependencies for anything else that might be on your Neth system. It largely follows the PeerTube docs, but with a few adaptations.
Preliminary
Your PeerTube instance will be in its own virtual host, so youâll need to decide on a name for it. Once youâve given it a name, it will be very difficult to change later, so put some thought into choosing a name youâll likely be happy with for some time. Make whatever DNS entries are needed, and make sure you have a TLS certificate covering that name (either by generating a new cert for just that name, or by adding that name to your existing default cert).
Install nethserver-docker and docker-compose
yum install nethserver-docker
curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
Install PeerTube
mkdir -p /opt/peertube
cd /opt/peertube
curl https://raw.githubusercontent.com/chocobozzz/PeerTube/develop/support/docker/production/docker-compose.yml > docker-compose.yml
curl https://raw.githubusercontent.com/Chocobozzz/PeerTube/develop/support/docker/production/.env > .env
nano docker-compose.yml
- Comment out the webserver and certbot sections
- In the peertube: section, uncomment the line with port 9000, and edit it to â9001:9000â
- Portainer uses port 9000, so this seemed to be a conflict.
nano .env
- Replace
<MY POSTGRES USERNAME>
and<MY POSTGRES PASSWORD>
with the database user and a secure password, respectively. This username and password can be anything you choose. - Replace
<MY DOMAIN>
with whatever FQDN will point to this instance - Replace
<MY EMAIL ADDRESS>
with, well, your email address - Uncomment the lines PEERTUBE_WEBSERVER_PORT=80 and PEERTUBE_WEBSERVER_HTTPS=false, and change them to port 443 and true, respectively.
Start PeerTube with docker-compose up
.
In a separate terminal, in the same directory, run docker-compose logs peertube | grep -A1 root
to get your randomly-generated default root password. Save this password.
Add PeerTube to the aqua network: docker network connect aqua peertube_peertube_1
Test
Browse to $NETHSERVER_IP:9001, and see if you get the PeerTube page. You wonât be able to log in here, but you should see the page. If so, it should be good. Stop the instance with Ctrl-C.
Reverse proxy
wget https://gist.githubusercontent.com/mrmarkuz/de99f0ef59ef7d1716504c710801d4a4/raw/31f742103ad1dfec94408537b34b6d595b902def/peertube.conf -P /etc/httpd/conf.d/
Edit this file:
- Change the two
ServerName
directives to the hostname youâve chosen above - If you have obtained a cert just for that hostname, edit the SSLCertificateFile and related directives to point to that cert
- Near the end of the file (lines 111 and 114), edit the
RewriteRule
andProxyPass
directives to specify port 9001, rather than 9000
Restart Apache with systemctl restart httpd
, and restart PeerTube with docker-compose up -d
.
Conclusion
Now you can browse to your instance at the name youâve chosen, log in as root with the password generated password you noted above, change that password, create users, and otherwise configure your instance. Enjoy!