Skip to main content

Plex Media Server on Ubuntu Under Proxmox VE

Notes on installing Plex Media Server in an Ubuntu VM running under Proxmox VE.

See my notes here regarding how Proxmox VE (PVE) was installed on a Dell R610 to be used as an application server. These notes assume knowledge of the basic PVE configuration.

Basic Ubuntu Server Install in a PVE VM

I installed Ubuntu Server 16 LTE. The VM was configured in the following way:

Memory                  16/32GB min/max
Processors              1 socket, 8 cores
Hard Disk(scsi0)        local-lvm, size=32GB
Network Device(net0)    virtio, bridge=vmbr0

Network Configuration

The network device that PVE provides to the Ubuntu VM is named ens18. I removed the ens18 configuration that was created during the install and replaced it with the following (in /etc/network/interfaces):

auto ens18
iface ens18 inet static

This is a good reference, as is this.

Once this change is made, the following should make it take effect:

$ sudo ifdown ens18 && sudo ifup ens18

After the up/down i had intermittent problems with the IP disappearing and changing back to DHCP. Research said that there could be problems with starting/stopping interfaces and suggested reboot. After reboot, no problems.

Additional Tools

I also installed a few essential tools:

$ sudo apt-get install emacs-nox
$ sudo apt isntall smbclient

Access Media Shares in Ubuntu

Since this is primarily being done to get a Plex Media Server up and running, access to media is, of course, a key part of the system. Since I will run Plex under Ubuntu, I configure Ubuntu to automatically mount the desired media at boot time.

Confirm Availability

I have a FreeNAS 11 server configured to provide media shares over SMB. The IP of the SMB server is

Confirm that the media is available over SMB by:

$ smbclient -L //
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.6.8-GIT-7a91926]

    Sharename       Type      Comment
    ---------       ----      -------
    media           Disk      Plex Media
    pub             Disk      Public files
    IPC$            IPC       IPC Service (FreeNAS 11 Server)
    khe             Disk      MacOS home directories
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.6.8-GIT-7a91926]

    Server               Comment
    ---------            -------
    FILESSMB             FreeNAS 11 Server

There is no point in proceding until the media share appears in the output.

Configure Ubuntu to Mount the Media

Create a Mount Point

Create a mount point for the media:

$ sudo mkdir /media/media

Mount the Media

I created a user 'guest' passwd 'guest' on FreeNAS. The FreeNAS share media allows guest user (any guest, not just the above).

This will mount the share manually:

$ sudo mount -t cifs // /media/media \
             -o username=guest,password=guest

References on how to configure automounting at boot can be found here, here, and here.

The correct way to do the automount is to put the unsername and password in /etc/samba/user with permissions 0400. In my situation, it should look like this:


However, I had problems making this work properly. I finally punted and put the following in /etc/fstab:

// /media/media cifs username=guest,password=guest,iocharset=utf8 0 0

Of course, as /etc/fstab is generally readable, this is presents a security problem. But as my network is tightly controlled with few users, I can live with it.

The following command will re-read /etc/fstab and mount anything that isn't already mounted:

$ sudo mount -a

Once this is done, the share is available for use at /media/media.

I currently don't have a local DNS server running. When I do, I'll return to my configuration and update it to use hostnames instead of IP addresses.

Install Plex Under Ubuntu

This article describes how to configure Ubuntu to use the Plex repo.

To install Plex, I did the following:

$ echo deb ./public main \
  | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
$ curl | sudo apt-key add -
$ sudo apt-get update
$ sudo aptitude update
$ sudo aptitude install plexmediaserver

Once this has been done, simply browse to to administer the Plex Server. That's a pretty painless process.

Install Docker Under Ubuntu

Notes on installing Docker; completely unrelated to Plex.

$ curl -fsSL | sudo apt-key add -
$ sudo add-apt-repository \
       "deb [arch=amd64] \
       $(lsb_release -cs) \
$ sudo apt-get update
$ sudo apt-get install docker-ce
$ sudo usermod -aG khe              # lets khe run docker without sudo

A reboot may be required for khe to be able to run without sudo, especially if running under a VM.

To test:

$ sudo docker run hello-world

Confifure docker to start at boot:

$ sudo systemctl enable docker

Backup the Ubuntu VM in PVE

Once all was configured, I backed up the VM in PVE.