Why a Prometheus backup starts with a TSDB snapshot
A TSDB snapshot is a point-in-time copy of Prometheus's local time series database, created through the admin API rather than by copying the data directory while the server is writing to it. If you run a single Prometheus server, the history on its disk cannot be rebuilt from scrapes once it is gone, because targets only expose current values. That makes a backup plan a requirement, not an optional extra, and the snapshot is the starting point for it. Local storage is not clustered or replicated, so the Prometheus storage documentation asks you to manage it like any other single-node database. Confirm now whether your server is the only copy of its history and whether anyone has tested a restore.
The storage engine writes samples into two-hour blocks and records incoming data in a write-ahead log (WAL) before it is compacted into blocks. The default retention is 15 days, configurable by time or size, so older blocks are deleted automatically unless you keep them elsewhere. Consistency is the reason the snapshot matters: a file copy taken during a write can capture a block that is half written or a WAL that does not match the blocks next to it. The snapshot is created by Prometheus itself, so the server flushes its in-memory head data into a consistent set of files before the copy is made. Your backup job should copy from the snapshot directory and never from the live data directory.
The admin API is disabled by default, and the snapshot endpoint is one of the operations it exposes, so enabling it is a deliberate security decision. Decide who can reach the endpoint before you turn it on, because the same API can delete series. Plan for these choices in order: how often to snapshot given your retention, where the copies go, how long they are kept, and how you will prove a restore works. Ask your own team to confirm the Prometheus version in use and check its security model before changing any flags, since the admin API settings and their defaults are documented there.
Which backup method fits your Prometheus deployment
A snapshot is a point-in-time copy of the TSDB created through the admin API while Prometheus keeps running. It gives you a consistent set of blocks without stopping scrapes or alerting, which makes it the method most teams use on a live server. It has to be enabled deliberately, because the admin APIs are disabled by default and the snapshot endpoint is exposed on the same HTTP server as the query and UI endpoints.
- What it protects: completed two-hour blocks, which hold most of your history, copied as a consistent set.
- What it misses: samples still in the write-ahead log at the moment of the snapshot, unless the WAL is captured with the snapshot as a separate step.
- Access risk:
--web.enable-admin-apiallows destructive operations, so the API must sit behind TLS, authentication and network restrictions. - Operating effort: a scheduled job, an off-host copy, retention rules for old snapshots and a tested restore procedure.
- Who pays: your team or a partner builds the job and monitors it, and storage for the copies recurs every backup cycle.
Check whether your Prometheus version and configuration expose the snapshot endpoint and confirm the admin API settings in your own environment before you rely on it.
The simplest method is to stop Prometheus and copy its data directory with ordinary file tools. Because nothing writes during the copy, the files are internally consistent, and the method needs no API and no extra flags. The cost is downtime: scrapes stop, alert evaluation stops, and gaps appear in every graph while the server is down.
- What it protects: the entire data directory, including the WAL, so recent samples are included.
- What it misses: nothing on the host, but it protects only the single node where the copy was taken.
- Downtime: every backup window creates a monitoring gap, which may conflict with alerting obligations.
- Operating effort: a maintenance window, a stop and start sequence, and a copy job that checks the process has fully exited first.
- Storage layout: the copy must be taken from a volume you control, and network file systems are not a supported storage choice for the TSDB.
Ask your team how long a stop would interrupt alerting and whether a maintenance window is acceptable for your recovery objectives. Those answers, not a generic duration, should decide whether this method is viable.
Remote write sends samples to an external system as they are ingested. If that system keeps the data, the copy you need to recover from lives outside the Prometheus host. The Prometheus storage documentation notes that local storage is not clustered or replicated and should be managed like any other single-node database, and remote write is one way to move the history off that single node. It is not a backup by itself, because it only protects what was successfully sent.
- What it protects: samples that were delivered to the remote system, which can be queried after a local disk failure.
- What it misses: rules, alert configuration, the local recovery of recent data not yet sent, and any samples dropped during a queue backlog or outage.
- Dependency: you operate and back up the remote store, which has its own sizing, retention and failure modes.
- Operating effort: remote write tuning, monitoring of the send queue, and a separate recovery plan for the receiving system.
- Cost: the remote storage and its backups recur, and they should be quoted alongside any Prometheus host costs.
Confirm with your team whether the remote system is treated as the system of record and whether its own backups meet your retention needs. Keep configuration files backed up separately, since no remote store restores them.
How to enable the admin API and create a snapshot safely
This sequence turns on the Prometheus admin API only for the snapshot call, protects it with TLS and authentication, and produces a named snapshot directory that can be copied off the host.
Confirm the admin API is needed
Before changing any flags, the platform owner decides whether a snapshot call is needed at all, and who will run it and when. The admin HTTP APIs are disabled by default, and the
--web.enable-admin-apiflag enables destructive operations as well as snapshots, so the flag should stay on only for the window a snapshot requires. Record the change owner and the host in your change ticket. Done means the team has a written reason for enabling the API and a named operator for the backup run.Place the API behind TLS and authentication
Before enabling the flag, configure the web TLS and basic authentication settings so the endpoint is never served in cleartext. Prometheus supports TLS with a minimum of TLS 1.2 and HTTP basic authentication with bcrypt-hashed passwords, and basic authentication without TLS exposes credentials in cleartext. Restrict the listen address or firewall rules so only the backup host and approved administrators can reach the web port. Done means a request without credentials is rejected and a request from an untrusted network does not connect.
Enable the admin API flag for the window
Restart Prometheus with
--web.enable-admin-apiadded to the startup arguments, and leave--web.enable-lifecycleoff unless a reload is separately required. The operator, not an automation job with broad rights, makes this change through the normal change process so the restart is logged. Keep the flag in the service definition only for the duration of the snapshot run. Done means the process starts cleanly and the service log shows the admin API enabled.Call the snapshot endpoint
From the authorized backup host, send a POST request to the snapshot endpoint of the admin API, using the TLS certificate and credentials configured earlier. Prometheus creates a checkpoint of the head and blocks under the data directory, which is the consistent point for copying. Capture the HTTP response, which contains the snapshot name. Done means the call returns a success response with a snapshot name in the body.
Verify the snapshot name and directory
Check that the name in the response matches a directory created under the
snapshotsfolder inside the Prometheus data directory. Confirm the directory contains block directories and the expected metadata, and that the response name is the one your backup job will record. If the name does not match a directory, stop and investigate before copying anything. Done means the name from the API and the directory on disk agree.Confirm the snapshot excludes the WAL
Inspect the snapshot directory and confirm there is no
waldirectory inside it. The write-ahead log is not part of the snapshot, so a restore from it recovers only the data in completed blocks, and data still in the head at the snapshot point is not included. Record this limitation in the runbook so restore expectations are correct. Done means the listing shows block directories and no WAL directory.Disable the admin API and copy off host
Remove
--web.enable-admin-apifrom the service definition, restart Prometheus, and confirm the admin endpoint now refuses the snapshot request. Then copy the snapshot directory to storage outside the Prometheus host, keeping its name, and verify the copy with a checksum or file count against the source. Done means the admin API is disabled again and the off-host copy matches the snapshot.
How snapshots move from the Prometheus host to off-host storage
The flow starts in the Prometheus data directory, which holds two-hour blocks and the write-ahead log. An admin snapshot call, which only works when the admin API is enabled and reachable from a restricted network, creates a snapshot folder that contains the blocks but not the WAL. A copy job then moves that folder to off-host backup storage, and a restore path writes it back into a new data directory. Check that the admin API is reachable only from the trust boundary and that the copy job never reads the live WAL.
Snapshot data moves from the live host to off-host storage and back into a new data directory.
Copying snapshots off the host without losing consistency
A snapshot only protects you once it leaves the Prometheus host, and the copy step is where consistency and security are most often lost. The cards below cover the decisions that connect snapshot creation to a backup you can restore from, from copy tooling and encryption to WAL handling, retention and alerting on failures.
Copy tooling and permissions
Use a copy tool that transfers the complete snapshot directory and verifies the transfer, such as rsync with checksums or an object storage client. The account that performs the copy should have read access to the snapshot directory and write access only to the backup destination, so a compromised Prometheus host cannot delete its own history. Confirm which identity your backup platform uses and who can rotate its credentials.
Prometheus storage docsEncrypting backups at rest
Snapshots contain every metric label and value Prometheus stored, which can include hostnames, internal service names and tenant identifiers. Encrypt the copy before or during transfer, using keys held outside the Prometheus host. Confirm with your security team which key management service or encryption tool is approved, where keys are escrowed, and how a restore is authorized when the original host is lost.
Keeping the WAL out of the copy
A snapshot taken through the admin API already captures a consistent set of blocks, so the wal directory should not be copied alongside it. Copying live WAL segments can capture a partially written file that does not match the blocks, which is a common cause of restore problems. Document this exclusion in the backup job so that a later change to the copy script does not reintroduce the WAL.
Retention and rotation of copies
Decide how many snapshot copies to keep, how long each set lives and how old copies are removed, and write that policy down before the first backup runs. Keep at least one copy that is stored separately from the Prometheus host and its storage account. Ask your compliance team whether metric history has a minimum retention requirement, since local Prometheus retention and backup retention are configured independently.
Monitoring that backups succeed
A backup job that fails silently leaves you with no recent copy until someone attempts a restore. Alert when the copy job exits with an error, when the newest backup in the destination is older than your policy allows, and when a backup is suspiciously small. Test restores on a schedule so the monitoring reflects what you can actually recover, and confirm who receives these alerts outside working hours.
Restoring a Prometheus snapshot and checking the result
A snapshot is only a backup once you have proven you can restore it, so rehearse the restore on a non-production host before you rely on it. The sequence is: stop the Prometheus process, move the snapshot blocks into a fresh data directory, start Prometheus against that directory, and then check the result. Do not copy snapshot contents over a live data directory, and keep the original directory in place until the restored instance has passed its checks, so that you can fall back to it if the restore fails.
The restored copy holds only what was in the snapshot. Samples written after the snapshot was taken are not there, and the contents of the write-ahead log at snapshot time are not part of the blocks, so anything that was still in the WAL and not yet compacted into a block is lost. Plan for a gap between the snapshot time and the failure time, and tell stakeholders which window of metrics and alert history may be missing. Confirm with your own configuration how often snapshots run, because that interval sets the most data you can lose.
After startup, verify the restore rather than assuming it worked. Query the up metric and a few known series from your dashboards, confirm that the time range you expect is queryable, and check that recording rules and alert rules loaded without errors on the status pages. Compare series counts for key jobs with the source instance if it is still available. Record the steps, timings and results in a runbook so the next restore is faster and less dependent on one engineer. The Prometheus storage documentation describes the on-disk layout you will be checking against.
Protecting the admin API and backup copies
Snapshot backups depend on two things that are easy to leave open: the admin API that creates snapshots and the copies that hold the data. The cards below cover the API exposure, the transport and authentication settings that protect it, and the sensitivity and access control of the backup copies.
Keep the admin API disabled by default
Snapshot creation runs through the admin API, which Prometheus leaves disabled unless you turn it on with the --web.enable-admin-api flag. That same flag also enables destructive operations such as series deletion, so enabling it for snapshots widens what anyone with API access can do. Check that the flag is set only on the instance that runs backups, and that the flag is not present in shared unit files or container templates where it was copied from a test setup.
Prometheus security modelAvoid cleartext basic authentication
Prometheus supports HTTP basic authentication with bcrypt-hashed passwords, but credentials sent without TLS travel in cleartext. Any caller who can reach the admin API from a shared network segment could capture a password used to trigger snapshots. Confirm that basic authentication is configured only together with TLS on the web endpoint, and that the backup job does not pass credentials through command-line arguments or logs.
Require TLS 1.2 or later
Prometheus supports TLS on its web endpoint with TLS 1.2 as the minimum version. Set the web configuration so that connections to the admin API use TLS, and verify the negotiated version from the backup host with a test client. A snapshot request that falls back to plain HTTP through a misconfigured proxy would expose both the request and the response, so test the path the backup job actually uses, not only the direct listener.
Use client certificates for the backup job
Prometheus supports client certificate authentication alongside TLS. Issuing a dedicated client certificate to the backup job lets you limit snapshot requests to one identity, rotate that identity on its own schedule, and revoke it without changing passwords used by other tools. Ask who issues and stores the private key, and whether the certificate is kept on the backup host or in a secrets manager.
Treat snapshots as sensitive data
A snapshot contains the full set of stored series and their labels, so it can reveal hostnames, service names, customer or tenant identifiers and internal endpoints. Labels that were harmless on the live server become sensitive once copied. Before you set retention for backups, review which labels reach storage and decide whether any series must be excluded or deleted from older copies. Ask the team owning each label what it reveals.
Restrict access to backup storage
Snapshot copies are useful to an attacker only if they can read them, so the storage that holds them needs the same care as the server. Limit read and write access to the backup account, enable encryption at rest where your storage supports it, and log access to the copies. Test restores with a separate restricted identity so that the people who recover data do not also hold permission to change it.
Questions teams ask before backing up Prometheus
What drives the cost and effort of a Prometheus backup program?
The main drivers are the number of Prometheus servers, how much local data each one holds, where snapshots are copied, and how often and how far back you need to restore. Prometheus itself is licensed under Apache-2.0 with no paid edition, so the costs are infrastructure (disk for snapshots, transfer and off-host storage), the engineering time to script and monitor the job, and the time to test restores. Setup is largely one-time, while storage, retention and periodic restore tests recur. Ask any partner for a quote that lists each server in scope, the snapshot schedule, the off-host target and retention period, and the restore test you expect to see documented.
Can our own team back up Prometheus without a partner?
Often yes, if you already run Prometheus and have people comfortable with its admin API and Linux storage. The admin snapshot endpoint is disabled by default and must be enabled with the --web.enable-admin-api flag, which also exposes destructive operations, so the team needs to protect it with a reverse proxy, network controls and authentication before automating anything. Teams without that experience usually underestimate the restore testing and the access review. A partner can build and document the procedure, then hand it over, or your team can build it and have the restore path checked.
What access, storage and change windows does a backup project need from us?
You will need administrative access to the Prometheus hosts or their configuration management, a decision on where snapshots are copied (an object store, a backup server or a separate volume), and credentials for that destination. Enabling the admin API usually means a configuration change and a restart, so you need a change window for each server. The work also needs a test environment where a restored snapshot can be started without touching production targets. Confirm with your change board which network paths and service accounts the job will use before the work begins.
How long do setup and restore testing take?
Duration depends on scope: the number of Prometheus instances, whether snapshots go to a new or existing store, how many environments must be covered, and how much restore evidence your auditors or operators expect. Because no duration figure is supplied for this topic, ask any partner to show a written plan with milestones for each server, a restore test per environment and a sign-off step. Restore testing is the part teams most often skip, so make it an explicit deliverable rather than an assumption.
Does remote storage mean we no longer need Prometheus backups?
No. Remote write sends samples to an external system, which is a useful copy of the data, but it does not replace a backup plan. The Prometheus storage documentation states that local storage is not clustered or replicated and should be managed like any other single-node database. Remote systems also hold data you may not be able to restore to the same configuration, and rules, alerting configuration and the local data that has not yet been sent can still be lost. Confirm with your remote storage vendor what it retains, how it replicates and how you restore from it, then decide which gaps snapshots should cover.
How should we protect the admin API while snapshots are enabled?
Treat the admin API as privileged. Keep --web.enable-admin-api off unless you need it, restrict access at the network layer, and place an authenticating reverse proxy in front of the endpoint, because Prometheus has no built-in single sign-on and its security model notes there is no built-in CSRF protection on mutating endpoints. Use TLS and authentication for any traffic that leaves the host, since basic authentication without TLS exposes credentials in cleartext. Log who triggers snapshots and review those logs as part of routine operations.
Do snapshots include the write-ahead log, and what should we exclude?
Snapshots created through the admin API capture the TSDB blocks, and the data directory's WAL is handled separately. Copy the snapshot directory rather than the live data directory, and do not copy the live WAL directory as a backup, because it changes while Prometheus writes to it. Confirm the exact behavior for your Prometheus version against the storage documentation and test a restore before relying on it. Recovery from a damaged WAL is a separate procedure covered in the troubleshooting guidance.
How DeployOpen scopes and delivers Prometheus backup work
DeployOpen scopes Prometheus backup work in writing before any change is made to your servers. The written scope names the Prometheus servers and their data directories, the Kubernetes or VM hosts involved, the off-host destination and its retention rules, and the people who approve access to the admin API. It also states what is out of scope, such as Alertmanager state, dashboards or Grafana databases, so that nobody assumes a backup covers something it does not. The quote follows from that scope, so the first useful step for your team is to inventory the instances and decide which of them hold data you cannot rebuild from remote write or from configuration as code.
Delivery covers four parts. First, DeployOpen enables the admin API only where the snapshot endpoint is needed, keeps --web.enable-admin-api off elsewhere, and places the endpoint behind network controls and the authentication layer you already run, because the admin API is disabled by default for good reason. Second, the team builds the off-host copy job, which takes a snapshot, copies it to storage you control, and excludes the WAL directories from the copy. Third, DeployOpen writes a restore runbook with the exact steps, owners and checks for each instance. Fourth, the team runs a restore test on a separate host and records how long it took and what was verified. Ongoing support, upgrades and recurring restore tests are available as retainers, and the written scope should say which of these you want from day one.

