Installation
Arch Linux
On Arch Linux, PeerTube can be installed through the Arch User Repository thanks to a community package made by daftaupe.
asp checkout peertube
cd peertube
makepkg --syncdeps --rmdeps --install --clean
Or
yay -S peertube
Configuration
You now have to configure the database
and credentials to it in the configuration file of PeerTube
in /usr/share/webapps/peertube/config/production.yaml
.
Currently, there are no Arch packages available for RC or nightly builds of PeerTube. Please use the tarball:
Manual install via tarball
You can install a release of PeerTube by downloading its tarball.
cd /var/www/
curl -s https://api.github.com/repos/Chocobozzz/PeerTube/releases/latest \
| grep browser_download_url \
| grep tar.xz \
| cut -d '"' -f 4 \
| wget -qi -
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
cd /var/www
curl -s https://api.github.com/repos/Chocobozzz/PeerTube/releases/latest \
| grep browser_download_url \
| grep tar.xz \
| cut -d '"' -f 4 \
| wget -qi -
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
cd /var/www
curl -L https://api.github.com/repos/Chocobozzz/PeerTube/tarball/develop
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
Before extracting PeerTube, it is recommended that you verify the tarball using GPG:
curl -s 'https://api.github.com/users/Chocobozzz/gpg_keys' \
| python3 -c "import sys, json; print(json.load(sys.stdin)[0]['raw_key'])" \
| gpg --import
Now verify it:
gpg --verify <archive_name>
# Look for "Good signature from 'Chocobozzz'" in the output
Now that you’re in possession of the latest release, you can follow the reference production guide.
CentOS / Fedora / RHEL
On CentOS, Fedora and RHEL, you can install PeerTube via a community package made by daftaupe on COPR.
dnf copr enable daftaupe/peertube
Prerequisites
You will need PostgreSQL, Node.JS and FFMpeg :
- Fedora you need RPM Fusion repository enabled
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
- CentOS you will need EPEL and the unofficial EPEL-multimedia repositories enabled
cd /etc/yum.repos.d && curl -O https://negativo17.org/repos/epel-multimedia.repo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm https://negativo17.org/repos/epel-multimedia.repo
Setup the database
su - postgres
initdb
createuser peertube -W
createdb -O peertube peertube_prod
echo "host peertube peertube 127.0.0.1/32 md5" >> data/pg_hba.conf
systemctl reload postgresql
Start the services
systemctl start redis
Edit the configuration to fit your needs
vim /etc/peertube/production.yaml
Start PeerTube and get the initial root / password
systemctl start peertube && journalctl -f -u peertube
Currently, there are no RPM packages available for RC or nightly builds of PeerTube. Please use the tarball:
Manual install via tarball
You can install a release of PeerTube by downloading its tarball.
cd /var/www/
curl -s https://api.github.com/repos/Chocobozzz/PeerTube/releases/latest \
| grep browser_download_url \
| grep tar.xz \
| cut -d '"' -f 4 \
| wget -qi -
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
cd /var/www
curl -s https://api.github.com/repos/Chocobozzz/PeerTube/releases/latest \
| grep browser_download_url \
| grep tar.xz \
| cut -d '"' -f 4 \
| wget -qi -
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
cd /var/www
curl -L https://api.github.com/repos/Chocobozzz/PeerTube/tarball/develop
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
Before extracting PeerTube, it is recommended that you verify the tarball using GPG:
curl -s 'https://api.github.com/users/Chocobozzz/gpg_keys' \
| python3 -c "import sys, json; print(json.load(sys.stdin)[0]['raw_key'])" \
| gpg --import
Now verify it:
gpg --verify <archive_name>
# Look for "Good signature from 'Chocobozzz'" in the output
Now that you’re in possession of the latest release, you can follow the reference production guide.
Debian / Ubuntu
On Debian or Ubuntu Linux, you can install Yarn, Node and PeerTube in one shot via this community maintained debian package definition. It is left for you to build at framagit.org/rigelk/package-debian-peertube.
Afterwards you still have to configure the database and credentials to it in the configuration file of PeerTube in /etc/peertube/production.yaml
.
Currently, there are no Debian packages available for RC or nightly builds of PeerTube. Please use the production guide.
Docker
You can quickly get a server running using Docker. You need to have docker and docker-compose installed.
Production
Build your own Docker image
$ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube
$ cd /tmp/peertube
$ docker build . -f ./support/docker/production/Dockerfile.stretch
Run a preconfigured setup with all dependencies
PeerTube needs a PostgreSQL and a Redis instance to work correctly. If you want
to quickly set up a full environment, either for trying the service or in
production, you can use a docker-compose
setup.
$ git clone https://github.com/chocobozzz/PeerTube /tmp/peertube
$ cd /tmp/peertube
Then tweak the docker-compose.yml
file there according to your needs. Then
you can use the regular up
command to set it up, with possible overrides of
the environment variables:
$ PEERTUBE_WEBSERVER_HOSTNAME=peertube.lvh.me \
PEERTUBE_ADMIN_EMAIL=test@example.com \
PEERTUBE_TRANSCODING_ENABLED=true \
PEERTUBE_SIGNUP_ENABLED=true \
PEERTUBE_SMTP_HOST=mail.lvh.me \
PEERTUBE_SMTP_PORT=1025 \
PEERTUBE_SMTP_FROM=noreply@peertube.lvh.me \
docker-compose -f support/docker/production/docker-compose.yml \
--project-directory . up
Other environment variables are used in
support/docker/production/config/custom-environment-variables.yaml
and can be
intuited from usage.
For this example configuration, a reverse proxy is quite recommended. The
example Docker Compose file provides example labels for a Traefik load
balancer, although any HTTP reverse proxy will work fine. See the example
Nginx configuration support/nginx/peertube
file to get an idea of
recommendations and requirements to run PeerTube the most efficiently.
Important: note that you’ll get the initial root
user password from the
program output, so check out your logs to find them.
Development
The Docker image that’s preconfigured in support/docker/dev
contains all the
services embedded in one image, so as to work correctly on
Janitor. It is much not advised to use it in
production.
FreeBSD
There is no FreeBSD port of PeerTube available at the time, but there is a dedicated dependency guide in the official docs!
After that, follow the regular production guide, which also has FreeBSD specifics.
Currently, there are no openSUSE packages available for RC or nightly builds of PeerTube. Please use the tarball:
Manual install via tarball
You can install a release of PeerTube by downloading its tarball.
cd /var/www/
curl -s https://api.github.com/repos/Chocobozzz/PeerTube/releases/latest \
| grep browser_download_url \
| grep tar.xz \
| cut -d '"' -f 4 \
| wget -qi -
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
cd /var/www
curl -s https://api.github.com/repos/Chocobozzz/PeerTube/releases/latest \
| grep browser_download_url \
| grep tar.xz \
| cut -d '"' -f 4 \
| wget -qi -
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
cd /var/www
curl -L https://api.github.com/repos/Chocobozzz/PeerTube/tarball/develop
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
Before extracting PeerTube, it is recommended that you verify the tarball using GPG:
curl -s 'https://api.github.com/users/Chocobozzz/gpg_keys' \
| python3 -c "import sys, json; print(json.load(sys.stdin)[0]['raw_key'])" \
| gpg --import
Now verify it:
gpg --verify <archive_name>
# Look for "Good signature from 'Chocobozzz'" in the output
Now that you’re in possession of the latest release, you can follow the reference production guide.
macOS
Currently, there are no packages available of PeerTube on macOS. Since macOS servers in production are an endangered specie, chances are you will want to install PeerTube to hack on it rather than host it. In that case, please follow the development guide.
YunoHost (Debian-based)
On Debian running YunoHost, you can install Yarn, Node and PeerTube in one shot via a community package.
See here for support.
Currently, there are no Debian packages available for RC or nightly builds of PeerTube. Please use the production guide.
Windows
No installation method is currently available on Windows servers.
Production / Any OS
This is the recommended way to install PeerTube. It ensures we can provide you with the best support, as community packages are potentially less maintained and are harder to debug for us.
The documentation for the production install method is in the main repository, to always be in sync. It will ask you to download the release at some point, which you can do as follows:
Manual install via tarball
You can install a release of PeerTube by downloading its tarball.
cd /var/www/
curl -s https://api.github.com/repos/Chocobozzz/PeerTube/releases/latest \
| grep browser_download_url \
| grep tar.xz \
| cut -d '"' -f 4 \
| wget -qi -
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
cd /var/www
curl -s https://api.github.com/repos/Chocobozzz/PeerTube/releases/latest \
| grep browser_download_url \
| grep tar.xz \
| cut -d '"' -f 4 \
| wget -qi -
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
cd /var/www
curl -L https://api.github.com/repos/Chocobozzz/PeerTube/tarball/develop
tar -xJf <archive_name>
# PeerTube is now in /var/www/peertube-[version]/
Before extracting PeerTube, it is recommended that you verify the tarball using GPG:
curl -s 'https://api.github.com/users/Chocobozzz/gpg_keys' \
| python3 -c "import sys, json; print(json.load(sys.stdin)[0]['raw_key'])" \
| gpg --import
Now verify it:
gpg --verify <archive_name>
# Look for "Good signature from 'Chocobozzz'" in the output
Now that you’re in possession of the latest release, you can follow the reference production guide.
Bleeding Edge (git) / Any OS
First, go to the Peertube folder and switch to the Peertube user.
cd /var/www/peertube/versions/
sudo -u peertube -H bash
Then clone the git repository.
git clone https://github.com/Chocobozzz/PeerTube.git peertube-develop
cd peertube-develop/
It should automatically be on the develop
branch, which you can verify with git branch
. You can
also switch to another branch or a specific commit with git checkout [branch or commit]
. Once you
have the correct version, run the build:
yarn install --pure-lockfile
npm run build
The compilation will take a long time. You can also run it on your local computer, and transfer the entire folder to your server.
Now you should make sure to add any new config fields to your production.yaml
. And you should make
a backup of the database:
SQL_BACKUP_PATH="backup/sql-peertube_prod-$(date -Im).bak" && \
cd /var/www/peertube && sudo -u peertube mkdir -p backup && \
sudo -u postgres pg_dump -F c peertube_prod | sudo -u peertube tee "$SQL_BACKUP_PATH" >/dev/null
Finally, update the peertube-latest
symlink to point at the new version:
cd /var/www/peertube && \
sudo unlink ./peertube-latest && \
sudo -u peertube ln -s versions/peertube-develop ./peertube-latest
Now you just need to restart Peertube. With systemd, just run sudo systemctl restart peertube
.
Do not try to upgrade from one development version to another by running git pull
and npm run build
. This
will break your website. Either switch back to a release version, or make a copy of the peertube-develop
folder and run the compilation there.
Problems? If you are unable to install PeerTube with any of these installers, please search through GitHub for an existing issue or open a new one. If the installer is community-maintained, please seek first for support at their maintainers.