We need to create the database:
sudo -u postgres createuser -P peertube
- sudo -u postgres createdb -O peertube peertube
+ sudo -u postgres createdb -O peertube peertube_prod
# User
We need to create the peertube user:
Update the service file:
sudo vim /etc/systemd/system/peertube.service
+
+It should look like this:
+
+ [Unit]
+ Description=PeerTube daemon
+
+ [Service]
+ Type=simple
+ Environment=NODE_ENV=production
+ User=peertube
+ Group=peertube
+ ExecStart=/usr/bin/npm start
+ WorkingDirectory=/home/peertube/PeerTube/
+ StandardOutput=syslog
+ StandardError=syslog
+ SyslogIdentifier=peertube
+ Restart=always
+
+ [Install]
+ WantedBy=multi-user.target
+
+Then tell systemd to reload its config:
+
sudo systemctl daemon-reload
# Run PeerTube