# 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:
$ cd /var/www/peertube/peertube-latest && NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run reset-password -- -u root
```
-Now you can subscribe to the mailing list for PeerTube administrators: https://framalistes.org/sympa/subscribe/peertube-admin
+### What now?
+
+Now your instance is up you can:
+
+ * Subscribe to the mailing list for PeerTube administrators: https://framalistes.org/sympa/subscribe/peertube-admin
+ * Add you instance to the public PeerTube instances index if you want to: https://instances.peertu.be/
## Upgrade
#### 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: