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

# Install Go Livepeer

> Learn how to install go-livepeer and become an orchestrator

Depending on your workflow, you may prefer to install `go-livepeer` using a
binary release, a Docker image, or from source.

## Install using a Binary Release

### Dependencies

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
# For ubuntu
apt install curl coreutils gnupg2

# For macOS
brew install curl coreutils gnupg
```

### Darwin (macOS)

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
# <RELEASE_VERSION> is the release version, e.g. v0.5.35
# <ARCH> is the chip architecture (use arm64 for M1 and amd64 for Intel)

wget https://github.com/livepeer/go-livepeer/releases/download/<RELEASE_VERSION>/livepeer-darwin-<ARCH>.tar.gz

# Next, extract it
tar -zxvf livepeer-darwin-<ARCH>.tar.gz

# Finally, move it to the appropriate directory
mv livepeer-darwin-<ARCH>/* /usr/local/bin/
```

### Linux

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
# <RELEASE_VERSION> is the release version, e.g. v0.5.35
# <ARCH> is the chip architecture (use arm64 or amd64)

# Fetch the latest release
wget https://github.com/livepeer/go-livepeer/releases/download/<RELEASE_VERSION>/livepeer-linux-<ARCH>.tar.gz

# Next, extract it
tar -zxvf livepeer-linux-amd64.tar.gz

# Finally, move it to the appropriate directory
mv livepeer-linux-amd64/* /usr/local/bin/
```

### Linux GPU

There is a separate binary which supports transcoding on the NVIDIA GPU. The
requirement for this binary is to have version 12 of the
[CUDA Toolkit](https://developer.nvidia.com/cuda-downloads) installed on your
machine.

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
# <RELEASE_VERSION> is the release version, e.g. v0.5.35
# <ARCH> is the chip architecture (use arm64 or amd64)

# Fetch the latest release
wget https://github.com/livepeer/go-livepeer/releases/download/<RELEASE_VERSION>/livepeer-linux-gpu-<ARCH>.tar.gz

# Next, extract it
tar -zxvf livepeer-linux-gpu-<ARCH>.tar.gz

# Finally, move it to the appropriate directory
mv livepeer-linux-gpu-<ARCH>/* /usr/local/bin/
```

### Windows

```shell theme={"theme":{"light":"github-light","dark":"dark-plus"}}
# <RELEASE_VERSION> is the release version, e.g. v0.5.35

# Fetch the latest release .zip
wget https://github.com/livepeer/go-livepeer/releases/download/<RELEASE_VERSION>/livepeer-windows-amd64.zip

# Next, extract it
unzip livepeer-windows-amd64.zip

# Finally, move it to the appropriate directory, e.g. C:\Users\UserName\livepeer-folder
move livepeer-windows-amd64 e.g. C:\Users\UserName\livepeer-folder
```

<Info>
  At this time Livepeer does not provide automatic updates. You can perform a
  manual update or use a script. A community-created [Bash script to update
  Livepeer is available on the livepeer
  Forum](https://forum.livepeer.org/t/bash-script-to-update-livepeer/1513).
</Info>

### Third-party packages

Packages for different Linux distributions are maintained by Livepeer community
members. Before using these packages, please verify that they have been updated
to use the
[latest builds of go-livepeer](https://github.com/livepeer/go-livepeer/releases).
This list will be updated as a best-effort, but we cannot guarantee if
individual packages are up to date or verify their integrity.

In the future, Livepeer core contributors may publish official packages for the
distributions below.

| Platform   | Installation           | Source                                                                                                     |
| ---------- | ---------------------- | ---------------------------------------------------------------------------------------------------------- |
| Arch Linux | `paru go-livepeer-bin` | [https://aur.archlinux.org/packages/go-livepeer-bin/](https://aur.archlinux.org/packages/go-livepeer-bin/) |

## Install using a Docker image

### Prerequisites

If you do not have Docker installed, you will need to install it using the guide
[here](https://docs.docker.com/get-docker/) before running the commands below.

### Installation

With every release, Docker images are pushed to
[DockerHub](https://hub.docker.com/r/livepeer/go-livepeer).

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
# <RELEASE_VERSION> is the release version i.e. 0.5.14
docker pull livepeer/go-livepeer:<RELEASE_VERSION>
```

### Running livepeer-cli with Docker

Once you've pulled the image, retrieve the image id and start the container.

**Any flags you provide will be passed to the binary**, so you can pass
[your configuration flags](/references/go-livepeer/cli-reference) here.

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
docker run <image id> <livepeer configuration flags>

# GPU support (Transcoder-only)
docker run --gpus all <image id> <livepeer configuration flags>
```

Once you've started the container, retrieve the name and start the CLI

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
docker exec -it <container_name> livepeer_cli
```

### Installing pre-releases with Docker

To pull the latest pre-release version:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
docker pull livepeer/go-livepeer:master
```

## Build from source

### System dependencies

Building `livepeer` requires some system dependencies.

#### Linux (Ubuntu: 16.04 or 18.04)

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
apt-get update && apt-get -y install build-essential pkg-config autoconf git curl yasm
```

#### Linux (Ubuntu: 20.04 or newer)

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
apt-get -y install protobuf-compiler-grpc golang-goprotobuf-dev yasm pkg-config
```

#### Linux GPU support

To enable transcoding using Nvidia GPUs on Linux systems

* [CUDA Toolkit](https://developer.nvidia.com/cuda-toolkit) must be installed on
  the system and available on the `LIBRARY_PATH`
* `clang` must be installed as well. The script that will install `ffmpeg`
  dependencies uses `which clang` command to determine whether `clang` is
  installed or not. Please check this on your system. If the path is empty,
  please install `clang`. For example on the Ubuntu machine one can do

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
apt-get -y install clang clang-tools
export LIBRARY_PATH="/usr/local/cuda/lib64:${LIBRARY_PATH}"
```

#### Darwin (macOS)

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
brew update && brew install pkg-config autoconf
```

### Go

Building `livepeer` requires Go. Follow the
[official Go installation instructions](https://golang.org/doc/install).

### Build and install

1. Clone the repository:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
git clone https://github.com/livepeer/go-livepeer.git
cd go-livepeer
```

2. Install `ffmpeg` dependencies:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
./install_ffmpeg.sh
```

3. Set build environment variables.

Set the `PKG_CONFIG_PATH` variable so that `pkg-config` can find the `ffmpeg`
dependency files installed in step 2:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
# install_ffmpeg.sh stores ffmpeg dependency files in this directory by default
export PKG_CONFIG_PATH=~/compiled/lib/pkgconfig
```

Set the `BUILD_TAGS` variable to enable mainnet support:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
export BUILD_TAGS=mainnet
# To build with support for only development networks and the Rinkeby test network
# export BUILD_TAGS=rinkeby
# To build with support for only development networks
# export BUILD_TAGS=dev
```

4. Build and install `livepeer`:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
make
cp livepeer* /usr/local/bin
```

## Troubleshooting

### Error while loading shared libraries

You may encounter the following issue when running the `livepeer` binary.

```
error while loading shared libraries: libnppig.so.11: cannot open shared object file: No such file or directory.
```

This means that you have installed the Livepeer GPU binary but it is unable to
access your CUDA Toolkit libraries. If you do not intend to use GPU transcoding,
please download `livepeer` instead of `livepeer-gpu`. However, if you wish to
use GPU transcoding, please ensure that the CUDA Toolkit is installed and add
its path to the shared libraries path.

```
export LD_LIBRARY_PATH=${HOME}/compiled/lib:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
```
