{"id":2695,"date":"2018-10-11T21:22:28","date_gmt":"2018-10-11T15:52:28","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=2695"},"modified":"2026-09-28T16:44:05","modified_gmt":"2026-09-28T11:14:05","slug":"how-to-backup-openvz-containers-vms-using-vzdump-on-centos-rhel","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-backup-openvz-containers-vms-using-vzdump-on-centos-rhel\/","title":{"rendered":"How to Backup OpenVZ containers (VM&#8217;s) using vzdump on Centos \/ RHEL"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Post Date: October 11, 2018<br>Last Updated: September 28, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to back up OpenVZ containers using <code>vzdump<\/code> on CentOS\/RHEL. <code>vzdump<\/code> isn&#8217;t included in the standard OpenVZ repository for CentOS\/RHEL \u2014 you either compile it from source yourself, or install it from a third-party repository, covered below.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two things worth knowing upfront: this guide applies to <strong>legacy OpenVZ<\/strong> (the <code>vzctl<\/code>\/<code>CTID<\/code>-based tooling shown below), not OpenVZ 7 or Virtuozzo, which use different commands (<code>prlctl<\/code>). And standard CentOS Linux itself has reached end-of-life (CentOS 7 in June 2024, CentOS 8 in December 2021) \u2014 if you&#8217;re setting up a new hardware node today, consider a currently supported alternative like AlmaLinux, Rocky Linux, or CentOS Stream instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A hardware node running legacy OpenVZ, with one or more containers (VMs) configured<\/li>\n\n\n\n<li>Root access to the hardware node<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Architecture<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>vzdump<\/code> reads each container&#8217;s filesystem and configuration directly from the hardware node<\/li>\n\n\n\n<li>It packages that data into a <strong>compressed archive<\/strong> (<code>.tgz<\/code>) per container<\/li>\n\n\n\n<li>The archive can later be restored to the same or a different CTID using <code>vzrestore<\/code><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/10\/ChatGPT-Image-Sep-28-2026-04_16_05-PM.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/10\/ChatGPT-Image-Sep-28-2026-04_16_05-PM-1024x683.png\" alt=\"\" class=\"wp-image-11955\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/10\/ChatGPT-Image-Sep-28-2026-04_16_05-PM-1024x683.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/10\/ChatGPT-Image-Sep-28-2026-04_16_05-PM-300x200.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/10\/ChatGPT-Image-Sep-28-2026-04_16_05-PM-768x512.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/10\/ChatGPT-Image-Sep-28-2026-04_16_05-PM-272x182.png 272w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2018\/10\/ChatGPT-Image-Sep-28-2026-04_16_05-PM.png 1536w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Steps<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">I. Install vzdump<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>vzdump<\/code> isn&#8217;t in the standard OpenVZ repo, so it needs to come from a third-party source \u2014 historically, the SolusVM\/SolusLabs repository has provided it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create the repo file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd \/etc\/yum.repos.d\nvi solusvm.repo\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[soluslabs]\nname=Soluslab Repo\nmirrorlist=http:\/\/repo.soluslabs.com\/centos\/mirrors-soluslabs\ngpgcheck=0\nenabled=1\n<\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Security note:<\/strong> <code>gpgcheck=0<\/code> disables package signature verification entirely, meaning packages from this repo aren&#8217;t cryptographically verified before installing \u2014 a real risk if the repository or its mirror were ever compromised. If this repository provides a GPG key, import it and set <code>gpgcheck=1<\/code> instead. Also verify this repository is still actively maintained before relying on it; third-party repos like this can go stale or disappear over time. If it&#8217;s unavailable, compiling <code>vzdump<\/code> from source (as OpenVZ&#8217;s own documentation covers) is the more durable fallback.<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Install it:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum install vzdump\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">II. List Your Current Containers<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vzlist -a\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Example output:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"> CTID  NPROC   STATUS    IP_ADDR         HOSTNAME\n101   338    running  192.168.0.101  server1.example.com\n102   -      stopped  192.168.0.102  server2.example.com\n103   -      stopped  192.168.0.103  server3.example.com\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">III. Create the Backup Directory<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mkdir \/home\/backup\nchmod 700 \/home\/backup\nchown root:root \/home\/backup\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use any path you prefer \u2014 just confirm it has enough free space for your containers&#8217; full backups.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">IV. Back Up a Single Container<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vzdump --compress --dumpdir \/home\/backup 101\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>--compress<\/code> stores the backup as <code>.tar.gz<\/code> to save space.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">V. Back Up All Containers on the Node<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vzdump --compress --dumpdir \/home\/backup --all\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">VI. Restore a Backup to a Different Container<\/h3>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vzrestore \/home\/backup\/vzdump-101.tgz 103\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This restores the backup from container 101 into a new container with CTID 103. See <code>man vzrestore<\/code> for additional options.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">VII. Test Your Backups Periodically<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An untested backup only gives false confidence. Periodically restore a backup to a spare CTID to confirm it actually works end to end, rather than assuming it does because the <code>vzdump<\/code> command completed without errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Backing up OpenVZ containers with <code>vzdump<\/code> comes down to installing it (since it isn&#8217;t in the standard repo), then running it against a single container or all of them with <code>--dumpdir<\/code> pointing at your backup location. Just weigh the third-party repo&#8217;s <code>gpgcheck=0<\/code> setting and long-term availability against compiling from source if you want a more verifiable installation path \u2014 and remember this applies specifically to legacy OpenVZ, not OpenVZ 7\/Virtuozzo.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Does this work with OpenVZ 7 or Virtuozzo?<\/strong> No \u2014 this guide covers legacy OpenVZ (<code>vzctl<\/code>\/CTID-based). OpenVZ 7 and Virtuozzo use <code>prlctl<\/code> and a different toolset entirely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Is it safe to leave gpgcheck=0 in the repo file long-term?<\/strong> Not ideal \u2014 it means packages from that repo are never signature-verified. If a GPG key is available for the repo, import it and switch to <code>gpgcheck=1<\/code> instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How do I automate this on a schedule?<\/strong> Add the <code>vzdump --compress --dumpdir ... --all<\/code> command to a cron job, and consider copying the resulting archives off the hardware node afterward, so a full node failure doesn&#8217;t take your only backup copy with it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-restore-openvz-virtuozzo-7-disaster-recovery-dr\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to restore OpenVZ \/ Virtuozzo 7 (Disaster Recovery \u2013 DR)<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-create-an-openvz-container-via-bash-script\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Create an OpenVZ Container via Bash Script?<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to Our Technology Experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Managing virtualization infrastructure or need a reliable backup strategy? Our team can help with server administration, backup automation, and ongoing infrastructure support.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/contact\">Connect with our technology experts.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: October 11, 2018Last Updated: September 28, 2026 Introduction This guide explains how to back up OpenVZ containers using [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1020],"tags":[436,435,437,438],"class_list":["post-2695","post","type-post","status-publish","format-standard","hentry","category-containers-kubernetes","tag-hardware-node","tag-openvz","tag-vzdump","tag-vzrestore","psol-cat-containers-kubernetes"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-Ht","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2695"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2695\/revisions"}],"predecessor-version":[{"id":11957,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2695\/revisions\/11957"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}