# Dependencies
We need to install dependencies:
- # curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- # echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- # echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/sources.list
- # apt-get update
- # apt-get upgrade -y
- # curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
- # apt-get install -y nodejs ffmpeg postgresql-9.4 openssl nginx yarn
+ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
+ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
+ echo "deb http://ftp.debian.org/debian jessie-backports main" | sudo tee /etc/apt/sources.list.d/jessie-backports.list
+ sudo apt-get update
+ sudo apt-get dist-upgrade
+ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
+ sudo apt-get install -y nodejs ffmpeg postgresql-9.4 openssl nginx yarn
# Database
We need to create the database:
- # su - postgres
- $ psql postgres
-
- CREATE USER peertube WITH PASSWORD 'peertube';
- CREATE DATABASE peertube_prod OWNER peertube;
- GRANT ALL PRIVILEGES ON DATABASE peertube_prod to peertube;
- \q
+ sudo -u postgres createuser -P peertube
+ sudo -u postgres createdb -O peertube peertube
# User
We need to create the peertube user:
- # useradd -m -d /home/peertube -s /bin/bash -p peertube peertube
+ sudo useradd -m -d /home/peertube -s /bin/bash -p peertube peertube
And set its password:
- # passwd peertube
+ sudo passwd peertube
# Build PeerTube application
Master branch is for production, develop branch is for... development.
- # su - peertube
- $ cd /home/peertube
- $ git clone -b master https://github.com/Chocobozzz/PeerTube
- $ cd PeerTube
- $ yarn install
- $ npm run build
+ sudo su - peertube
+ cd /home/peertube
+ git clone -b master https://github.com/Chocobozzz/PeerTube
+ cd PeerTube
+ yarn install
+ npm run build
# Configuration files
Copy the production configuration file template:
- # cd /home/peertube/PeerTube
- # su - peertube
- $ cp config/production.yaml.example config/production.yaml
+ sudo su - peertube
+ cd /home/peertube/PeerTube
+ cp config/production.yaml.example config/production.yaml
Modify the configuration file:
- $ vim config/production.yaml
+ vim config/production.yaml
# Webserver
Copy the nginx configuration template:
- # cp /home/peertube/PeerTube/support/nginx/peertube-https /etc/nginx/sites-available/peertube
+ sudo cp /home/peertube/PeerTube/support/nginx/peertube-https /etc/nginx/sites-available/peertube
Modify the configuration file:
- # vim /etc/nginx/sites-available/peertube
+ sudo vim /etc/nginx/sites-available/peertube
Active the configuration file:
- # ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube
- # systemctl nginx reload
+ sudo ln -s /etc/nginx/sites-available/peertube /etc/nginx/sites-enabled/peertube
+ sudo systemctl reload nginx
# Systemd
Copy the service file:
- # cp /home/peertube/PeerTube/support/systemd/peertube.service /etc/systemd/system/
+ sudo cp /home/peertube/PeerTube/support/systemd/peertube.service /etc/systemd/system/
Update the service file:
- # vim /etc/systemd/system/peertube.service
- # systemd daemon-reload
+ sudo vim /etc/systemd/system/peertube.service
+ sudo systemctl daemon-reload
# Run PeerTube
- # systemctl start peertube
- # journalctl -feu peertube
\ No newline at end of file
+ sudo systemctl start peertube
+ sudo journalctl -feu peertube