---
title: Let’s Encrypt and certbot for HTTPS
url: https://doc.pstreamer.tv/en/manual/https.html
lang: en
product: Perfect Streamer
version: 1.13.3.445
---

# Let’s Encrypt and certbot for HTTPS

Starting from version 1.9.2.340, Perfect Streamer supports automatic renewal of Let’s Encrypt certificates for HTTPS in Web Server, HTTP Server, EPG Server.

# RHEL certbot configuration.

Restriction:

- A white IP address with a public domain name must be assigned and the tcp/80 port must be free.
- A single host name is used for all https servers. (web server, http server, epg server).

Installing certbot ([https://certbot.eff.org/instructions?ws=other&os=snap](https://certbot.eff.org/instructions?ws=other&os=snap)):

```sh
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install certbot --classic
```

certbot configuration:

```sh
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot certonly --standalone
```

certbot check:

```sh
sudo certbot renew --dry-run
```

certbot timer check:

```sh
systemctl list-timers | grep certbot
```

In the Perfect Streamer admin panel, enable HTTPS on servers (Web Server, HTTP Server, EPG Server).

Create a hook script ([https://pstreamer.tv/distrib/scripts/cert_update.zip](https://pstreamer.tv/distrib/scripts/cert_update.zip)). Place it in the following path:

```sh
/opt/pss/scripts/cert_update.sh
```

Specify the host domain name in the script, by default it is taken from /etc/hostname.

Make the file executable.

```sh
chmod +x /opt/pss/scripts/cert_update.sh
```

Check the script run, there should be no errors:

```sh
/opt/pss/scripts/cert_update.sh
```

HTTPS settings should be applied, the status change will be displayed in the logs.

Add hook file to certbot:

```sh
certbot renew --deploy-hook "/opt/pss/scripts/cert_update.sh"
```

Check certbot again:

```sh
sudo certbot renew --dry-run
```

# certbot configuration for Debian/Ubuntu.

Configuration for Debian is similar to RHEL, a brief installation description is given for Ubuntu 24.04.2 LTS.

Certbot installation:

```sh
apt install certbot
certbot certonly
```

Make the script executable:

```sh
chmod +x /opt/pss/scripts/cert_update.sh
```

Run the script:

```sh
/opt/pss/scripts/cert_update.sh
```

Outputs:

```sh
Select domain name (your domain name)
```

Check if the certificates have been updated:

```sh
ls -lat /opt/pss/config/cert/
total 44
-rw------- 1 root root  241 May 26 07:52 epgserver.key
-rw------- 1 root root  241 May 26 07:52 httpserver.key
-rw------- 1 root root  241 May 26 07:52 webserver.key
-rw-r--r-- 1 root root 1338 May 26 07:52 epgserver.crt
-rw-r--r-- 1 root root 1338 May 26 07:52 httpserver.crt
-rw-r--r-- 1 root root 1338 May 26 07:52 webserver.crt
```

The date should be current.
