Deploy your first GitOps stack

Time Required

30 Minutes



What is a Stack?

Stacks is how Portainer handles Docker Compose files, which are infrastructure as code documents for spinning up multiple containers, volumes and networks in 1 go.

Most docker container developers now provide example compose files with their projects. Its also possible to Google and find examples online

For example, you may have a service that has a separate container for

  • a database

  • a web app

  • back end compute

The database and back end compute may be on Network 1, while the web app is on Network 2.

All 3 containers have access to the same 'config' volume, but the database and webapp have their own unique volumes

The database and backend need the same credentials to the 2 systems can talk, but the web app has separate credentials for the gui. These are environmental variables

Instead of manually setting up and inputting environmental variables, networks and volumes for each container this can all be written into the compose and and span up in 1 click. This also makes the set up system agnostic.

Deploy your Stack

In this practice, we're going to deploy the Ombi compose file we created in Create your first GipOps Compose file

  1. Log into Portainer

    1. If you set up Edge Agents, click on the host you want Ombi to exist on

  2. On the left hand menu, select 'Stacks'

  3. Click on 'Add stack'

    1. Give your stack a name (eg "ombi")

    2. Build method = Repository

    3. Tick 'Authentication'

    4. Repository URL = the URL of your repo + .git (eg ""_)

    5. Compose path = docker-compose/ombi.yml

    6. Tick 'Automatic updates' You should see a page similar to this,\

    7. Scroll down to the 'environment variables' section and add the following variables

      • TZ

      • BASE_URL

      • PORT_HTTP

    8. Provide your TZ per the 'tz identifier' here

    9. Provide a base url, if you are using one (not required)

    10. Provide the port that Ombi will use

    11. Click on 'Deploy the stack'

If you have any issues, refer to the Notifications tab at the top of the page;

Most Portainer errors can be resolved with a simple Google search but I also have my own troubleshooting list here

Last updated