Skip to content

These new docs are in beta. Please submit bugs to GitHub issues.


Installing

To install Horizon, you have a few choices. You can…

The first method is recommended: not only do you ensure OS compatibility and dependency management, you’ll also install some convenient wrappers that make running Horizon and Stellar Core much simpler.

Package Manager

SDF publishes new releases to its custom Ubuntu repositories. Follow this guide to add the stable SDF repository to your system. Then,

bash
sudo apt update && sudo apt install stellar-core stellar-horizon

This page outlines the various commands that these packages make available.

Building

Should you decide not to use one of our prebuilt releases, you may instead build Horizon from source. To do so, you need to prepare a developer environment, including:

  • A Unix-like operating system with the common core commands (cp, tar, mkdir, bash, etc.)
  • A compatible distribution of Golang (v1.15 or later)
  • git

(Though Horizon can run on Windows, building directly on Windows is not supported.)

At this point, you can easily build the Horizon binary:

bash
git clone https://github.com/stellar/go monorepo && cd monorepo
go install -v ./services/horizon

(You should refer to the list of Horizon releases and git checkout accordingly before building if you’re looking for a stable release rather than the bleeding edge master branch.)

At this point, you can either add Go binaries to your PATH in your .bashrc (or equivalent), or copy the binary from the GOPATH to the system PATH (as we’ll do later:

bash
export PATH=$(go env GOPATH)/bin:$PATH

Installing Remote Captive Core

If you want to run Captive Core instances (for transaction ingestion) separately from other Horizon instances, the architecture supports that. This allows flexibility in scaling and redundancy. For example, you may want to have your ingesting Horizon instances have dedicated Captive Cores, while request-serving instances all use the same Remote Captive Core for transaction submission. Or, perhaps you want a dedicated Remote Captive Core for ingestion living on more-powerful hardware.

If you are interested in this approach, you’ll need some additional binaries on that machine.

From Repositories

After setting up repositories as described above, you’ll need to install the following packages on that machine:

bash
sudo apt install stellar-captive-core stellar-captive-core-api

From Source

Alternatively, you can install the bleeding edge from source:

bash
git clone https://github.com/stellar/go monorepo && cd monorepo
go install -v ./exp/services/captivecore
sudo cp $(go env GOPATH)/bin/captivecore /usr/bin/stellar-captive-core-api

Completing and Testing Your Installation

If you built from source or downloaded a release from GitHub, make sure to copy the native binary into a directory that is part of your PATH. Most Unix-like systems have /usr/local/bin in PATH by default, so unless you have a preference or know better, we recommend you copy the binary there:

bash
sudo cp horizon /usr/local/bin/stellar-horizon

(We’ve renamed it here to keep it consistent with the results of the recommended Package Manager method.)

To test your installation, simply run stellar-horizon --help from a terminal. If the help for Horizon is displayed, your installation was successful.

Note: Some shells (such as zsh) cache PATH lookups. You may need to clear your cache (by using rehash in zsh, for example) or restart your shell before trying to run the aforementioned command.

Last updated Apr. 12, 2021

Next Up: Configuring
Page Outline