From 5323e10feb193d120bdbbeb219ddb8a2b84bbb62 Mon Sep 17 00:00:00 2001
From: Luke Smith This handy one-liner can be used to determine the latest PeerTube version: Using Next, a basic directory structure needs to be setup in the PeerTube user's home directory (/var/www/peertube). Still as the PeerTube user, we can now check for the most recent PeerTube versions number, download and install it in the newly created To ensure permissions remain the same while managing files as PeerTube, The downloaded release can then be symbolically linked to Finally, a PeerTube release can be downloaded from the GitHub page using the The downloaded release can then be symbolically linked to PeerTube's default config file can be copied over to PeerTube's default config file can be copied over to Note that we are still running these as the PeerTube user (having run Now the At this point, we have done all we need to do as the PeerTube user. Run First, we will want a Certbot SSL certificate to encrypt connections to our PeerTube instance.
+ Just run the following: PeerTube includes an NGINX configuration that can be copied over to PeerTube includes an Nginx configuration that can be copied over to Once you're happy with the NGINX config file, link it to Once you're happy with the Nginx config file, link it to It's highly recommended to generate certificates for use with your PeerTube site, and this can be easily done with Let's Encrypt's The certificates are generated standalone since the PeerTube NGINX config file already includes configuration for certbot. A config file for a systemd daemon is included in PeerTube and can be setup like so: A config file for a systemd daemon is included in PeerTube and can be setup and started like so: Now, finally, run the PeerTube daemon to start PeerTube:
+ PeerTube will take a momemnt to start, but after it does, you can check its status with To set a password for your admin user, run: Login to your PeerTube instance using the admin email specified in your Once logged in, it's recommended to create a separate user without admin privileges for uploading videos to PeerTube.
- This can be done easily from the users tab in the administration section:Installation
- su -l, we will become the PeerTube user to create the required directories and download and install PeerTube itself with the proper permissions.
+ First, we create the required directories.
+ 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"
- su -l peertube
+mkdir config storage versions
+chmod 750 configDownloading PeerTube
+ versiond directory.
- VERSION=$(curl -s https://api.github.com/repos/chocobozzz/peertube/releases/latest | grep tag_name | cut -d '"' -f 4)
+cd /var/www/peertube/versions
+wget "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip"
+unzip peertube-${VERSION}.zip
+rm peertube-${VERSION}.zipsudo can be used to perform actions:Installation via Yarn
-
+sudo -u peertube mkdir config storage versions
-sudo -u peertube chmod 750 config/var/www/peertube/peertube-latest and yarn is used to install PeerTube:VERSION variable from before:
-
-cd /var/www/peertube/versions
-sudo -u peertube wget -q "https://github.com/Chocobozzz/PeerTube/releases/download/${VERSION}/peertube-${VERSION}.zip"
-sudo -u peertube unzip -q peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip/var/www/peertube/peertube-latest and yarn is used to install PeerTube:
+
-sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
-cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfilecd /var/www/peertube
+ln -s versions/peertube-${VERSION} ./peertube-latest
+cd ./peertube-latest
+yarn install --production --pure-lockfileConfiguration
- /var/www/peertube/config.production.yaml so it can actually be used:/var/www/peertube/config/production.yaml so it can actually be used:su -l peertube).
+cp peertube-latest/config/production.yaml.example config/production.yaml
cd /var/www/peertube
- sudo -u peertube cp peertube-latest/production.yaml config/production.yamlproduction.yaml file must be edited in the following ways:NGINX
+ exit or press Ctrl-d to log out and return to the root prompt where we will configure Nginx and other system settings.Certbot
+
+
+
+ certbot --nginx -d peertube.example.org certonlyNginx
- /etc/nginx/sites-available:
+ /etc/nginx/sites-available:
@@ -156,43 +168,35 @@ cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-loc
cp /var/www/peertube/peertube-latest/support/nginx/peertube /etc/nginx/sites-available/peertube
- sed -i 's/${WEBSERVER_HOST}/example.org/g' /etc/nginx/sites-available/peertube
sed -i 's/${PEERTUBE_HOST}/127.0.0.1:9000/g' /etc/nginx/sites-available/peertubesites-enabled to activate it:sites-enabled to activate it:
- ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertubeEncryption with Certbot
-
- certbot command:
-
- systemctl stop nginx
-certbot certonly --standalone -d example.org
-sudo systemctl restart nginxRunning PeerTube
-
+systemctl daemon-reload
+systemctl start peertube
- cp /var/www/peertube/peertube-latest/support/systemd/peertube.service /etc/systemd/system/
-systemctl daemon-reload
+ systemctl start peertubesystemctl status peertube and at this point, your PeerTube site should be live!
+ Using PeerTube
+ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u rootcd /var/www/peertube/peertube-latest
+NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u rootproduction.yaml file and the admin password you just set.
Enjoy your PeerTube instance!
-- cgit v1.2.3