Liens :
https://docs.joinpeertube.org/install/any-os
https://www.linode.com/docs/guides/how-to-install-peertube/
https://najigram.com/2023/12/install-peertube-on-ubuntu-22-04-lts/
util01@station40:~$ ssh-copy-id ubuntu@serveur666.monserveurdedie.eu
util01@station40:~$ ssh ubuntu@mon_serveur_dedie.fr
ubuntu@serveur666:~$ sudo snap install core
ubuntu@serveur666:~$ sudo snap install hello-world
ubuntu@serveur666:~$ hello-world
Hello World!
ubuntu@serveur666:~$
Installation de LXD :
ubuntu@serveur666:~$ sudo snap install lxd --channel=4.0/stable
Vérification :
ubuntu@serveur666:~$ lxd --version
4.0.10
ubuntu@serveur666:~$
ubuntu@serveur666:~$ sudo lxc launch ubuntu:24.04 peertube
ubuntu@serveur666:~$ lxc list
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| peertube | RUNNING | 10.123.236.180 (eth0) | fd42:e702:d7b9:a433:216:3eff:fed5:37c9 (eth0) | CONTAINER | 1 |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
ubuntu@serveur666:~$
ubuntu@serveur666:~$ lxc exec peertube -- sudo --user ubuntu --login
ubuntu@serveur666:~$ lxc stop peertube
ubuntu@serveur666:~$ lxc delete peertube
ubuntu@peertube:~$ sudo apt-get update
ubuntu@peertube:~$ sudo apt-get upgrade
ubuntu@peertube:~$ sudo apt install -y url sudo unzip vim curl gnupg redis ffmpeg nginx certbot
ubuntu@peertube:~$ sudo apt install -y python3-dev python3-pip python-is-python3
ubuntu@peertube:~$ sudo apt install -y ffmpeg postgresql postgresql-contrib openssl g++ make redis-server git cron wget
ubuntu@peertube:~$ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
ubuntu@peertube:~$ sudo apt-get install -y nodejs
ubuntu@peertube:~$ sudo systemctl start redis postgresql
ubuntu@peertube:~$ sudo useradd -m -d /var/www/peertube -s /usr/sbin/nologin -p peertube peertube
ubuntu@peertube:~$ sudo passwd peertube
ubuntu@peertube:~$ sudo -u postgres createuser -P peertube
Enter password for new role:
Enter it again:
ubuntu@peertube:~$ sudo -u postgres createdb -O peertube -E UTF8 -T template0 peertube_prod
ubuntu@peertube:~$ sudo -u postgres psql -c "CREATE EXTENSION pg_trgm;" peertube_prod
CREATE EXTENSION
ubuntu@peertube:~$ sudo -u postgres psql -c "CREATE EXTENSION unaccent;" peertube_prod
CREATE EXTENSION
ubuntu@peertube:~$ sudo -u peertube -s
peertube@peertube:/home/ubuntu$ cd /var/www/peertube
peertube@peertube:~$
peertube@peertube:~$ VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4) && echo "Latest Peertube version is $VERSION"
Latest Peertube version is v7.3.0
peertube@peertube:~$ mkdir config storage versions
peertube@peertube:~$ chmod 750 config/
peertube@peertube:~$ cd /var/www/peertube/versions
peertube@peertube:~/versions$
peertube@peertube:~/versions$ wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip"
peertube@peertube:~/versions$ unzip peertube-${VERSION}.zip && rm peertube-${VERSION}.zip
peertube@peertube:~/versions$ cd /var/www/peertube
peertube@peertube:~$ ln -s versions/peertube-${VERSION} ./peertube-latest
peertube@peertube:~$ curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
peertube@peertube:~$ source ~/.bashrc
peertube@peertube:~$ nvm install node
peertube@peertube:~$ npm install -g npm@11.6.2
peertube@peertube:~$ npm uninstall -g yarn
peertube@peertube:~$ npm install -g yarn@1.22.22
peertube@peertube:~$ cd peertube-latest
peertube@peertube:~/peertube-latest$
peertube@peertube:~/peertube-latest$ npm run install-node-dependencies -- --production
> peertube@7.3.0 install-node-dependencies
> yarn install --pure-lockfile --production
yarn install v1.22.22
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning bare-fs@4.1.6: The engine "bare" appears to be invalid.
warning bare-os@3.6.1: The engine "bare" appears to be invalid.
warning require-addon@1.1.0: The engine "bare" appears to be invalid.
[4/5] Linking dependencies...
warning " > chai-json-schema@1.5.1" has incorrect peer dependency "chai@>= 1.6.1 < 5".
warning "swagger-cli > @apidevtools/swagger-cli > @apidevtools/swagger-parser@10.1.1" has unmet peer dependency "openapi-types@>=7".
[5/5] Building fresh packages...
$ test -n "$NOCLIENT" || (cd client && yarn install --pure-lockfile)
yarn install v1.22.22
[1/4] Resolving packages...
[2/4] Fetching packages...
warning @zip.js/zip.js@2.7.73: The engine "deno" appears to be invalid.
warning @zip.js/zip.js@2.7.73: The engine "bun" appears to be invalid.
warning bare-fs@4.2.3: The engine "bare" appears to be invalid.
warning bare-os@3.6.2: The engine "bare" appears to be invalid.
warning chart.js@4.5.0: The engine "pnpm" appears to be invalid.
[3/4] Linking dependencies...
warning " > angular-eslint@19.8.1" has unmet peer dependency "typescript-eslint@^8.0.0".
warning "@wdio/local-runner > @wdio/runner@9.19.2" has unmet peer dependency "webdriverio@^9.0.0".
warning " > expect-webdriverio@5.4.2" has unmet peer dependency "@wdio/globals@^9.0.0".
warning " > expect-webdriverio@5.4.2" has unmet peer dependency "@wdio/logger@^9.0.0".
warning " > expect-webdriverio@5.4.2" has unmet peer dependency "webdriverio@^9.0.0".
warning " > stylelint-config-sass-guidelines@11.1.0" has unmet peer dependency "postcss@^8.4.21".
warning "stylelint-config-sass-guidelines > postcss-scss@4.0.9" has unmet peer dependency "postcss@^8.4.29".
[4/4] Building fresh packages...
Done in 34.61s.
Done in 43.73s.
peertube@peertube:~/peertube-latest$
peertube@peertube:~/peertube-latest$ cd ..
peertube@peertube:~$
peertube@peertube:~$ cp peertube-latest/config/default.yaml config/default.yaml
peertube@peertube:~$ cp peertube-latest/config/production.yaml.example config/production.yaml
Action :
peertube@peertube:~$ openssl rand -hex 32
Ouvrir :
peertube-latest/config/production.yaml
Chercher :
listen:
hostname: "127.0.0.1"
port: 9000
Remplacer par :
listen:
hostname: "0.0.0.0"
port: 9000
Ouvrir :
config/production.yaml
Chercher :
webserver:
https: true
hostname: 'example.com'
port: 443
Remplacer par :
webserver:
https: true
hostname: 'peertube.metalhorreur.fr'
port: 443
Chercher :
secrets:
# Generate one using `openssl rand -hex 32`
peertube: '<copier/coller la chaine de caractère généré en haut>'
Remplacer par :
secrets:
peertube: '<>'
Chercher :
database:
hostname: '127.0.0.1'
port: 5432
ssl: false
suffix: '_prod'
username: 'peertube'
password: 'peertube'
pool:
max: 5
Remplacer par :
database:
hostname: '127.0.0.1'
port: 5432
ssl: false
suffix: '_prod'
username: 'peertube'
password: '<mot de passe>'
pool:
max: 5
Chercher :
admin:
# Used to generate the root user at first startup
# And to receive emails from the contact form
email: 'admin@example.com'
Remplacer par :
admin:
email: 'lesanglierdesardennes@gmail.com'
Chercher :
instance:
name: 'PeerTube'
Remplacer par :
instance:
name: 'PeerTube Metal Horreur'
peertube@peertube:~$ [Contrôle] + [D]
exit
ubuntu@peertube:~$
ubuntu@peertube:~$ sudo cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/
ubuntu@peertube:~$ sudo systemctl daemon-reload
ubuntu@peertube:~$ sudo systemctl enable peertube
Created symlink /etc/systemd/system/multi-user.target.wants/peertube.service → /etc/systemd/system/peertube.service.
ubuntu@peertube:~$ sudo systemctl start peertube
ubuntu@peertube:~$ sudo systemctl status peertube
● peertube.service - PeerTube daemon
Loaded: loaded (/etc/systemd/system/peertube.service; enabled; preset: enabled)
Active: active (running) since Fri 2025-11-07 20:02:38 UTC; 5s ago
Main PID: 17145 (node)
Tasks: 11 (limit: 77002)
Memory: 126.3M (peak: 126.4M)
CPU: 3.754s
CGroup: /system.slice/peertube.service
└─17145 /usr/bin/node dist/server
Nov 07 20:02:38 peertube systemd[1]: Started peertube.service - PeerTube daemon.
ubuntu@peertube:~$
ubuntu@peertube:~$ sudo journalctl -feu peertube
...
Nov 07 20:02:38 peertube systemd[1]: Started peertube.service - PeerTube daemon.
Nov 07 20:02:45 peertube peertube[17145]: webfinger.js v2.8.2 loaded
Nov 07 20:02:49 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:02:49.193 info: Using following configuration file hierarchy: /var/www/peertube/config/default.yaml -> /var/www/peertube/config/production.yaml.
Nov 07 20:02:49 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:02:49.196 warn: SMTP is not configured so the contact form will not work.
Nov 07 20:02:49 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:02:49.350 info: i18n initialized with locales: ar, ca-ES, cs-CZ, de-DE, el-GR, en-US, eo, es-ES, eu-ES, fa-IR, zh-Hans-CN, vi-VN, uk-UA, tr-TR, tok, zh-Hant-TW, th-TH, sv-SE, sq, sk-SK, pt-PT, ru-RU, pt-BR, pl-PL, oc, nn, nb-NO, nl-NL, kab, ja-JP, it-IT, is, hu-HU, hr, gl-ES, gd, fr-FR, fi-FI
Nov 07 20:02:49 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:02:49.671 info: Database peertube_prod is ready.
Nov 07 20:03:50 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:50.351 info: Creating application account.
Nov 07 20:03:50 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:50.365 info: Creating a default OAuth Client.
Nov 07 20:03:50 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:50.382 info: Creating the administrator.
Nov 07 20:03:50 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:50.610 info: Client id: AAAAAAAAAAAAAAAAAAAAAAAAA
Nov 07 20:03:50 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:50.610 info: Client secret: BBBBBBBBBBBBBBBBBBBBBBBBB
Nov 07 20:03:50 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:50.802 info: Generating a RSA key...
Nov 07 20:03:50 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:50.804 info: Generating a RSA key...
Nov 07 20:03:50 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:50.893 info: Generating a RSA key...
Nov 07 20:03:51 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:51.085 info: Username: root
Nov 07 20:03:51 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:51.085 info: User password: CCCCCCCCCCCCCCCCCCCC
Nov 07 20:03:51 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:51.195 info: Connecting to Redis in "standalone" mode...
Nov 07 20:03:51 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:51.195 info: Using standalone redis options {
Nov 07 20:03:51 peertube peertube[17145]: "db": 0,
Nov 07 20:03:51 peertube peertube[17145]: "host": "127.0.0.1",
Nov 07 20:03:51 peertube peertube[17145]: "port": 6379,
Nov 07 20:03:51 peertube peertube[17145]: "path": null
Nov 07 20:03:51 peertube peertube[17145]: }
Nov 07 20:03:51 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:51.198 error: Cannot use SMTP server because of lack of configuration. PeerTube will not be able to send mails!
Nov 07 20:03:51 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:51.255 info: Connected to redis.
Nov 07 20:03:51 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:51.548 info: HTTP server listening on 127.0.0.1:9000
Nov 07 20:03:51 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:51.548 info: Web server: https://peertube.metalhorreur.fr
ubuntu@peertube:~$ ss -ltnp | grep 9000
LISTEN 0 511 0.0.0.0:9000 0.0.0.0:*
ubuntu@peertube:~$ netstat -ltnp | grep 9000
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp 0 0 0.0.0.0:9000 0.0.0.0:* LISTEN
ubuntu@peertube:~$ curl -I http://127.0.0.1:9000
HTTP/1.1 200 OK
x-powered-by: PeerTube
X-Frame-Options: DENY
Tk: N
Access-Control-Allow-Origin: *
X-RateLimit-Limit: 500
X-RateLimit-Remaining: 499
Date: Fri, 07 Nov 2025 20:48:16 GMT
X-RateLimit-Reset: 1762548507
Content-Type: text/html; charset=utf-8
Cache-Control: max-age=0, no-cache, must-revalidate
Vary: Accept-Language
Content-Length: 20848
ETag: W/"5170-SFKXrWfzZ84wiOIeQ3RLjUCOMb0"
Connection: keep-alive
Keep-Alive: timeout=5
ubuntu@serveur666:~$ sudo lxc config device add proxy http80 proxy listen=tcp:0.0.0.0:80 connect=tcp:127.0.0.1:80
Device http80 added to proxy
ubuntu@serveur666:~$ sudo lxc config device add proxy http443 proxy listen=tcp:0.0.0.0:443 connect=tcp:127.0.0.1:443
Device http443 added to proxy
ubuntu@serveur666:~$ lxc list
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| peertube | RUNNING | 10.123.236.180 (eth0) | fd42:e702:d7b9:a433:216:3eff:fed5:37c9 (eth0) | CONTAINER | 1 |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| proxy | RUNNING | 10.123.236.230 (eth0) | fd42:e702:d7b9:a433:216:3eff:fe64:5fce (eth0) | CONTAINER | 0 |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
ubuntu@serveur666:~$ lxc exec proxy -- sudo --user ubuntu --login
Créer :
/etc/nginx/sites-available/peertube
Ajouter :
server {
listen 80;
server_name peertube.metalhorreur.fr;
# Taille d’upload suffisante
client_max_body_size 5000M;
# PeerTube envoie souvent ce header
add_header X-Content-Type-Options nosniff;
# Proxy vers le conteneur PeerTube
location / {
proxy_pass http://10.123.236.180:9000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket (indispensable pour certaines fonctions PeerTube)
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
# Fichiers statiques parfois servis à part
location /static/ {
proxy_pass http://10.123.236.180:9000;
}
}
ubuntu@proxy:~$ sudo ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube
ubuntu@proxy:~$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
ubuntu@proxy:~$ sudo systemctl reload nginx
ubuntu@proxy:~$ sudo apt install certbot python3-certbot-nginx
ubuntu@proxy:~$ sudo certbot --nginx -d peertube.metalhorreur.fr
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
(Enter 'c' to cancel): lesanglierdesardennes@gmail.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.5-February-24-2025.pdf. You must
agree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Account registered.
Requesting a certificate for peertube.metalhorreur.fr
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/peertube.metalhorreur.fr/fullchain.pem
Key is saved at: /etc/letsencrypt/live/peertube.metalhorreur.fr/privkey.pem
This certificate expires on 2026-02-05.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
Deploying certificate
Successfully deployed certificate for peertube.metalhorreur.fr to /etc/nginx/sites-enabled/peertube
Congratulations! You have successfully enabled HTTPS on https://peertube.metalhorreur.fr
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
* Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
* Donating to EFF: https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ubuntu@proxy:~$
ubuntu@proxy:~$ curl -I http://10.123.236.180:9000
HTTP/1.1 200 OK
x-powered-by: PeerTube
X-Frame-Options: DENY
Tk: N
Access-Control-Allow-Origin: *
X-RateLimit-Limit: 500
X-RateLimit-Remaining: 498
Date: Fri, 07 Nov 2025 20:57:59 GMT
X-RateLimit-Reset: 1762549083
Content-Type: text/html; charset=utf-8
Cache-Control: max-age=0, no-cache, must-revalidate
Vary: Accept-Language
Content-Length: 20848
ETag: W/"5170-Swf+LjIQUksetdAhLF9KJeXx0/k"
Connection: keep-alive
Keep-Alive: timeout=5
https://peertube.metalhorreur.fr/
https://peertube.metalhorreur.fr/login
Identifiant : root
Mot de passe : CCCCCCCCCCCCCCCCCCC
Le mot de passe se trouve dans le fichier de log démarrage : II/ 6/
Nov 07 20:03:51 peertube peertube[17145]: [peertube.metalhorreur.fr:443] 2025-11-07 20:03:51.085 info: User password: CCCCCCCCCCCCCCCCCCC
util01@station40:~$ curl -X GET https://peertube.metalhorreur.fr/api/v1/oauth-clients/local
{"client_id":"DDDDDDDDDDDDDDDDDDDD","client_secret":"EEEEEEEEEEEEEEEEEEEEEEE"}
util01@station40:~$ curl -X POST https://peertube.metalhorreur.fr/api/v1/users/token \
-d "client_id=DDDDDDDDDDDDDDDDDDDD" \
-d "client_secret=EEEEEEEEEEEEEEEEEEEEEEE" \
-d "grant_type=password" \
-d "username=root" \
-d "password=CCCCCCCCCCCCCCCCCCC"
{"token_type":"Bearer","access_token":"EEEEEEEEEEEEEEEEEEE","refresh_token":"FFFFFFFFFFFFFFFFFFFFF","expires_in":86399,"refresh_token_expires_in":1209599}
util01@station40:~$ curl -X GET "https://peertube.metalhorreur.fr/api/v1/users" \
-H "Authorization: Bearer EEEEEEEEEEEEEEEEEEEEEEEEEE"
util01@station40:~/METALHORREURSERV$ curl -X GET "https://peertube.metalhorreur.fr/api/v1/video-channels" -H "Authorization: Bearer EEEEEEEEEEEEEEEEEEEEEEEEEE"
ubuntu@peertube:~$ sudo -u postgres psql peertube_prod
peertube_prod=# SELECT id, "preferredUsername", type, url FROM "actor";
id | preferredUsername | type | url
----+-------------------+-------------+---------------------------------------------------------------
2 | root | Person | https://peertube.metalhorreur.fr/accounts/root
3 | root_channel | Group | https://peertube.metalhorreur.fr/video-channels/root_channel
1 | peertube | Application | https://peertube.metalhorreur.fr/accounts/peertube
4 | metalhorreur | Group | https://peertube.metalhorreur.fr/video-channels/metalhorreur
6 | metal_horreur | Group | https://peertube.metalhorreur.fr/video-channels/metal_horreur
5 | nekrofage | Person | https://peertube.metalhorreur.fr/accounts/nekrofage
(6 rows)
peertube_prod=#
peertube_prod=# DELETE FROM "actor" WHERE id=4;
DELETE 1
peertube_prod=# DELETE FROM "actor" WHERE id=5;
DELETE 1
peertube_prod=# DELETE FROM "actor" WHERE id=6;
DELETE 1
peertube_prod=# SELECT id, "preferredUsername", type, url FROM "actor";
id | preferredUsername | type | url
----+-------------------+-------------+--------------------------------------------------------------
2 | root | Person | https://peertube.metalhorreur.fr/accounts/root
3 | root_channel | Group | https://peertube.metalhorreur.fr/video-channels/root_channel
1 | peertube | Application | https://peertube.metalhorreur.fr/accounts/peertube
(3 rows)
peertube_prod=# \q
ubuntu@peertube:~$
ubuntu@peertube:~$ sudo systemctl restart peertube