> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hop.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Elixir Cluster

> How to deploy & cluster Elixir on Hop

Using [libcluster](https://github.com/bitwalker/libcluster) with the [libcluster\_hop](https://github.com/hiett/libcluster_hop) strategy, you can easily create a clustered Elixir application on Hop. All nodes (containers) will be connected to each other.

## Demo

<Note>
  You can see a live version of this demo already deployed
  [here](https://libcluster-hop.hop.sh)
</Note>

We have created a demo application that you can deploy to Hop to see how it works. It's a simple Elixir application that uses the `libcluster_hop` strategy and exposes a simple HTTP API which lets you see the nodes connected to each other.

### Deploying the demo

1. Fork [elixir\_cluster](https://github.com/hop-examples/elixir_cluster) on GitHub.
2. Obtain a [project token](/reference/project-tokens) for your Hop project. libcluster uses this to fetch the list of nodes in the cluster using the Hop API. Make sure to select the `Manage Deployments` permission when creating it.
3. Create a new Hop deployment on the Console and select the GitHub repository you just forked.
4. Set the following environment variables before deploying:

<div style={{"paddingLeft": "35px"}}>
  | Name                   | Value                                    |
  | ---------------------- | ---------------------------------------- |
  | `HOP_TOKEN`            | The project token you obtained in step 2 |
  | `RELEASE_DISTRIBUTION` | `none`                                   |
</div>

5. Hit `Deploy` and wait for the build to finish.
6. To expose your application to the web, create a [Gateway](/ignite/gateways) and point it to port `8080`.

That's it! You're now able to scale your Elixir cluster and containers will automatically discover and connect to each other.
