# 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 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:
#### Auto (minor versions only)
+The password it asks is PeerTube's database user password.
+
```
$ cd /var/www/peertube/peertube-latest/scripts && sudo -u peertube ./upgrade.sh
$ sudo systemctl restart peertube && sudo journalctl -fu peertube
$ sudo systemctl restart peertube
```
-### Things went wrong?
+### Things went wrong?
Change `peertube-latest` destination to the previous version and restore your SQL backup: