---
title: "Deploy Consul"
description: "Service discovery and key-value store with web UI, ACLs enabled"
category: "Other"
url: https://railway.com/deploy/consul-1
---

# Deploy Consul

Service discovery and key-value store with web UI, ACLs enabled

**[Deploy Consul on Railway](https://railway.com/template/consul-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/consul-1/manifest.json

- **Creator:** zer0person's Projects
- **Category:** Other
- **Total deploys:** 1

## Template content

### Consul

- **Image:** hashicorp/consul
- **Start command:** `sh -c "mkdir -p /consul/config && printf '{\"acl\":{\"enabled\":true,\"default_policy\":\"deny\",\"tokens\":{\"initial_management\":\"%s\",\"agent\":\"%s\"}}}' $CONSUL_MANAGEMENT_TOKEN $CONSUL_MANAGEMENT_TOKEN > /consul/config/acl.json && exec consul agent -server -bootstrap-expect=1 -ui -client=0.0.0.0 -bind=127.0.0.1 -data-dir=/consul/data -config-dir=/consul/config"`
- **Public domain:** Yes

## Documentation

# Deploy and Host Consul on Railway

[Consul](https://github.com/hashicorp/consul) is HashiCorp's tool for service discovery, health checking and a distributed key-value store, with a built-in web UI.

## About Hosting Consul

This template runs the official `hashicorp/consul` image as a single-node server with the web UI enabled and a persistent volume at `/consul/data`. Access control (ACLs) is enabled with a default deny policy, so nothing can be read or changed without a token. The management token is the generated `CONSUL_MANAGEMENT_TOKEN` variable on the service: open the public URL, click Log in in the UI, and paste that token. The same token works as `X-Consul-Token` for the HTTP API at `/v1/`.

## Common Use Cases

- A small key-value store and feature-flag/config registry
- Service registry and health checking for a handful of services
- Learning and evaluating Consul's UI and API

## Dependencies for Consul Hosting

- One service with a volume; nothing else

### Deployment Dependencies

- [Consul on GitHub](https://github.com/hashicorp/consul)
- [Documentation](https://developer.hashicorp.com/consul)
- [Docker image](https://hub.docker.com/r/hashicorp/consul)

## Why Deploy Consul on Railway?

Railway gives you a public HTTPS URL, a persistent volume and automatic restarts with no server to maintain. This is a single server for evaluation and small setups, not a multi-node production cluster.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/consul-1
