Optimize Plex Performance with Hardware Encoding on TrueNAS Scale

Updated on Mar 21,2024

Optimize Plex Performance with Hardware Encoding on TrueNAS Scale

Table of Contents

  1. Introduction to Plex
  2. Installing Plex on TrueNAS Server
  3. Method 1: Plug-in Installation of Plex
    • Limitations of Plug-in Installation
    • Setting up Plex Server
    • Configuring Plex Pass Account
    • Network Configuration
    • Storage Setup
    • Confirming Choices and Saving
  4. Method 2: Virtualized Installation of Plex
    • Benefits of Virtualization
    • Setting up Virtual Machine in TrueNAS Scale
    • Installing Ubuntu Server
    • Installing Dependencies and Nvidia Driver
    • Installing Plex Media Server
    • Mounting Network Share for Media Storage
    • Enabling Hardware Encoding for Transcoding
  5. Conclusion

🎥 Introduction to Plex

Plex is a popular video and audio hosting service that allows you to create your own personal cloud streaming service. It catalogues all your Music and movies, making them accessible from any device. Many home server enthusiasts choose to run Plex on their servers for easy access to their media library. In this article, we will explore different methods to install and run Plex on a TrueNAS server. Whether you prefer a plug-in installation or virtualization, we'll cover everything you need to know to get Plex up and running on your home server.

💻 Installing Plex on TrueNAS Server

Before we delve into the installation methods, let's take a closer look at two approaches: the plug-in installation and virtualized installation. Each method has its advantages and disadvantages, so you can choose the one that best suits your needs.

Method 1: Plug-in Installation of Plex

The plug-in installation of Plex offers a quick and straightforward setup process. However, it has a limitation when it comes to hardware acceleration for encoding streams using Nvidia GPUs. If your setup relies on hardware acceleration, particularly with an Nvidia GPU, you'll need to explore the virtualization method. Nevertheless, if you have an Intel CPU with Quick Sync encoding support, the plug-in installation is highly recommended.

Setting up Plex Server

To set up Plex using the plug-in method, you need to create a dataset for Plex to use. Head to the storage tab in TrueNAS and add a dataset to your storage pool. Then, go to the apps menu, click on available applications, and locate the Plex app. Install the app, and a configuration wizard will guide you through the process.

Configuring Plex Pass Account

To enable hardware acceleration, you'll need a Plex Pass subscription. Visit plex.tv, log into your Plex account, and obtain a claim token. Enter the claim token in the configuration wizard, which will automatically link your new server instance to your account.

Network Configuration

Configure the internal network port for the Plex web interface, leaving it at the default port 32400. If you want to access Plex from outside your local network, set up port forwarding on your firewall following the specific instructions provided by your firewall documentation.

Storage Setup

For storage, link a dataset on your TrueNAS server directly to Plex without the need for network sharing. Specify the local path where you want to mount the share and the location of the dataset in TrueNAS.

Confirming Choices and Saving

Review your choices and click on save to confirm the setup. Once the installation is complete, your new Plex server will be ready for use. Add library folders and copy your media to the server to start streaming your music and movies.

Method 2: Virtualized Installation of Plex

If you prefer a more robust and feature-rich setup, virtualization is the way to go. With virtualization, you have more options for deployment, configuration, and future expansion. Furthermore, it allows for better isolation and reduces potential issues during upgrades or updates.

Benefits of Virtualization

While the plug-in installation is quick and easy, virtualization offers greater flexibility and control. By running Plex in a virtual machine (VM), you can dedicate specific resources and leverage features like host passthrough and hardware encoding with Nvidia GPUs. Virtualization also provides better security and allows for the simultaneous operation of multiple services on the same server.

Setting up Virtual Machine in TrueNAS Scale

To set up a virtual machine for Plex in TrueNAS Scale, you'll need to allocate resources such as CPU cores, memory, and disk space. Ensure that your host supports hardware features like Intel Quick Sync for hardware encoding. The VM should have direct access to the Nvidia GPU, enabling efficient transcoding.

Installing Ubuntu Server

Choose a Debian-based Linux distribution like Ubuntu Server for the VM. Install the OS and update it to ensure it is up to date with the latest patches and security fixes.

Installing Dependencies and Nvidia Driver

Install the necessary dependencies and the Nvidia driver to enable hardware acceleration. Disable any generic drivers included in the Linux kernel, and make the Nvidia driver Package executable.

Installing Plex Media Server

Add the Plex repository to your package management system and install Plex Media Server. This allows you to keep Plex up to date alongside other packages on your server.

Mounting Network Share for Media Storage

If you plan to host media files within the VM, mount a network share to access the media stored on your TrueNAS server. Configure the mount point in the VM's file system, and ensure it is set to mount at boot.

Enabling Hardware Encoding for Transcoding

If your setup includes an Intel CPU with Quick Sync encoding support or you have an Nvidia GPU passed through to the VM, you can enable hardware encoding in Plex. This significantly reduces the strain on your system when transcoding media for remote playback or devices that don't support direct streaming.

📝 Conclusion

In this article, we explored two methods of installing Plex on a TrueNAS server: the plug-in installation and virtualized installation. The plug-in method offers simplicity and ease of use, while the virtualization method provides greater control and flexibility, especially for hardware acceleration. Choose the method that suits your preferences and hardware capabilities. With Plex up and running on your TrueNAS server, you can now enjoy seamless streaming of your media library on any device within your home network or even remotely.

Highlights

  • Plex is a versatile video and audio hosting service that acts as your personal cloud streaming service.
  • TrueNAS offers two methods of running Plex: plug-in installation and virtualization.
  • The plug-in installation is quick and easy but has limitations with Nvidia GPU hardware acceleration.
  • Virtualization provides more options, resource allocation, and hardware acceleration capabilities.
  • Ensure you have a Plex Pass subscription for hardware acceleration and follow the respective setup instructions.
  • Both methods allow you to organize and stream your media library on various devices effortlessly.

FAQ

Q: Can I use Plex without a Plex Pass subscription? A: Yes, you can use Plex without a Plex Pass subscription, but you won't have access to hardware acceleration features for transcoding.

Q: Is it possible to run Plex on a Raspberry Pi? A: Yes, Plex can run on a Raspberry Pi, but due to its limited resources, it may not perform well with larger media libraries or transcoding.

Q: Can I install Plex on a Windows desktop? A: Yes, you can install Plex on a Windows desktop and enjoy the same features and functionality.

Q: What is the benefit of running Plex on a TrueNAS server? A: Running Plex on a TrueNAS server allows for centralized storage of your media library and ensures seamless access from any device within your home network.

Q: Can I access my Plex library outside my local network? A: Yes, by setting up port forwarding on your firewall, you can access your Plex library remotely from anywhere with an internet connection.

Q: Can I use Plex to stream music as well as movies? A: Yes, Plex supports streaming of both music and movies. It acts as a comprehensive media server for all your entertainment needs.

Q: Can I add multiple library folders to Plex? A: Yes, you can add multiple library folders to Plex, allowing you to organize your media into different categories or locations.

Q: Can I add subtitles to my videos in Plex? A: Yes, Plex supports the addition of subtitles to your videos. You can download subtitle files and associate them with your video files in Plex for a better viewing experience.

Q: Can I share my Plex library with family and friends? A: Yes, Plex offers the ability to share your library with other users through the use of Plex Home or by creating managed user accounts. This allows your family and friends to access your shared media.

Q: Can I use Plex on my smart TV or streaming device? A: Yes, Plex has support for a wide range of smart TVs and streaming devices. You can download the Plex app on your device and log in to access your media library.

Most people like