---
layout: "docs"
page_title: "Commands: Keygen"
sidebar_current: "docs-commands-keygen"
description: |-
  The `serf keygen` command generates an encryption key that can be used for Serf agent traffic encryption. The keygen command uses a cryptographically strong pseudo-random number generator to generate the key.
---

# Serf Keygen

Command: `serf keygen`

The `serf keygen` command generates an encryption key that can be used for
[Serf agent traffic encryption](/docs/agent/encryption.html).
The keygen command uses a cryptographically
strong pseudo-random number generator to generate the key.
