---
title: InfluxDB stacks
description: Use an InfluxDB stack to manage your InfluxDB templates—add, update, or remove templates over time.
url: https://docs.influxdata.com/influxdb/v2/tools/influxdb-templates/stacks/
estimated_tokens: 1698
product: InfluxDB OSS v2
version: v2
---

# InfluxDB stacks

This page documents an earlier version of InfluxDB OSS. [InfluxDB 3 Core](/influxdb3/core/) is the latest stable version.

#### API token hashing is enabled by default in InfluxDB OSS 2.9.0

Stronger token security: tokens are stored as hashes on disk, so a copy of the database file doesn’t expose usable tokens. Existing tokens are hashed on first startup and the original strings can’t be recovered afterward — **capture any plaintext tokens you still need before you upgrade**.

For more information, see [Token hashing](/influxdb/v2/admin/tokens/#token-hashing).

Use InfluxDB stacks to manage [InfluxDB templates](/influxdb/v2/influxdb-templates). When you apply a template, InfluxDB associates resources in the template with a stack. Use the stack to add, update, or remove InfluxDB templates over time.

-   [Save time with stacks](#save-time-with-stacks)
-   [Initialize a stack](#initialize-a-stack)
-   [Update a stack](#update-a-stack)
-   [View stacks](#view-stacks)
-   [Remove a stack](#remove-a-stack)

### [Save time with stacks](/influxdb/v2/tools/influxdb-templates/stacks/save-time/)

Discover how to use InfluxDB stacks to save time.

### [Initialize a stack](/influxdb/v2/tools/influxdb-templates/stacks/init/)

InfluxDB automatically creates a new stack each time you [apply an InfluxDB template](/influxdb/v2/tools/influxdb-templates/use/) **without providing a stack ID**. To manually create or initialize a new stack, use the [`influx stacks init` command](/influxdb/v2/reference/cli/influx/stacks/init/).

```sh
influx apply \
    -o example-org \
    -f path/to/template.yml
```

```sh
influx stacks init \
    -o example-org \
    -n "Example Stack" \
    -d "InfluxDB stack for monitoring some awesome stuff" \
    -u https://example.com/template-1.yml \
    -u https://example.com/template-2.yml
```

[Read more](/influxdb/v2/tools/influxdb-templates/stacks/init/)

### [Update a stack](/influxdb/v2/tools/influxdb-templates/stacks/update/)

Use the [`influx apply` command](/influxdb/v2/reference/cli/influx/apply/) to update a stack with a modified template. When applying a template to an existing stack, InfluxDB checks to see if the resources in the template match existing resources. InfluxDB updates, adds, and removes resources to resolve differences between the current state of the stack and the newly applied template.

```sh
influx apply \
    -o example-org \
    -u http://example.com/template-1.yml \
    -u http://example.com/template-2.yml \
    --stack-id=12ab34cd56ef
```

[Read more](/influxdb/v2/tools/influxdb-templates/stacks/update/)

### [View stacks](/influxdb/v2/tools/influxdb-templates/stacks/view/)

Use the [`influx stacks` command](/influxdb/v2/reference/cli/influx/stacks/) to view installed InfluxDB stacks and their associated resources.

```sh
influx stacks -o example-org
```

[Read more](/influxdb/v2/tools/influxdb-templates/stacks/view/)

### [Remove a stack](/influxdb/v2/tools/influxdb-templates/stacks/remove/)

Use the [`influx stacks remove` command](/influxdb/v2/reference/cli/influx/stacks/remove/) to remove an InfluxDB stack and all its associated resources.

```sh
influx stacks remove \
    -o example-org \
    --stack-id=12ab34cd56ef
```

[Read more](/influxdb/v2/tools/influxdb-templates/stacks/remove/)

**Key differences between stacks and templates**:

-   A template defines a set of resources in a text file outside of InfluxDB. When you apply a template, a stack is automatically created to manage the applied template.
-   Stacks add, modify or delete resources in an instance.
-   Templates do not recognize resources in an instance. All resources in the template are added, creating duplicate resources if a resource already exists.

#### Related
