# Deploy Filehub and Filechain bundle · Chromia Docs (concept)

> A Filechain is inherently dependent on a Filehub, meaning that each Filechain must be deployed in conjunction with a Filehub.

Source: https://docs.chromia.com/ecosystem/filehub/filehub-setup/deploy-bundle/

# Deploy Filehub and Filechain bundle

On this page

* [Prerequisites](#prerequisites)
* [Step 1: Run the deploy bundle](#step-1-run-the-deploy-bundle)

A Filechain is inherently dependent on a Filehub, meaning that each Filechain must be deployed in conjunction with a
Filehub. This project simplifies the process by packaging both Filehub and Filechain as a cohesive unit for deployment.

warning

This deployment is primarily intended for local development and testing purposes, utilizing a "mock" Directory Chain.
For deployments on actual networks, refer to the independent deployment instructions for [Filehub](https://docs.chromia.com/ecosystem/filehub/filehub-setup/deploy-filehub/) and
[Filechain](https://docs.chromia.com/ecosystem/filehub/filehub-setup/deploy-filechain/).

You can set up the [Filehub](https://docs.chromia.com/ecosystem/filehub/filehub-setup/deploy-filehub/) and [Filechain](https://docs.chromia.com/ecosystem/filehub/filehub-setup/deploy-filechain/) either as standalone systems or in a
multi-node setup, enhancing redundancy and ensuring higher availability.

## Prerequisites

Before starting, ensure you have the following tools and resources:

* [Chromia CLI](https://docs.chromia.com/get-started/installation/)
* Git
* Docker

## Step 1: Run the deploy bundle

The deployment script simplifies setting up your local development environment. It accepts three main input parameters:

* `-r` => Enable rate limiter for Filehub (1 = enabled, 0 = disabled)
* `-e` => Specify which endpoint to use for nodes (e.g., `docker` or `localhost`, defaults to `localhost`)
* `-a` => Enable the Gateway API (1 = enabled, 0 = disabled)

##### Example commands:

Terminal

```
./start.sh          # Starts the deploy bundle with default settings
./start.sh -r 0     # Rate limiter disabled
./start.sh -e docker  # Node URLs configured for Docker
./start.sh -a 0     # Gateway API disabled
./start.sh -r 0 -a 0 # Both rate limiter and Gateway API disabled
./start.sh -r 0 -e docker -a 0  # Disabled rate limiter & Gateway API, with Docker endpoint
```

The script executes several steps to configure the development environment:

1. **Environment detection:** Identifies the appropriate environment for deployment (local or production).
2. **Reset and clean up:** Cleans up folders and Docker containers to reset the environment to a fresh state.
3. **Repository cloning:** Clones the necessary repositories required for Filehub and Filechain.
4. **Directory Chain preparation:** Extracts and installs the necessary packages, then builds the Directory Chain.
5. **Database setup:** Starts a PostgreSQL container to handle the database requirements.
6. **Directory Chain launch:** Starts the Directory Chain, which manages directory services.
7. **Filehub deployment:** Installs, builds, and deploys the Filehub, which acts as the control hub.
8. **Filechain deployment:** Installs, builds, and deploys the Filechain, which handles the actual file storage.
9. **Gateway API Setup:** Configures and starts the Gateway API container, allowing easy file access via HTTP.

[View this page on docs.chromia.com](https://docs.chromia.com/ecosystem/filehub/filehub-setup/deploy-bundle/)Content mirrored from the live docs
