Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Run Consul KV by starting a Consul server agent in Docker, not by launching a separate key-value container. Persist its state by mounting durable storage at /consul/data, publish only the client ports you need, and use the HTTP API or Consul CLI for key operations. On a public VPS, add firewall rules, TLS, ACLs, and gossip encryption before permitting remote clients.

What Consul KV is and what Docker must run

Consul KV is the key-value store built into a Consul agent. The agent participates in Consul’s server or client architecture; there is no standalone “KV server” image to deploy. For a small VPS, you normally run one Consul server container, enable its HTTP interface, and send requests to the server’s KV API.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The server keeps its Raft state, catalog information, sessions, and other durable data in its data directory. A container’s writable layer is temporary: removing and recreating the container can remove anything that was not mounted from the host or a Docker volume. Mount the persistent store at /consul/data and point the agent’s -data-dir flag to that path.

HashiCorp’s Docker deployment guide explicitly distinguishes the configuration directory from the state directory: /consul/config is for startup configuration files, while “the configuration directory is not exposed as a volume and does not persist data.” See HashiCorp’s Docker server-agent documentation. Treat configuration and state as separate concerns.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.

Choose a topology before creating the container

A single server is the shortest path to a working KV store, but it has a single failure domain. A multi-server cluster improves availability through quorum and is more appropriate when an outage would affect several applications. The following differences matter when you plan a VPS deployment.

Consideration Single Consul server Multi-server cluster
Persistence and recovery One durable data directory and one backup stream; recovery depends on that VPS and its snapshots. Each server needs its own durable data directory. Replicated state continues when one server is lost, but backups are still required.
Quorum and availability No quorum configuration; the server is unavailable if its host or process is down. Servers elect a leader and require a quorum. Three servers are a common small-cluster starting point.
Network exposure Expose the HTTP API only to trusted clients; expose DNS only if you use it. In addition to client traffic, allow the server-to-server gossip and RPC traffic required by the chosen Consul configuration.
Operational cost Lowest CPU, memory, storage, and administration overhead. More VPS instances, addresses, monitoring, upgrades, and failure scenarios to manage.
Backup strategy Protect the one server’s data and test restoration. Take consistent snapshots and retain copies independently of every server.
Upgrade complexity Short maintenance interruption is possible during a replacement or upgrade. Upgrade servers in a controlled sequence while preserving quorum and leader availability.

The rest of this walkthrough creates a single server. A later section shows the settings that change when you expand to three servers.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the Linux VPS

Install Docker using your distribution’s supported method

Install Docker Engine and its Compose or command-line components from the package source supported by your Linux distribution. Confirm that the daemon is running and that your administrative account can execute Docker commands, either directly or through the docker group. Keep the host patched and use a non-root administrative account with narrowly scoped sudo access.

Provide durable, lock-capable storage

Consul’s agent reference states that -data-dir is required for every agent, must survive reboots, and must support filesystem locking. A local filesystem on the VPS is normally suitable; avoid an ephemeral container layer or a network filesystem whose locking behavior you have not verified.

You can use a named Docker volume, which is convenient for a single host:

docker volume create consul-data

Alternatively, create a host bind-mount directory when you want host-level backup tools, disk quotas, or explicit permissions:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo install -d -m 0700 /srv/consul/data
sudo chown root:root /srv/consul/data

The process inside the official image must be able to read and write the mounted directory. If startup logs report permission errors, inspect the image’s user and group IDs and adjust ownership or permissions deliberately; do not solve the problem by making the directory world-writable. The data directory can contain sensitive state and, depending on the deployment, ACL tokens, so restrict read access on the host.

Plan the firewall first

Decide which networks will call Consul. Port 8500 carries the HTTP API and web UI. Port 8600 carries Consul DNS over UDP and, when a client requires it, TCP. A single-node installation does not need you to expose every Consul port to the internet. Put the VPS behind a cloud security group and a host firewall, and allow the API only from trusted application networks or an authenticated reverse proxy.

Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth

Start a single Consul server container

The following is a documented single-server pattern. It publishes the HTTP API/UI and Consul DNS over UDP, mounts a named volume at the state directory, and configures a one-server bootstrap.

docker run --name consul-server -d 
  -p 8500:8500 
  -p 8600:8600/udp 
  -v consul-data:/consul/data 
  hashicorp/consul consul agent 
  -server -ui -node=server-1 
  -bootstrap-expect=1 
  -client=0.0.0.0 
  -data-dir=/consul/data

This command follows the official Docker example. The image name is followed by the command executed inside the container: consul agent. The important flags are:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • -server: runs a server agent that stores the catalog and KV data.
  • -ui: enables the web UI on the HTTP interface.
  • -node=server-1: gives this agent a stable, unique node name.
  • -bootstrap-expect=1: tells this one-server cluster how many servers to wait for before bootstrapping.
  • -client=0.0.0.0: listens for client-interface requests on all container interfaces. This is useful inside Docker, but it does not make the VPS safe by itself; firewall and authentication controls remain mandatory.
  • -data-dir=/consul/data: places state in the mounted persistent volume.

