Run a second copy of an app
Deployrr installs one copy of each app. If you want a second copy, for example Sonarr for 4K shows next to your normal Sonarr, you add it yourself in custom.yml. This page uses Sonarr as the example. The same steps work for Radarr, Lidarr and most other apps.
There is no menu option in Deployrr that installs a second copy for you.
Before you start
Section titled “Before you start”- The first copy of the app is installed and works. See the Quick start.
custom.ymlis turned on. Follow steps 1 to 5 in Add your own containers with custom.yml first.- Optional: turn on the Bash aliases. This page uses
cdd,dcupanddclogs. - Optional: to put the second copy behind Traefik with the Traefikify menu, you need a Plus or Pro license.
All paths below are inside your Docker folder. The cdd alias takes you there. HOSTNAME is your server’s hostname.
What must be different
Section titled “What must be different”The second copy shares your media and downloads folders with the first. Everything else must be different:
| Setting | First copy | Second copy |
|---|---|---|
| Service name | sonarr |
sonarr-4k |
| Container name | sonarr |
sonarr-4k |
Host port (left side of ports) |
8989 |
8990 |
| Config folder | appdata/sonarr |
appdata/sonarr-4k |
| Traefik file | app-sonarr.yml |
app-sonarr-4k.yml |
| Subdomain | sonarr |
sonarr4k |
Use any names and port you like. The port must be free on your server. The number on the right of ports (8989) stays the same, because it is the port inside the container.
-
Go to your Docker folder.
Terminal window cdd -
Open the Compose file of the first copy and read it.
Terminal window cat compose/$HOSTNAME/sonarr.ymlIt looks like this:
services:# Sonarr - TV Shows Managementsonarr:image: lscr.io/linuxserver/sonarr:developcontainer_name: sonarrsecurity_opt:- no-new-privileges:truerestart: "no"profiles: ["media", "starr", "all"]networks:- defaultports:- "$SONARR_PORT:8989"volumes:- $DOCKERDIR/appdata/sonarr:/config- $DOWNLOADSDIR:/data/downloads- "/etc/localtime:/etc/localtime:ro"environment:TZ: $TZPUID: $PUIDPGID: $PGIDYour file also has a line for each media folder you set in Deployrr, for example
- $MEDIADIR1:/data/media1. Copy those lines too if you want the second copy to see your media. The file ends with a comment line that you can ignore. -
Check that the new port is free. Replace
8990with the port you picked.Terminal window sudo ss -tulpn | grep ':8990 'If this prints a line, the port is taken. Pick another number. To find out what holds a port, see Port already in use.
-
Create the config folder for the new copy.
Terminal window mkdir -p appdata/sonarr-4k -
Open your custom file.
Terminal window nano compose/$HOSTNAME/custom.yml -
Add the copy under
services:. Paste the service from step 2, then change the lines marked below. Ifcustom.ymlalready has services, add this one below them.services:sonarr-4k: # changedimage: lscr.io/linuxserver/sonarr:developcontainer_name: sonarr-4k # changedsecurity_opt:- no-new-privileges:truerestart: "no"profiles: ["media", "starr", "all"]networks:- defaultports:- "8990:8989" # changed: a fixed, free port instead of $SONARR_PORTvolumes:- $DOCKERDIR/appdata/sonarr-4k:/config # changed- $DOWNLOADSDIR:/data/downloads- "/etc/localtime:/etc/localtime:ro"environment:TZ: $TZPUID: $PUIDPGID: $PGIDKeep the
profilesline as it is. Do not change$SONARR_PORTin your.envfile. The first copy still uses it. -
Save the file.
-
Start the new service.
Terminal window dcup sonarr-4kWithout the aliases, run this instead. Replace
YOUR_USERandHOSTNAMEwith your own values.Terminal window sudo docker compose --profile all -f /home/YOUR_USER/docker/docker-compose-HOSTNAME.yml up -d sonarr-4k -
Open
http://YOUR_SERVER_IP:8990in a browser. ReplaceYOUR_SERVER_IPwith your server’s local IP address. You should see the first-run screen of a new Sonarr.
Put the second copy behind Traefik
Section titled “Put the second copy behind Traefik”Skip this part if you only use the app on your local network, or if Setup Mode is Local. Local mode doesn’t use Traefik.
Traefik reaches each app through a small file in appdata/traefik3/rules/HOSTNAME/. If Traefik was running when you installed the first copy, that copy has app-sonarr.yml there. The second copy needs its own file. You can create it with the menu or by copying the first file. To understand how these files work, read UDMS part 18: Portainer behind Traefik with the file provider (manual setup).
Option A: use Traefikify
Section titled “Option A: use Traefikify”This needs a Plus or Pro license, with Socket Proxy and Traefik Production set up and Traefik running.
To see Traefikify used on an app, watch Deployrr 5 walkthrough: Traefikify an app at 1:04:39 (shows Deployrr v5; menus and steps differ in v6).
- In Deployrr, go to Proxy > Traefik > Traefikify.
- Read the Traefikify box and confirm that you want to proceed.
- Answer the prompts:
Enter a name for the App.:sonarr-4kEnter a subdomain for the App.:sonarr4k. This is the default: the name without hyphens.Host IP Address of the App.: the same IP address as inapp-sonarr.yml, or your server’s local IP address.WebUI protocol (http/https) of the App::httpWebUI port number of the App::8990
- At Select an Authentication Method for the App, pick the same method as your first copy. Only methods you have set up are accepted.
- At Pick an Exposure Method, pick how the app is reached. In Simple Traefik mode, the only choice is Both (internal and external).
Traefikify also works for apps on other machines. For an example, see Home Assistant behind Traefik. For every prompt and choice, see Put any app behind Traefik with Traefikify.
Deployrr creates app-sonarr-4k.yml and shows File provider created for sonarr4k. Traefik picks up the new file on its own, so you don’t need to restart it. If the Deployrr Dashboard is running, Deployrr also offers to add the app to it.
Option B: copy the file
Section titled “Option B: copy the file”To see an app file built by hand, watch Traefik guide: put an app behind Traefik with a file provider at 9:41 (manual Docker Compose setup; Deployrr does this for you).
-
Go to the rules folder.
Terminal window cd appdata/traefik3/rules/$HOSTNAME -
Copy the first file.
Terminal window sudo cp app-sonarr.yml app-sonarr-4k.yml -
Open the new file.
Terminal window sudo nano app-sonarr-4k.yml -
Change every name and the address. Your file has more lines than shown here. The lines to change are:
http:routers:sonarr-4k-rtr: # changed from sonarr-rtrrule: "Host(`sonarr4k.{{env "DOMAINNAME_1"}}`)" # changed subdomainservice: sonarr-4k-svc # changed from sonarr-svcservices:sonarr-4k-svc: # changed from sonarr-svcloadBalancer:servers:- url: "http://YOUR_SERVER_IP:8990" # changed portKeep the IP address that is already in the first file. It may be the Docker bridge address,
172.17.0.1, rather than your server’s local IP. Only the port changes. Leave the middlewares, entry points andtlslines as they are. -
Save the file.
Now open https://sonarr4k.YOUR_DOMAIN. Replace YOUR_DOMAIN with your own domain. Your DNS must already send sonarr4k to your server. A wildcard record does this. To change the address in the rule: line in other ways, for example to use your root domain, see Open a dashboard at your root domain.
Check it worked
Section titled “Check it worked”-
List your containers.
Terminal window dpsBoth
sonarrandsonarr-4kshow a status ofUp. -
Read the logs of the new copy. Press
Ctrl+Cto stop following them.Terminal window dclogs sonarr-4k -
Open the new web address. Add a library, a download client and an indexer in the new copy. It does not share settings with the first one. To link it to your other apps, use
sonarr-4k:8989. See Connect your apps to each other.
If Compose prints an error when you start the service, check the indentation in custom.yml. If the web address does not load, read the Traefik logs.

