plex enables https

Import certificates through Plex settings to enable HTTPS access without using nginx for reverse proxy.

1. Prepare the certificate#

I obtained my certificate using the acme method, which I have detailed in a previous article. You can refer to it at

2. Convert the certificate#

Plex requires a .pfx file for adding certificates, but acme generates .key and .cer files. Therefore, we need to convert them using the openssl command.

# First, navigate to the directory where the acme-generated certificates are located:
cd ~/.acme/
# is your domain name. -out specifies the output pfx file name, -inkey is for importing the key, and -in is for importing the cer certificate.
openssl pkcs12 -export -out -inkey -in
# Then enter the passphrase, which is the password. Make sure to enter it.

3. Copy the certificate to the folder where Plex can find it#

Since my Plex server is set up using Docker, the directory is mapped. You can refer to the detailed setup method at

Copy the pfx file to the mapped /video directory in the container. In my case, it is /usr/plex/video.

# Make sure to perform the copy operation in the corresponding domain folder in .acme.
cp /usr/plex/video/

After copying, go to any library, click Edit, and Add Folder. You can select the path and see that the certificate appears under /video.

4. Plex settings#

Go to Settings, then Network, and under Advanced Options:

Custom certificate location: /video/
Custom certificate encryption key: Enter the password set during the certificate conversion
Custom certificate domain: Your domain name,
Custom server access URL:,
# You can modify the port according to your situation

5. Script update#

The certificate needs to be renewed every 3 months. We need to write a script to convert and copy the renewed certificate to the Plex mapped folder at regular intervals. Remember to change the absolute path.

Combine the conversion and copy commands from earlier, set up a cron job, and schedule it based on the certificate application time. In my case, I execute it on the 1st of every month. If you're not familiar with cron jobs, you can use an online website to calculate the schedule.

openssl pkcs12 -export -out /root/.acme/ -inkey /root/.acme/ -in /root/.acme/
cp /root/.acme/ /usr/plex/video/
# Add execution permission
chmod +x

crontab -e
0 1 1 */1 * /root/cronsh/
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.