How to install PeerTube on Nethserver


(Markus Neuberger) #1

Peertube is a decentralized youtube replacement, see Feature request: PeerTube on NethServer:

Unfortunately peertube needs nodejs8 and I needed to replace the centos nodejs stack because rh-nodejs8 is not working, see Nethserver-collabora CODE testing and discussion so please don’t run in production.
You need a virtualhost domain like virtualhostdomain.tld.

Get repos - peertube, epel multimedia and nodejs:

wget -P /etc/yum.repos.d/
wget -P /etc/yum.repos.d/
curl -sL | bash -
yum -y install nethserver-postgresql postgresql-contrib nethserver-redis

Create database, db user and needed postgresql extensions (change secret to something more secure):

su - postgres -c psql
create database peertube_prod;
create user peertube with encrypted password 'secret';
grant all privileges on database peertube_prod to peertube;
\c peertube_prod

Install peertube:

yum -y install peertube

Edit /etc/peertube/production.yaml and set the DB password (that is secret if you didn’t change it in previous step) and your virtual host:

  hostname: 'virtualhostdomain.tld'
  password: 'secret'

Get /etc/httpd/conf.d/peertube.conf and edit the 2 servername directives to match your virtualhost:

wget -P /etc/httpd/conf.d/

ServerName virtualhostdomain.tld

Restart httpd and start/enable peertube and view peertube log:

systemctl restart httpd
systemctl enable peertube --now && journalctl -f -u peertube

Note the user password and exit journalctl with CTRL-C.

info: Username: root
info: User password: sdalfkdasfkasddfk

Browse to https://virtualhostdomain.tld and login with the given credentials.



Really great…
Thank you very much, for this how to.
And thank you, to show how this community is great and have loving memebrs.

(Rob Bosch) #3

Thanks a lot @mrmarkuz! Great work.
I will check with the peertube community if there are any options to get peertube integrated with CentOS7/NethServer in a somewhat more elegant way (nodejs issue)


And for polishing ( the path for excelence :innocent:)…
To have a Nethserver package with the « application menu » integration :kissing_heart:

(Rob Bosch) #5

I posted on peertube forums with some questions and remarks:

(Markus Neuberger) #6
Create /usr/share/nethesis/NethServer/Module/Dashboard/Applications/Peertube.php with following content (edit the URL to match your virtualhost):
namespace NethServer\Module\Dashboard\Applications;

class Peertube extends \Nethgui\Module\AbstractModule implements \NethServer\Module\Dashboard\Interfaces\ApplicationInterface
  public function getName()
    return "Peertube";
  public function getInfo()
    return array(
      'url' => "https://vhostdomain.tld",


Simply brilliant,
Thank you again.

(Rob Bosch) #8

I received a response on my question about NodeJS.
They suggest to use NVM (Nodejs Version Manager):
Would that be an option?

(Markus Neuberger) #9

Yes, as it does not touch the systems nodejs, I just have to find the best way that the peertube service uses the nvm version.
I am going to test it ASAP…

(HF) #10

Would this effect Onlyoffice using Nodejsv8?

(Markus Neuberger) #11

I think nvm could be used for onlyoffice too.
But the best way still would be rh-nodejs8 as it’s provided by system package manager and updated.