After re-installing portainer all my docker containers are not there

    • Offizieller Beitrag

    You had to know this wouldn't go without a hitch. The steps below are from a previous session that I am following to re-create nextcloud. I have the containers up and running. I ran into trouble at step 2 below. When I first did it I got the correct page where you accept security risk and proceed. When I select my IP to proceed it errors out and I notice that chrome tries to default to my duck dns (photovandoe) so I thought maybe this was a cache problem. Tried it again with Microsoft edge and got the same problem. I have skipped ahead and fixed the nextcloud.subdomain file and the config.PHP file

    None of this should be needed if you are using your old config folders. All the information are in those folders and will be picked up once you deploy the containers with the yaml file.

  • None of this should be needed if you are using your old config folders.

    Looking back I can see that now. It did seem like I had to change the nextcloud.subdomain.conf and I was surprised that the config.php file was already correct so I went back and compared the nextcloud.dubdomain.conf with back up file and they appear to be the same. Here is the log from the swag container.

    Any thoughts on this error. I made no configuration changes to the router prior to this.

    • Offizieller Beitrag

    When you first setup nextcloud with KM0201, did you do some changes regarding ports in Portainer GUI instead of the docker-compose yaml file?

    Check the port forwarding in your router and the port mapping in the yaml file. Maybe post some pics and code here to cross-check.

  • No we did not. We also did not set up port forwarding for the the ports in the compose file. Below are the ports for nextcloud in the compose file. I also just tried to add port forwarding for 450 but it made no difference.


    Code
     ports:
          - 450:443

    • Offizieller Beitrag

    External port 443 should be mapped to internal port 450 to be in line with your docker-compose yaml file. Is the port mapping in the code box from the swag/letsencrypt container? Port 80 mapping is missing


    And there should be only one mapping for any port in your router. You have several.

  • You have to edit the ports:


    you're portforwarding 3x port 80 to different ports on the same IP: (some analogy to the Immortals="""THERE CAN BE ONLY ONE""")

    same goes for port 443.


    Remove/delete the last 3 entries. snce that will conflict with the one's above.

    For eg.: SWAG receives a call from external on port 80 (for cert approval) and the router must forward it to port 81 (port where SWAG is listening on IP 192.168.0.23)


    But the router also has forwards from 80 external to internal ports (2 in your setting), It will clash.


    You can only have TCP Ext:80 to Int:81 (for SWAG) and TCP Ext:443 to Int:450 (also SWAG and according to what you have --^^^)

  • Thanks guys I have been changing too many things at once. What happened is I did not get a complete copy of my docker compose file. It was missing the tail end of the swag portion including port mapping. After cleaning up my port mapping I have next cloud working. Can I use this same nginx set up to add a self hosted bitwarden? Part of my problem was I was trying to get this going at the same time with overlapping ports.

    • Offizieller Beitrag

    You are using the swag container as reverse proxy for nextcloud. You can add bitwarden to this setup. Either by adding it to the same stack or as separate stack. If you set up a separate stack you need to join the same network so that swag and bitwarden can talk to each other.


    See the picture here:

    https://docs.linuxserver.io/general/swag#reverse-proxy

  • Post your docker-compose.yml here in full (hide sensible data) and I'm sure we can edit it to use bitwarden with either subdomain or subfolder.


    Nice to see at least some is sorted, ;)

  • Here is the docker-compose file. I would sure appreciate the addded help for bitwarden. I have been going in circles for a while.


  • I've found this: bitwarden website but it's only available for x64 (NOT arm as the RPi) so the only one that runs on arm7vl+ (armhf) that I'm aware of is located here on github and is referenced here on this site.


    If this is what you want, then we can create a compose for it and run it along side SWAG.

  • Acording to this source:

    Code
    docker run \
    -p 8005:80 \
    -v bitwarden:/config \
    --name bitwarden \
    --restart always \
    bitwardenrs/server:latest


    Would become a "docker-compose" to integrate to an existing docker-compose.yml:

    Code
    bitwarden:
     image: bitwardenrs/server:latest # raspberry
      container_name: bitwarden
        volumes:
          - /srv/dev-disk-by-label-DATA/appdata/bitwarden:/config # <<<--- This has to be adjusted!!!
        ports:
          - 8005:80
        restart: unless-stopped


    Or as a stand alone service, would be like this:


    Code
    version: "2.1"
     services:
      bitwarden:
       image: bitwardenrs/server:latest # raspberry
        container_name: bitwarden
         volumes:
          - /srv/dev-disk-by-label-DATA/appdata/bitwarden:/config
         ports:
          - 8005:80
         restart: unless-stopped
  • Code
    bitwarden:
     image: bitwardenrs/server:latest # raspberry
      container_name: bitwarden
        volumes:
          - /srv/dev-disk-by-label-DATA/appdata/bitwarden:/config # <<<--- This has to be adjusted!!!
        ports:
          - 8005:80
        restart: unless-stopped

    Thanks for coming up with these options


    So I could just add this section to my existing Nextcloud/swag docker-compose? How does it connect with the existing ssl certs that are created by existing docker-compose

  • Acording to this source:

    Reviewing this source it appears that it is a setup not using HTTPS. I 've gotten Bitwarden to work multiple times without https but most of the setups recommend using self-signed certs or let's encrypt. I've tried both but couldn't get either to work. Nextcloud is already running with nginx and let's encrypt so I was hoping to be able to build off that setup to run Bitwarden as well.


    You also mentioned before that you can't use the port twice?

    current swag is mapping 81:80

    and the bitwarden you proposed is mapping 8005:80

  • EDIT#2 Idents corrected and everything is running as it should, Good to go, ;)


    EDIT NOTE: For some reason, my docker-compose is spitting errors after I added the bitwarden part. Not parsing (prolly ident errors)

    Working on it so don't do this just yet.


    But I managed to run bitwarden straight via CLI with the docker command (just copy/paste in the terminal, it will start and show on portainer but only access via LAN).



    First things first, I don't run neither root nor sudo since my user as "docker" privileges.

    You have to do as you did the previous round of the stack. (either on root or with sudo and an unprivileged user)


    You need to create a SUBDOMAIN for bitwarden on the duckdns.org (for instance: vandoebitwarden)

    Go to duckdns.org and register what you want/need and use it for the rest of the instructions.


    Edit you docker-compose.yml with:

    - DNSPLUGIN=duckdns
    - URL=duckdns.org
    - DUCKDNSTOKEN=my token
    - SUBDOMAINS=theonesyoualreadyhave,vandoebitwarden # <<-- there's a comma and then name without any spaces

    Now, let's assume that you have your docker-compose.yml in "/home/pi/" folder).

    cd /home/pi/ to go to the folder and then ls and confirm that the "docker-compose.yml" is there.


    VERY-IMPORTANT: DO NOT SKIP THIS

    Make a copy of the "docker-compose.yml" in case something goes wrong. That way you're safe:

    cp docker-compose.yml docker-compose.yml.NO.BITWARDEN

    BACKUP DONE: YES. Ok continue.


    nano docker-compose.yml and add the sample above --^^^^ for existing stack (adding to what you posted above:


    [LAN_ACCESS]

    Now you can go to Portainer--> Containers and "bitwarden" should be there running.

    Open it's logs and see if there's any errors (I never used it so don't really know what it should say).

    At this time, your bitwarden should open on the browser with "http://RaspberryIP:8005".

    [/LAN_ACCESS]


    [WAN_ACCESS]

    And now, you should be able to go to "https://vandoebitwarden.duckdns.org" and profit, ;)

    [/WAN_ACCESS]

  • current swag is mapping 81:80

    and the bitwarden you proposed is mapping 8005:80

    Swag is using port 81 on the host while bitwarden will use 8005, ;)


    Ports on the right are for the containers themselfs.


    Please read carefully my previous post, I'm still trying to clean the docker-compose.yml due to errors on some idents, It's not parsing properly.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!