Portainer stacks show as Limited

Hi all, first post…
In Proxmox I have a Ubuntu Server VM where I installed Docker and Docker Compose.
After reading some guides, I thought that it would be a good practice to create separate folders for each container, so in my Home folder I have subfolders for Container1, Container2, etc. Inside each subfolder there is the respective docker-compose.yaml file along with container’s config folders. For example for the Homepage container I have the .yaml file and the config folder which I have set as “./config:/app/config” under “volumes:” in docker-compose.yaml.

Now I installed Portainer the same way: docker-compose.yml and portainer-data subfolder are inside Portainer’s folder.

All containers work OK but in Portainer > Stacks they show as Limited, probably because I used my own docker-compose.yaml for each container. Is there a way to point Portainer to use these files, so that I can see them in GUI and update them when needed?

A few days ago there was an update for Homepage container and I couldn’t install it, I had to do it through CLI by entering docker-compose pull and docker-compose up --force-recreate --build -d

I’ m new to Docker, Linux etc and I must be missing something very basic. Thanks in advance for your help…

Hello and welcome to the BigBear Community! Glad to have you here!

It sounds like you’ve set up your Docker containers directly using Docker Compose outside of Portainer. That’s why they appear as “Limited” in the Portainer interface. But don’t worry, you don’t need to remove your containers to manage them in Portainer. Instead, you can import your existing Docker Compose stacks into Portainer.

To do this, you can follow these steps:

  1. Go to the ‘Stacks’ page in Portainer.
  2. Click on ‘Add Stack’.
  3. Give your stack a name, then choose the ‘Web editor’ tab, and copy the contents of your docker-compose.yaml file into the editor.
  4. Make sure to set the correct paths for volumes or any relative paths used in your Docker Compose file to match those on your system and change the service name.
  5. Deploy the stack.

After these steps, you should be able to manage your Docker Compose projects directly from the Portainer GUI. This way, updates and configurations can be handled more straightforwardly through Portainer’s interface.

If you encounter any more issues or have other questions, feel free to ask. Enjoy exploring Docker and Portainer!

Thank you, it’s been a couple of months since I started working with Proxmox, Docker, etc and your YT guides have been a HUGE help!

Following your advise, Portainer doesn’t let me add stack with a docker-compose.yaml that I have already created for an existing container.
I’m getting the message “This container name is already used by another container running in this environment: homepage”.

So I guess I need to remove the container first and then re-add it through Portainer’s webUI using the contents of the docker-compose.yaml file in a stack?

You’re welcome!

Yes, since you didn’t change the service name when you were importing the new one, Docker will not let the same names exist, so you have two options.

1. Rename the Container in Docker Compose

If you’re importing your Docker Compose file into Portainer and it conflicts with a container that was previously set up directly through Docker, you can rename the container in your Docker Compose file before importing. Here’s an example of how to do it:

Suppose your original docker-compose.yml has a section like this:

services:
  homepage:
    image: yourimage
    volumes:
      - ./config:/app/config

You can rename the service to avoid conflicts:

services:
  homepage_new:
    image: yourimage
    volumes:
      - ./config:/app/config

After renaming, import the updated Docker Compose file into Portainer.

2. Remove the Existing Container

If you prefer to keep the same container name as specified in your Docker Compose file, you may opt to remove the existing container that’s causing the conflict. You can do this using the Docker CLI.

Using Docker CLI:

First, stop the container:

docker stop homepage

Then, remove it:

docker rm homepage

After removing the existing container, you can try importing your Docker Compose stack again in Portainer.

If you have volumes just don’t delete those.

1 Like