- Check if the script is running as root
- Check if the host works with systemd
- Check if cURL is installed
- Check if Docker >= v17.06 is installed
- Install or upgrade Compose binary from GitHub Releases
- Create or upgrade CLI
The next steps are done only if there is not any PeerTube docker stack already installed:
- Ask domain and email if not defined in environment variables
- Create non-root system user owner of working directory
- Create working directory
/var/peertube
- Get latest official compose setup of PeerTube stack from GitHub Raw
- Generate PostgreSQL credentials
- Use defined
MY_EMAIL_ADDRESS
andMY_DOMAIN
and wait for editing updated.env
- Create
peertube.service
- Pull latest images
- Run
peertube.service
- Up the stack
Root only:
curl https://getpeer.tube | sh
With sudo:
curl https://getpeer.tube -o getpt.sh && sudo sh getpt.sh
You may want to auto-fill environment variables MY_EMAIL_ADDRESS
and MY_DOMAIN
:
Step by step:
export [email protected]
export MY_DOMAIN=domain.tld
curl https://getpeer.tube -o getpeertube.sh
(sudo -E) sh getpeertube.sh
By one command:
[email protected] MY_DOMAIN=domain.tld curl https://getpeer.tube | sh
You can also download and run the script manually.
💡 Don't forget to backup your peertube docker stack.
💡 Edit any configuration file one by one if required by the release.
💡 Check breaking changes here: https://github.com/Chocobozzz/PeerTube/releases
$ peertube stack:upgrade
You can use all the official server tools commands:
$ peertube parse-log
$ peertube prune-storage
$ peertube update-host
$ peertube reset-password -- -u target_username
$ peertube plugin:install -- --npm-name peertube-plugin-myplugin
...
For each backup you'll need to dump the PostreSQL database :
Before backup
$ peertube postgres:dump /var/peertube/docker-volume/db.tar
For each restoration you need to down all container with :
Before restoration
$ peertube stack:down
If you've dumped the database you don't need to copy the db files in the mounted volume :
$ rm -r /var/peertube/docker-volume/db
After restoration
$ peertube postgres:restore /var/peertube/docker-volume/db.tar
$ peertube stack:up
On the old server :
$ peertube postgres:dump /var/peertube/docker-volume/db.tar
$ peertube stack:down
$ rsync -av --exclude docker-volume/db /var/peertube/ username@new-server:/var/peertube/
WARNING: this command could fail with docker-volume/opendkim/keys/peertube.*
if you do not have a root access on the old server, in this case, don't worry, you just need to copy them manually. =)
On the new server :
$ peertube postgres:up
$ peertube postgres:restore /var/peertube/docker-volume/db.tar
$ systemctl start peertube
Simply:
$ peertube # Will display command list
Or see https://github.com/kimsible/getpeer.tube/blob/master/cli/peertube.
Want to uninstall the PeerTube stack and / or the CLI ?
systemctl disable peertube # disabled peertube service
rm /etc/systemd/system/peertube.service # delete peertube service
cd /var/peertube
docker-compose down -v --remove-orphans # down all containers
docker rmi $(docker images -a -q) # remove all cached images
docker volume rm $(docker volume ls -q) # remove all cached volumes
docker network prune # remove all unsued networks
rm /usr/sbin/peertube # remove CLI
rm -r /var/peertube #remove peertube stack
See https://github.com/kimsible/getpeer.tube/blob/master/test/README.md