CouchPotato is a powerful, self-hosted application designed for automating the download of movies, allowing users to manage their media libraries effortlessly. Its flexibility, customization options, and ability to integrate seamlessly with other tools make it an excellent choice for tech-savvy users. In this guide, weβll walk through deploying, configuring, managing, and leveraging CouchPotato, covering everything from installation to advanced features.
Installing CouchPotato
π¦ Docker/Docker Compose Setup
Using Docker is the most efficient way to deploy CouchPotato, ensuring a clean installation with minimal dependencies. Below is a docker-compose.yml
configuration tailored for CouchPotato:
version: '3.8'
services:
couchpotato:
image: couchpotato/couchpotato:latest
container_name: couchpotato
ports:
- "5050:5050" # Maps CouchPotato's default port to the host
volumes:
- /path/to/config:/config # Persistent app configuration
- /path/to/movies:/movies # Directory for downloaded movies
- /path/to/downloads:/downloads # Directory for temporary downloads
restart: unless-stopped
To deploy the container:
nano docker-compose.yml
## Start CouchPotato
docker-compose up -d
## Check if the container is running
docker ps
π Manual Installation
For direct installation on a Linux server, follow these steps:
- Install dependencies:
sudo apt update
sudo apt install -y git python python-pip
- Clone the CouchPotato repository:
git clone https://github.com/CouchPotato/CouchPotatoServer.git /opt/couchpotato
- Start CouchPotato:
python /opt/couchpotato/CouchPotato.py --daemon
- Enable autostart on reboot (create a systemd service file):
sudo nano /etc/systemd/system/couchpotato.service
Add the following content:
[Unit]
Description=CouchPotato Service
After=network.target
[Service]
ExecStart=/usr/bin/python /opt/couchpotato/CouchPotato.py
Restart=always
User=root
[Install]
WantedBy=multi-user.target
Then enable and start the service:
sudo systemctl enable couchpotato
sudo systemctl start couchpotato
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
To make CouchPotato accessible via a custom domain or subdomain, configure Nginx as a reverse proxy:
- Create a new Nginx server block:
sudo nano /etc/nginx/sites-available/couchpotato
Add this content:
server {
listen 80;
server_name couchpotato.mydomain.com;
location / {
proxy_pass http://localhost:5050;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
- Enable the configuration and reload Nginx:
sudo ln -s /etc/nginx/sites-available/couchpotato /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
π SSL/TLS Setup
Secure the app with Let's Encrypt:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d couchpotato.mydomain.com
Set up automatic SSL renewal:
sudo crontab -e
## Add the following line:
0 3 * * * certbot renew --quiet
Logging and Debugging CouchPotato
ποΈ Enabling Debug Logs
Activate debug logging by editing the settings.conf
file:
nano /path/to/config/settings.conf
Set the debug
option to true
:
debug = true
Restart the CouchPotato service to apply changes:
docker restart couchpotato
## or
sudo systemctl restart couchpotato
π Viewing Logs
For Docker deployments:
docker logs -f couchpotato
For manual installations:
tail -f /path/to/config/logs/CouchPotato.log
π οΈ Troubleshooting Common Issues
If CouchPotato fails to start:
- Verify port conflicts:
sudo netstat -tuln | grep 5050
- Check for missing dependencies:
python --version
pip list
Backup and Restore
ποΈ File-Based Backups
Backup your configuration and database:
tar -czvf couchpotato-backup.tar.gz /path/to/config /path/to/movies
π Database Backups
If CouchPotato uses a database (e.g., SQLite), manually copy the database file:
cp /path/to/config/database.db /path/to/backup/
π Automated Backup Scripts
Set up a cron job to automate backups:
crontab -e
## Add the following:
0 2 * * * tar -czvf /path/to/backups/couchpotato-$(date +\%F).tar.gz /path/to/config /path/to/movies
Updating and Upgrading CouchPotato
β¬οΈ Updating Docker Images
Pull the latest Docker image and redeploy:
docker-compose pull
docker-compose up -d
π οΈ Manual Updates
Update the repository and restart:
cd /opt/couchpotato
git pull
python CouchPotato.py --daemon
Leveraging CouchPotatoβs Unique Features
π§ Enabling APIs
Activate CouchPotatoβs API in the settings:
-
Open the CouchPotato web interface.
-
Go to Settings > Advanced > API.
-
Enable the API and note the API key.
Test the API with curl
:
curl -X GET "http://localhost:5050/api/<API_KEY>/app.available"
π Advanced Configurations
Integrate CouchPotato with a download client (e.g., Transmission):
-
Go to Settings > Downloaders.
-
Enable Transmission and provide the necessary credentials.
Test the integration:
curl -X GET "http://localhost:5050/api/<API_KEY>/downloaders.test"
Wrapping Up
By following this guide, youβve successfully deployed, configured, and managed CouchPotato on your server. Self-hosting CouchPotato offers unparalleled control and flexibility, allowing you to tailor it to your exact needs. Start leveraging its powerful features today to automate your media library and enjoy seamless movie management!