Skip to content

Instantly share code, notes, and snippets.

@mhou1981
Forked from churro-s/LetsEncrypt_HTTPS_plex.MD
Last active January 1, 2018 06:57
Show Gist options
  • Save mhou1981/09c6fa1696a3671e7d8ab2a908b949d6 to your computer and use it in GitHub Desktop.
Save mhou1981/09c6fa1696a3671e7d8ab2a908b949d6 to your computer and use it in GitHub Desktop.
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu

Prep

Your ceritifcate files should now be in this directory: /etc/letsencrypt/live/myhostname.no-ip.org/

I also assume your Plex server is port-forwarded to be accessible via port 32400: http://myhostname.no-ip.org:32400

Set up the certificate

Before we begin, we need to generate a PKCS #12 (.pfx) file from the Let's Encrypt certificate files. It's all the Let's Encrypt files archived, and bundled into one file.

Create the PCKS #12 file:

  1. Run the package command:

      sudo openssl pkcs12 -export -out /var/lib/plexmediaserver/certificate.pfx \
        -inkey /etc/letsencrypt/live/myhostname.no-ip.org/privkey.pem \
        -in /etc/letsencrypt/live/myhostname.no-ip.org/cert.pem \
        -certfile /etc/letsencrypt/live/myhostname.no-ip.org/chain.pem \
        -passout pass:
  2. Hand it over to plex.

    sudo chown plex:plex /var/lib/plexmediaserver/certificate.pfx

Have Plex use your PFX file

  1. Visit the Plex UI on your server: http://myhostname.no-ip.org:32400

  2. Go to Settings (icon on top right corner) > Server (tab) > Network (left navigation column).

    Click "SHOW ADVANCED" to see the necessary fields.

  3. Enter the following values:

    • Custom certificate location: /var/lib/plexmediaserver/certificate.pfx
    • Custom certificate encryption key: The password you entered on step 2 of last section
    • Custom certificate domain: https://myhostname.no-ip.org:32400
  4. Save your changes.

That's it. You don't even have to restart plex!

You can check the Plex\ Media\ Server.log file in /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Logs if you want to verify whether there were any errors.

Visit your server at https://myhostname.no-ip.org:32400 (Custom certificate domain) and see the HTTPS in action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment