Start the server
On this page you learn how to:
With vHSM installed and configured, the next step is to start a Vault server.
vHSM operates as a client-server application. The server is the only piece of the Vault architecture that interacts with the data storage and backends. All operations done via the vHSM CLI interact with the server over a TLS connection.
Quickstart: Dev Server in local environment
Use the
-helpflag to list available command options forvhsm server.vhsm server -helpScroll down to the Dev Options section.
Dev Options: -dev Enable development mode. In this mode, Vault runs in-memory and starts unsealed. As the name implies, do not run "dev" mode in production. The default is false. -dev-listen-address=<string> Address to bind to in "dev" mode. The default is 127.0.0.1:8200. This can also be specified via the VAULT_DEV_LISTEN_ADDRESS environment variable. -dev-no-store-token Do not persist the dev root token to the token helper (usually the local filesystem) for use in future requests. The token will only be displayed in the command output. The default is false. -dev-root-token-id=<string> Initial root token. This only applies when running in "dev" mode. This can also be specified via the VAULT_DEV_ROOT_TOKEN_ID environment variable. -dev-tls Enable TLS development mode. In this mode, Vault runs in-memory and starts unsealed, with a generated TLS CA, certificate and key. As the name implies, do not run "dev-tls" mode in production. The default is false. -dev-tls-cert-dir=<string> Directory where generated TLS files are created if `-dev-tls` is specified. If left unset, files are generated in a temporary directory.Start a Vault server in development mode (dev server). The dev server is a built-in, pre-configured server that is not very secure but useful for playing with Vault locally.
Example output:
You should see an output similar to that above. Notice that Unseal Key and Root Token values are displayed.
The dev server stores all its data in memory (but still encrypted), listens on localhost without TLS, and automatically unseals and shows you the unseal key and root access key.
Insecure operation
Do not run a Vault dev server in production. This approach is only used here to simplify the unsealing process for this demonstration.
Server with TLS enabled in staging environments
If you wish to run a Vault dev server with TLS enabled, use the -dev-tls flag instead of -dev.
Example output:
Starting the server in production environments
When running in production, additional considerations must be made beyond development mode.
Security: Enable TLS secure communication between the client and server.
Access Control: Enable (role based) authentication and authorization mechanisms.
High availability storage: Consider using a more secure storage backend (e.g., Consul, DynamoDB).
Binding: Encrypt the persistent storage to the platform.
Refer to the configuration documentation for more advanced options and examples.
Store the configuration in config.json and run the vhsm server command with the parameter -config
Verify the server is running
Verify the server is running by running the vhsm status command. If it ran successfully, the output should look like the following:
If the output looks different, restart the dev server and try again. The only reason these would ever be different is if you're running a dev server from going through this tutorial previously.
Set environment variables
For ease of use, it is helpful to set the environment variables VAULT_ADDR, VAULT_TOKEN and ENCLAIVE_LICENCE
Launch a new terminal session.
Copy and run the
export VAULT_ADDR ...command from the terminal output. This will configure the Vault client to talk to the dev server.Vault CLI determines which Vault servers to send requests using the
VAULT_ADDRenvironment variable.Save the unseal key somewhere. Don't worry about how to save this securely. For now, just save it anywhere.
Set the
VAULT_TOKENenvironment variable value to the generated Root Token value displayed in the terminal output.Example:
To interact with Vault, you must provide a valid token. Setting this environment variable is a way to provide the token to Vault via CLI. Later, in the Authentication tutorial, you will learn to use the
vault login <token_value>command to authenticate with Vault.Set the
ENCLAIVE_LICENCEenvironment variable value to the licence keyExample:
Next
Congratulations! You've started your first Vault server.
You can continue with the MariaDB root secrets provisioning tutorial, where you learn how securely provision admin passwords after attesting the workload.
Last updated
Was this helpful?