For a bind mount, replace the volume option with -v /srv/consul/data:/consul/data. Pin the image to an approved Consul release tag for repeatable deployments instead of using latest; choose the exact tag from the current HashiCorp release documentation and record it with your infrastructure configuration.

If you do not need Consul DNS, omit the -p 8600:8600/udp mapping. If clients use DNS over TCP, publish that protocol separately with -p 8600:8600/tcp and permit it in the firewall.

Verify that the agent is healthy

Check the container state and read its startup log before sending application traffic:

docker ps
docker logs consul-server

A running container is not enough; Consul must elect a leader and join the expected cluster. Inspect membership from inside the container, as shown in the Docker documentation:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
docker exec consul-server consul members

For a one-server cluster, the member list should include server-1 and show it as alive. Query the leader endpoint from the VPS:

curl -fsS http://127.0.0.1:8500/v1/status/leader

A successful response is a quoted address and port for the elected leader. An empty response means no leader has been elected yet; inspect the logs, the bootstrap count, and the data-directory permissions before proceeding.

Rank #3
Sale
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black | LED mouse pad with 14 lighting modes, covers keyboard & mouse, anti-slip rubber base, waterproof surface, USB powered
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.

Put, read, and delete KV values

Write or update a key with the HTTP API

The KV API uses the key path under /v1/kv/. PUT creates a new key or replaces its value. This example stores the text production at app/environment:

curl --request PUT --data 'production' 
  http://127.0.0.1:8500/v1/kv/app/environment

The API normally returns a JSON boolean such as true when the write succeeds. Keys containing reserved URL characters should be URL-encoded rather than copied literally into a path. Keep values below the documented 512 KB maximum: “Values in the KV store cannot be larger than 512kb,” according to the KV Store HTTP API documentation.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read metadata or the raw value

A normal GET returns a JSON array containing metadata. The value is base64-encoded in the Value field:

curl http://127.0.0.1:8500/v1/kv/app/environment

For scripts that need only the stored bytes, append the raw query parameter:

curl 'http://127.0.0.1:8500/v1/kv/app/environment?raw'

The raw form is convenient for a configuration file or a shell variable. Treat binary and multiline data carefully, and do not log secrets returned by either form.

Delete a key

Delete the key with an HTTP DELETE request:

curl --request DELETE 
  http://127.0.0.1:8500/v1/kv/app/environment

Deleting a prefix requires the API’s recursive option; use it only after confirming the path, because all matching keys are removed.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the Consul CLI instead

The official image includes the Consul binary, so the equivalent operations can be run with docker exec:

Operation Command
Write docker exec consul-server consul kv put app/environment production
Read docker exec consul-server consul kv get app/environment
Delete docker exec consul-server consul kv delete app/environment

When ACLs are enabled, supply an appropriate token through the CLI’s supported token option or environment variable. Do not place a management token in a shell history file, image layer, or publicly readable script.

Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Keep data after restarts and back it up

Test persistence immediately after the first write. Stop and remove only the container, recreate it with the same mounted volume and data-directory setting, and confirm that app/environment is still present. Do not run docker volume rm consul-data as part of ordinary container cleanup; that command destroys the named volume.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A volume protects against container replacement but not against disk failure, operator error, ransomware, or a corrupted filesystem. Back up Consul using a tested snapshot procedure appropriate to your Consul edition and deployment. HashiCorp’s Docker guidance points to snapshot tooling for automated backups; see the Consul Docker documentation. Store backup copies outside the VPS, protect them as secrets, and perform restoration drills on an isolated test instance.

The agent reference describes -data-dir as required persistent storage and notes that server state and potentially ACL tokens reside there. Read the agent command reference before changing disks, filesystem permissions, or backup schedules. Back up configuration files separately if you mount them into /consul/config; those files do not substitute for a data-directory backup.

Secure Consul on a public VPS

Restrict network access

  • Allow TCP 8500 only from application subnets, a VPN, or a reverse proxy that authenticates users. Do not expose the UI and API to the entire internet by default.
  • Open UDP 8600 only when clients perform Consul DNS lookups. Add TCP 8600 when the workload uses DNS over TCP; DNS clients can fall back to TCP for large responses or truncated UDP responses.
  • Keep server-to-server and gossip traffic on private interfaces or a private network when you build a cluster. Do not assume that publishing one client port is sufficient or that publishing every port is safe.

Enable TLS for the HTTP API

Configure Consul’s HTTPS listener and certificates according to the release you deploy, or terminate TLS at a carefully configured reverse proxy that forwards only authenticated requests. Redirect or block plaintext HTTP from untrusted networks. Verify certificate rotation and make sure internal clients trust the issuing certificate authority.

Use ACLs with least privilege

