> For the complete documentation index, see [llms.txt](https://docs.stafihub.io/welcome-to-stafihub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stafihub.io/welcome-to-stafihub/chain/getting-started/install.md).

# Install

## Install `go`

> ***TIP:***\
> Go 1.18+ is required for building and installing the StaFiHub software.

Install go by following the [official docs](https://go.dev/doc/install).

Remember to set your `$GOPATH`, `$GOBIN`, and `$PATH` environment variables, for example:

```
mkdir -p $HOME/go/bin
echo "export GOPATH=$HOME/go" >> ~/.bashrc
source ~/.bashrc
echo "export GOBIN=$GOPATH/bin" >> ~/.bashrc
source ~/.bashrc
echo "export PATH=$PATH:$GOBIN" >> ~/.bashrc
source ~/.bashrc
```

Verify that go has been installed successfully

```
go version
```

## Install `stafihubd`

After setting up `go` correctly, you should be able to compile and run `stafihubd`

Make sure that your server can access to google.com because our project depends on some libraries provided by google. (If you are not able to access google.com, you can also try to add a proxy: export GOPROXY=<https://goproxy.io>)

```
git clone https://github.com/stafihub/stafihub
cd stafihub
git checkout <version>
make install
```

If your environment variables have set up correctly, you should not get any errors by running the above commands. Now check your `stafihubd` version.

```
stafihubd version
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stafihub.io/welcome-to-stafihub/chain/getting-started/install.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
