Install Vector via Nix

Vector can be installed through the Nix package manager via Vector's Nix package. This package manager is generally used on NixOS.


The daemon deployment strategy is designed for data collection on a single host. Vector runs in the background, in its own process, collecting all data for that host. Typically data is collected from a process manager, such as Journald via Vector's journald source, but can be collected through any of Vector's sources. The following diagram demonstrates how it works.

Vector daemon deployment strategyVector daemon deployment strategy
1. Your service logs to STDOUT
STDOUT follows the 12 factor principles.
2. STDOUT is captured
STDOUT is captured by your platform.
3. Vector collects & fans-out data
Vector collects data from your platform.

  1. Install Vector

    nix-env --file --install --attr vector
    explain this command

    Looking for a specific version?

  2. Configure Vector

    Where do you want to send your data?
    cat <<-VECTORCFG > /etc/vector/vector.toml
    type = "journald" # required
    # Encoding
    encoding.codec = "json" # required
    # General
    inputs = ["in"] # required
    type = "console" # required
    explain this command
  3. Start Vector

    vector --config /etc/vector/vector.toml
    explain this command


The Vector nix package does not install any configuration files by default. You'll need to create a Vector configuration file and pass it to Vector via the --config flag when starting Vector.


How you deploy Vector is largely dependent on your use case and environment. Please see the deployment section for more info on how to deploy Vector.


The Vector nix package does not use Systemd by default, but Vector does provide a Systemd service file that you can use as a starting point. How you manage the Vector process is up to you, and the process administration section covers how to do this:



nix-env --uninstall vector


nix-env --file --upgrade vector



Vector's Nix packages only support the X86_64 architecture.


Installing previous versions of Vector through nix is possible, but not straightforward. For example, installing Vector 0.7.1 can be achieved with the following command:

nix-env --file --install --attr vector

20bbe6... represents the commit sha for the 0.7.1 on the nix package repo.

Listing Versions & Commit SHAs

For situations that required automated retrieval, we've thrown thogether this handy Ruby function that will list the Vector versions and their commit sha:

require "net/http"
require "json"
# Returns a hash mapping Vector versions to commits in `nixpkgs/nixos` repository
def nix_versions
nixpkgs_repo = "nixos/nixpkgs"
commits_url = "{nixpkgs_repo}/commits?path=pkgs/tools/misc/vector"
response = Net::HTTP.get URI(commits_url)
items = JSON.parse response
versions = {}
for item in items do
match = item["commit"]["message"].match "^vector:.*(\\d+\.\\d+\.\\d+)$"
if match
version = match[1]
versions[version] = item["sha"]

Source Files

Vector's Nix source files are located in the Nix repo.