Container Station (CS) & Portainer - CS not finding containers created in Portainer

Hi folks,

TL;DR - Can I copy/backup my Portainer containers and redeploy in Container Station? Or how can I connect my Portainer Station to Container Station?

Following an earlier topic created I have a new QNAP TS-264-8G with 2 x 1TB WD Red SSD [SATA] (RAID1) as I’m looking for a new solution for an automated Plex Media Server (PMS) with PMS installed on QTS and all the apps (e.g. *arrs, SabNZBd) installed as containers

First thing I did was install PMS and update (and linked to my external media drive) - all good. Next was Container Station install along with Portainer from https://www.myqnap.org/ repo. So far so good.

Now I installed the containers using Portainer by pulling the images from lscr.io/linuxserver/[e.g.*arr]:latest and populating the default port (using Map Additional Port) and the suggested Environments (PUID, PGID, TZ) and Volumes and restart policy.

All apps are working fine, talking to each other and sending media to Plex external media drive - all good. HOWEVER… When I look in CS I do not see ANY of the containers and when I ssh and use “docker ps” I see nothing listed.

One point to note is when I created the containers in Portainer I did NOT use the “default” CS folder location - in part as this is a very long path and to be honest by following various YouTube guides this seemed to be suggested. Is this an issue? The containers are working!

To check I used Container Station to check using Bazarr (not something I will use) and this installed and is working fine AND I see this when ssh “docker ps” BUT not in portainer!

So my question is why are these two (CS and Portainer) not communicating? And can I just somehow export my containers in Portainer and deploy in Container Station as I actually prefer this as I can set one app to directly use my LAN port (bypassing my default bridge VPN installed on QTS)?

I know this is a long post but trying to provide as much info as possible. Hope someone can point me in the right direction or advise what I did wrong? I really don’t want to reconfigure all the containers if possible.

Thanks a million in advance!

EDIT One other thing I have just realised is when I installed Portainer it seemed to skip the documented start up pages so all the containers installed in Portainer are in the “Primary” Environment which lists “URL:/var/run/system-docker.sock” but I see on another example there is also a “Local” environment which has “/var/run/docker.sock”. I suspect this is kinda important but never got the option in Portainer to create this “Local” stand-alone environment…

I think your new finding is important. As far as I know many qnap services require container station to run, but they don’t show up in container station UI. Maybe there are 2 different docker environments in QTS. Also I think the portainer package developer may be a better place to seek for help.

1 Like

After a lot of experimentation (unfortunately at one point bricking my QNAP and having to do a 3 second reset to get access back) I can in fact confirm the default (and only) environment “Primary” using “…system-docker.sock” was the problem. I created a new environment and manually built the containers again then using a backup from the original config restored that on the new container. All is now working hunky dory and I can bypass the QNAP VPN Client (to directly access the LAN). Took some blood, sweat and tears but got there (at least so far so good)… I will document the steps I did in more detail in case anyone else has the issue but I have a working (if very manual) solution now. Thanks!

I’d argue if you’re going do the rabbit hole of *arr you want to use Portainer to setup your containers.

Make an application in CS3+, CS controls Portainer, use Portainer to control everything else. Modifying stuff in CS sucks, mapping docker commandline to CS sucks, mapping docker compose to CS sucks slightly less.

Portainer is the correct approach.
(I’m using a proxy since everything I want to play with wants the docker.sock, and I don’t feel like fixing stuff in QNAP if an app/container does something stupid with the socket.)

networks:
  # create the below network before running this template
  external_edge:
    external: true

services:
  portainer:
    networks:
      external_edge:
        ipv4_address: 172.27.1.250
    container_name: portainer-ce
    image: portainer/portainer-ce:latest
    security_opt:
      - no-new-privileges:true
    environment:
      - TZ=America/Toronto
    ports:
      - 9001:8000
      - 9000:9000
      - 9043:9443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:rw
      - /share/Container/portainer-ce/data:/data:rw
    restart: always
  dockerproxy:
    networks:
      external_edge:
        ipv4_address: 172.27.1.251
    container_name: dockerproxy
    image: ghcr.io/tecnativa/docker-socket-proxy:latest
    environment:
#      - PUID=1001
#      - PGID=1000
      - TZ=America/Toronto
      - CONTAINERS=1 # Allow access to viewing containers
      - SERVICES=1 # Allow access to viewing services (necessary when using Docker Swarm)
      - TASKS=1 # Allow access to viewing tasks (necessary when using Docker Swarm)
      - POST=0 # Disallow any POST operations (effectively read-only)
    ports:
      - 127.0.0.1:2375:2375
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro # Mounted as read-only
    restart: unless-stopped

Oh and an example container I run from Portainer after.

networks:
  # create the below network before running this template
  external_edge:
    external: true

services:
  jellyfin:
    networks:
      - external_edge
    container_name: jellyfin
    image: lscr.io/linuxserver/jellyfin:latest
    deploy:
      resources:
        limits:
          cpus: 3
          memory: 2G
    environment:
      - PUID=1001
      - PGID=1000
      - TZ=America/Toronto
      - DOCKER_MODS=linuxserver/mods:jellyfin-opencl-intel
      - JELLYFIN_CONFIG_DIR=/config
      - JELLYFIN_CACHE_DIR=/cache
      - JELLYFIN_PublishedServerUrl=http://TheVault.local #optional
    ports:
      - 8096:8096
      - 8920:8920 #optional
      - 7359:7359/udp #optional
      - 1900:1900/udp #optional
    volumes:
      - /share/docker/appdata/jellyfin/cache:/cache
      - /share/docker/appdata/jellyfin/config:/config # Make sure your local config directory exists
      - /share/Media Library:/mnt/mediaShare:ro
      # Optional - extra fonts to be used during transcoding with subtitle burn-in
      - /usr/share/fonts/:/usr/local/share/fonts/custom:ro
    devices:
      - /dev/dri:/dev/dri
    restart: unless-stopped