---
title: Charmhub | Deploy Enterprise Store using Charmhub - The Open Operator Collection
description: Deploy the latest version of Enterprise Store on any cloud.
url: https://charmhub.io/enterprise-store/docs/deploy-proxy
---

# Enterprise Store

[Colin Christophe](https://charmhub.io/publisher/colin-c "View all packages from Colin Christophe")

* [Colin Christophe](https://charmhub.io/publisher/colin-c "View all packages from Colin Christophe")

Platform:

24.04

stable 7

```
juju deploy enterprise-store
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Deploying in proxy mode

This page describes how to deploy the enterprise-store charm in **proxy mode**,
the default mode in which the enterprise-store acts as an edge proxy in front of
the global Snap Store. Devices are pointed at the proxy and all traffic to the
Store flows through it. The unit needs to be able to reach the Snap Store to
install the snap and to proxy requests.

For an airgapped deployment where nothing reaches the internet, see the Offline
mode deploy guide instead.

## [Prerequisites](https://charmhub.io/enterprise-store/docs/deploy-proxy#p-42304-prerequisites)

### [Controller](https://charmhub.io/enterprise-store/docs/deploy-proxy#p-42304-controller)

A Juju controller on a machine cloud (for example LXD) is required:

```
sudo snap install juju
sudo snap install lxd
lxd init --auto
juju bootstrap localhost <controller-name>
```

### [Registration bundle](https://charmhub.io/enterprise-store/docs/deploy-proxy#p-42304-registration-bundle)

The store must be registered with a bundle produced by the
[store-admin snap](https://snapcraft.io/store-admin). The bundle contains the
store `domain`, `store_id` and the signing keys. Register against the domain
your devices will use:

```
store-admin register https://store.example.com
```

This produces a base64 registration bundle. Supply it to the charm through the
`registration_bundle` config option, either during deployment (via the Juju
bundle or Terraform config shown below) or afterwards on the CLI. For ease of use the
registration file is called `registration_bundle.b64`, the following command can be used:

```
juju config enterprise-store \
    registration_bundle="$(cat registration_bundle.b64)"
```

Both methods are supported.

### [PostgreSQL](https://charmhub.io/enterprise-store/docs/deploy-proxy#p-42304-postgresql)

The charm requires a PostgreSQL database over the `postgresql_client`
interface. The enterprise-store needs the `btree_gist` extension. The charm
requests the `superuser` role and attempts to provision the extension itself,
but it is recommended to also enable it explicitly on the PostgreSQL charm so
the extension is available regardless of role handling:

```
juju config postgresql plugin_btree_gist_enable=true
```

## [Deploy with the Juju CLI](https://charmhub.io/enterprise-store/docs/deploy-proxy#p-42304-deploy-with-the-juju-cli)

```
juju deploy postgresql --channel 14/stable
juju config postgresql plugin_btree_gist_enable=true
juju deploy enterprise-store --channel stable
juju integrate postgresql:database enterprise-store:database
juju config enterprise-store registration_bundle=<registration_bundle.b64>
```

## [Deploy with a Juju bundle](https://charmhub.io/enterprise-store/docs/deploy-proxy#p-42304-deploy-with-a-juju-bundle)

```
applications:
  postgresql:
    charm: postgresql
    channel: 14/stable
    num_units: 1
    options:
      plugin_btree_gist_enable: true
  enterprise-store:
    charm: enterprise-store
    channel: stable
    num_units: 1
    options:
      registration_bundle: <registration_bundle.b64>

relations:
- - postgresql:database
  - enterprise-store:database
```

## [Deploy with Terraform](https://charmhub.io/enterprise-store/docs/deploy-proxy#p-42304-deploy-with-terraform)

The example below uses the `juju/juju` Terraform provider. Adjust the charm
`channel` to the one you want to deploy.

```
terraform {
  required_providers {
    juju = {
      source  = "juju/juju"
      version = "~> 2.2.1"
    }
  }
}

provider "juju" {}

resource "juju_model" "proxy-model" {
  name = "proxy-model"
  cloud {
    name   = "localhost"
    region = "localhost"
  }
}

resource "juju_application" "postgresql" {
  name       = "postgresql"
  model_uuid = juju_model.proxy-model.uuid
  charm {
    name    = "postgresql"
    channel = "14/stable"
  }
  config = {
    plugin_btree_gist_enable = true
  }
}

resource "juju_application" "enterprise-store" {
  name       = "enterprise-store"
  model_uuid = juju_model.proxy-model.uuid
  charm {
    name    = "enterprise-store"
    channel = "stable"
  }
  config = {
    registration_bundle = file("${path.module}/registration_bundle.b64")
  }
}

resource "juju_integration" "database" {
  model_uuid = juju_model.proxy-model.uuid
  application {
    name     = juju_application.postgresql.name
    endpoint = "database"
  }
  application {
    name     = juju_application.enterprise-store.name
    endpoint = "database"
  }
}
```

## [High availability and TLS](https://charmhub.io/enterprise-store/docs/deploy-proxy#p-42304-high-availability-and-tls)

For a highly available deployment (multiple units fronted by haproxy) and for
TLS termination options, see the High availability deploy guide.

---
