---
agentTools:
  projectIndex: https://docs.project-fifo.net/llms.txt
---

# Manually Adding Buckets

Generally this **optional** section is **not** needed, as the bucket creation process for FiFo is handled **automatically** in the last step of the [Installing FiFo Guide](https://docs.project-fifo.net/docs/installing-fifo#5-leofs-initialization) with the `sniffle-admin init-leofs` command.

For most people there are 4 probable reasons you would want to read this guide.

1. You are **changing** your FiFo LeoFS setup and need to **manually** add FiFo Buckets.
2. You are interested in better understanding how FiFo interacts with LeoFS.
3. You want to swap back-and-forth between the Release and Development versions of FiFo and want to make use of a **common** LeoFS cluster with separate buckets for each.
4. You have **additional** data you want to store in your LeoFS Storage Cluster and require **separate** buckets to store it in.

[block:callout]
{
  "type": "info",
  "title": "Prerequisite assumptions",
  "body": "This guide assumes you already have a **working** LeoFS Storage Cluster up and running as per the [Installing LeoFS](https://docs.project-fifo.net/docs/installing-leofs) Guide and that your DNS is working."
}
[/block]

[block:api-header]
{
  "type": "basic",
  "title": "1. FiFo Buckets - the manual way"
}
[/block]

In this section we will be setting up a fictitious endpoint `s3.onyxit.net`that is using ip address `10.44.0.240` this is our LEoFS Gateway IP. Once we have added the endpoint we will proceed with bucket creation with the LeoFS Zone. FiFo requires 3 buckets:

[block:parameters]
{
  "data": {
    "h-0": "Bucket Name",
    "h-1": "Bucket Purpose",
    "0-0": "fifo",
    "1-0": "fifo-images",
    "2-0": "fifo-backups",
    "1-1": "Dataset Storage",
    "2-1": "Machine Backup Storage",
    "0-1": "General Storage"
  },
  "cols": 2,
  "rows": 3
}
[/block]

\#LeoFS Zone Steps
We start off by generating a random password with `openssl` which we will use to seed key creation. Do **NOT** lose your `access-key-id` and `secret-access-key` as you will need them later to complete your setup.

[block:code]
{
  "codes": [
    {
      "code": "$ leofs-adm add-endpoint s3.onyxit.net\n$ openssl rand -base64 32 | cut -c-16\nqypdpQ47e/E4oKH3\n$ leofs-adm create-user fifo qypdpQ47e/E4oKH3\n\n  access-key-id: ed4528b19bc043770c12\n  secret-access-key: 18b35c2dc5b0819e31d7c2fece24add0ef9ec221\n$",
      "language": "shell"
    }
  ]
}
[/block]

Next we create our 3 buckets using our `access-key-id`.

```
leofs-adm add-bucket fifo ed4528b19bc043770c12
leofs-adm add-bucket fifo-images ed4528b19bc043770c12
leofs-adm add-bucket fifo-backups ed4528b19bc043770c12
```

\#FiFo Zone Steps

We now edit `/data/sniffle/etc/sniffle.conf` and change the following entry to point at the LeoFS endpoint.

```
s3.host = 10.44.0.240:8443
```

Then restart the service with `svcadm restart sniffle`

```
svcadm restart sniffle
```

We are almost done. All that is left, is to tell sniffle to use our S3 LeoFS storage buckets and to grant access by specifying which `access_key` and `secret_key` to connect with the following commands.

```
sniffle-admin config set storage.s3.port 8443
sniffle-admin config set storage.s3.host s3.onyxit.net
sniffle-admin config set storage.s3.access_key ed4528b19bc043770c12
sniffle-admin config set storage.s3.secret_key 18b35c2dc5b0819e31d7c2fece24add0ef9ec221
sniffle-admin config set storage.s3.image_bucket fifo-images
sniffle-admin config set storage.s3.general_bucket fifo
sniffle-admin config set storage.s3.snapshot_bucket fifo-backups
```

Verify you can see all your settings correctly reflected when you run the command:

```
sniffle-admin config show
```