Install CouchPotato on Ubuntu 18.04

CouchPotato lets you download movies automatically, easily and in the best quality as soon as they are available.

Awesome PVR for USEnet and torrents. Just fill in what you want to see and CouchPotato will add it to your “want to watch”-list. Every day it will search through multiple NZBs & Torrents sites, looking for the best possible match. If available, it will download it using your favorite download software.

Most of the following instructions come from: https://www.smarthomebeginner.com/install-couchpotato-on-ubuntu/ .
However, I have added some changes to make the couchpotato service start.

First, let’s install all the prerequisites.

Type the command below to install git and python

sudo apt-get install git-core python

After that, move to your home directory (or any other directory) and clone a copy of CouchPotato from the git repository:

cd ~ 
git clone git://github.com/RuudBurger/CouchPotatoServer.git .couchpotato

This will download the contents to the folder .couchpotato. The “.” in the front keeps the .couchpotato folder hidden. That is all there is to setup CouchPotato on Ubuntu.

After you install CouchPotato on Ubuntu Server, use the following command to run it:

python ~/.couchpotato/CouchPotato.py 

CouchPotatoServer should now be running on your system. CouchPotato default port is 5050. So you can access the CouchPotato web interface by going to:

http://localhost:5050

Make all the configuration settings you want and then shut down CouchPotato.

Configuring CouchPoato to start automatically

For instance, if you installed CouchPotato following this guide exactly then it should be installed in /home/user/.couchpotato/, where user is your username

cd ~/.couchpotato/init 

For Ubuntu, there are 2 files of importance here: ubuntu (needs no editing) and ubuntu.default (needs editing). First copy the file ubuntu to /etc/init.d/couchpotato (note the new file name is couchpotato) and give the file execute permissions (use the following commands one by one):

sudo cp ~/.couchpotato/init/ubuntu /etc/init.d/couchpotato 
sudo chmod +x /etc/init.d/couchpotato

Next, edit the ubuntu.default in the init file using this command:

sudo nano ~/.couchpotato/init/ubuntu.default 

CP_HOME and CP_DATA are important because they are the folder in which CouchPotato is installed and database is stored, respectively. Typically, they refer to the same folder. 

# COPY THIS FILE TO /etc/default/couchpotato # OPTIONS: CP_HOME, CP_USER, CP_DATA, CP_PIDFILE, PYTHON_BIN, CP_OPTS, SSD_OPTS 

CP_HOME=/home/user/.couchpotato/ 
CP_DATA=/home/user/.couchpotato/ 
CP_USER=user 
CP_PIDFILE=/home/user/.couchpotato/couchpotato.pid 


 Save and exit. (Ctrl+X, y, enter) 

After that, we need to copy the file to /etc/default/ folder and give it execute permissions (use the following commands one by one):

sudo cp ~/.couchpotato/init/ubuntu.default /etc/default/couchpotato 
sudo chmod +x /etc/default/couchpotato

In addition, we need to create the /etc/systemd/system/couchpotato.service file.

sudo nano /etc/systemd/system.couchpotato.service

Just paste in the line below ( where user is your username ) :

ExecStart=/home/user/.couchpotato/CouchPotato.py

 
 Save and exit. (Ctrl+X, y, enter)  

After that, we need to update boot sequence:

sudo update-rc.d couchpotato defaults 

In conclusion, you can manually start and stop CouchPotato using the following commands:

sudo /etc/init.d/couchpotato start 
sudo /etc/init.d/couchpotato stop

2 comments

  1. “In addition, we need to modify the/etc/systemd/system/couchpotato.service”

    I must be missing something. Where did this file come from. I’m follow step-by-step, but when i get to this step there is no file located in /etc/systemd/ like that.

    1. Actually, when you run the command you will need to create the file. And just paste in the ExecStart= like in the box below, make sure you replace your user with your username. I will update the blog.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.