How to create a new Stack

Stacks are collections of services running in a Docker Swarm environment.

Deploying a new stack

You can deploy a new stack from Portainer using the following options:

  • Web editor: Using our Web Editor, you will capable to define the services for this stack using a docker-compose format.
  • Upload: If you're already have a stack.yml file, you can upload from your computer to deploy that stack.
  • Git Repository: You can use a docker-compose format file hosted in Github.
  • Custom Template: If you already created a template of stacks, you can deploy from this option.

Web Editor

To use our web editor, you need to Select Stacks, name the stack, select Web Editor and you can start to define your services using the editor.


You can also define Environment Variables if needed.


When everything is set up, click Deploy the Stack.

Uploading a stack file

In Portainer, you can create Stacks from compose YML files. To achieve this. Click Stacks, then Add Stack.

Now Name your new stack, select Upload and choose your compose file from your computer, add environment variables if needed and then click Deploy the Stack.


Deploy from Github Repository

If you have your compose file hosted in Github, you can deploy from there. Select Stacks, then Add Stack, select Git Repository.

Name your stack, and then, you need to define information about your Github repository:

  • Repository URL: Here, you need to set the URL of your Github Repository.
  • Repository Reference: Here, you need to define your branch.
  • Compose Path: Here, you need to define the path to your compose file from the root of the repository.

If you need authenticate, define your user and password. NOTE: If you have a 2FA configured in Github, your passcode is your password.

Set environment variables if needed and then click Deploy the Stack.



Contribute to these docs