Unauthenticated access is not an acceptable default for a public VPS. Define ACL policies for the paths each application needs. The KV API associates key:read with reads and key:write with writes and deletes. Give a read-only service only key:read on its required prefix; reserve write and management tokens for deployment automation and operators. Protect the bootstrap and replication tokens in a secret manager and on the host filesystem.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Encrypt gossip traffic

Generate a gossip encryption key with consul keygen and configure the same key on every member of a cluster. The agent documentation describes gossip encryption and the requirement that all nodes share the same key. Rotate it using a planned procedure so that old and new members overlap during the transition; never paste it into a public issue, image, or command transcript.

Do not copy the example’s broad bind blindly

The sample uses -client=0.0.0.0 because a containerized client interface must be reachable through Docker networking. That flag binds the interface on all container addresses; it does not provide authentication, encryption, or firewalling. Combine it with restricted port publishing, TLS, ACLs, and host-level filtering before remote access is enabled.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use Consul DNS only when you need it

Consul’s DNS service listens on port 8600, while the HTTP API and UI use port 8500. Publishing 8600/udp is unnecessary if every application reads KV values over HTTP or the CLI. If service discovery clients query DNS, publish UDP 8600 and evaluate whether they also require TCP 8600. Permit those protocols only from the networks that run the clients, and document the resolver address and search behavior in the application configuration.

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.

Expand to a multi-server cluster

A production cluster normally uses multiple server containers on a shared private Docker network or equivalent private connectivity. Give every server a unique node name and its own durable data directory. Configure each server with the same -bootstrap-expect value; the agent waits for that number of servers before bootstrapping, so inconsistent values can prevent a healthy cluster from forming.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For three servers, the essential differences from the single-node command are:

  • Use -server and -bootstrap-expect=3 on all three containers.
  • Assign unique names such as server-1, server-2, and server-3.
  • Give each container a separate durable mount, for example /srv/consul/server-1, rather than sharing one data directory among servers.
  • Set -retry-join to reachable addresses or DNS names for the other servers so a replacement can find the cluster.
  • Advertise addresses that the other containers can actually route to; a loopback address inside one container is not a cluster address.
  • Keep gossip encryption, TLS trust, ACL configuration, and Consul version policy consistent across members.

HashiCorp’s current Docker example demonstrates three servers with -bootstrap-expect=3; compare the exact network and port settings with that deployment guide before implementing them. Do not bootstrap a second independent cluster against an existing data directory, and do not change the expected server count casually after a cluster has formed.

Troubleshoot common failures

The container exits immediately

Run docker logs consul-server. Syntax errors, an invalid flag, a missing data directory, or a permissions failure will normally be reported there. Confirm that the image tag matches the flags in your configuration and that the mounted path is writable by the process.

The leader endpoint is empty

Check consul members, the server count, and the -bootstrap-expect value. A single server should use -bootstrap-expect=1; a three-server cluster should use 3 on every server and have working private connectivity. Firewall rules that block gossip or server RPC traffic can leave members alive but unable to elect a leader.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HTTP requests are refused

Verify that the container is running, port 8500 is published, and the request targets the correct address. From the VPS, test 127.0.0.1:8500 first. From another host, test the VPS address only after checking the security group, host firewall, TLS scheme, and reverse-proxy route. A binding on the container does not override a blocked host port.

Keys disappear after recreation

Inspect docker inspect consul-server and confirm that the volume or bind mount is attached to /consul/data. If the container was started without that mount, its writable layer held the state. Recreate the container with the original volume; do not delete the volume while investigating.

A request returns an ACL error

Supply a valid token and check that its policy grants the requested prefix and operation. Reads need key:read; writes and deletes need key:write. Also verify that the client is reaching the intended datacenter and HTTPS endpoint rather than an unconfigured local listener.

Remote access works without authentication

Treat this as an incident, not a convenience. Restrict port 8500 immediately, rotate exposed tokens, enable TLS and ACLs, and review logs for unauthorized reads or writes. The -client=0.0.0.0 setting is not an access-control mechanism.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Operational checklist

  • Consul is running as a server agent, with a stable unique node name.
  • /consul/data is backed by a durable host path or named volume that supports locking.
  • The image tag is pinned to an approved release rather than latest.
  • Only the required API and DNS protocols are published and firewalled.
  • Leader status and membership are checked after startup and after every restart.
  • KV writes, reads, raw reads, and deletes are tested with both API and CLI methods used by your applications.
  • Snapshots are automated, stored off-host, and periodically restored in a test environment.
  • TLS, ACL policies, gossip encryption, and token storage are configured before public exposure.
  • Cluster members use unique names, private join addresses, matching bootstrap expectations, and separate durable data directories.

With those controls in place, Docker supplies the process lifecycle while Consul supplies the KV API and replicated agent state. The durable data mount, narrowly exposed ports, and authenticated encrypted interfaces are the boundaries that turn the quick single-server example into a maintainable VPS deployment.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.