# Production guide
* [Installation](#installation)
- * [Upgrade](#upgrade)
+ * [Upgrade](#upgrade)
## Installation
$ sudo passwd peertube
```
+**On FreeBSD**
+
+```
+$ sudo pw useradd -n peertube -d /var/www/peertube -s /usr/local/bin/bash -m
+$ sudo passwd peertube
+```
+or use `adduser` to create it interactively.
+
### Database
Create the production database and a peertube user inside PostgreSQL:
$ sudo -u peertube unzip peertube-${VERSION}.zip && sudo -u peertube rm peertube-${VERSION}.zip
```
-Install Peertube
+Install Peertube. If you're using CentOS7, do not forget to activate the devtoolset-6 software collection:
+```
+$ scl enable devtool-6 bash
+```
+And after that, follow the step as usual. Do not forget to exit the environment after installing Peertube.
```
$ cd ../ && sudo -u peertube ln -s versions/peertube-${VERSION} ./peertube-latest
$ cd ./peertube-latest && sudo -H -u peertube yarn install --production --pure-lockfile
$ sudo systemctl reload nginx
```
+**FreeBSD**
+On FreeBSD you can use [Dehydrated](https://dehydrated.io/) `security/dehydrated` for [Let's Encrypt](https://letsencrypt.org/)
+
+```
+$ sudo pkg install dehydrated
+```
+
### systemd
If your OS uses systemd, copy the configuration template:
$ sudo systemctl restart peertube
```
-### Things went wrong?
+### Things went wrong?
Change `peertube-latest` destination to the previous version and restore your SQL backup: