{"id":4845,"date":"2019-06-07T13:06:37","date_gmt":"2019-06-07T07:36:37","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=4845"},"modified":"2026-10-25T17:10:10","modified_gmt":"2026-10-25T11:40:10","slug":"backup-and-restore-cpanel-account","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/backup-and-restore-cpanel-account\/","title":{"rendered":"How to Back Up and Restore a cPanel Account Using SSH (Command Line)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Post Date: June 07, 2019<br>Last Updated: October 25, 2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Backup and Restore cPanel Account<\/strong> operations are essential for protecting website files, databases, email accounts, and hosting configurations. Regular backups help prevent data loss and make it easier to recover a website after accidental deletion, server failure, or migration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cPanel provides command-line scripts to simplify these operations. The <code>pkgacct<\/code> script creates a cPanel account backup, while <code>restorepkg<\/code> restores an account from a compatible backup archive. In this guide, we will explain how to backup and restore a cPanel account using SSH commands on a WHM server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting the cPanel backup and restore process, ensure that you have the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Root access or the necessary administrative privileges on the cPanel\/WHM server.<\/li>\n\n\n\n<li>The cPanel account username that needs to be backed up or restored.<\/li>\n\n\n\n<li>Sufficient disk space for creating and storing the backup archive.<\/li>\n\n\n\n<li>An existing compatible backup archive if you are restoring an account.<\/li>\n\n\n\n<li>SSH access to the server and basic knowledge of Linux commands.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\"><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation: How to Backup and Restore cPanel Account<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">STEPS<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1)<\/strong> Log-in to the server using SSH as Root user. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2)<\/strong> To <strong>Backup<\/strong> a cpanel account enter the following command on the command line, Instead of username enter your username init.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/scripts\/pkgacct username<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img fetchpriority=\"high\" decoding=\"async\" width=\"561\" height=\"168\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/06\/root.png\" alt=\"\" class=\"wp-image-4860\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/06\/root.png 561w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/06\/root-300x90.png 300w\" sizes=\"(max-width: 561px) 100vw, 561px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">After completing backup it display location, size of file and status of backup.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" width=\"585\" height=\"182\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/06\/image.png\" alt=\"\" class=\"wp-image-4862\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/06\/image.png 585w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2019\/06\/image-300x93.png 300w\" sizes=\"(max-width: 585px) 100vw, 585px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3)<\/strong> To <strong>Restore<\/strong> a cpanel account enter the following command on the command line, Instead of username enter your username init. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/scripts\/restorepkg username<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note &#8211; To restore the file, 1st goto the directory, that to be stored <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Backing up and restoring a cPanel account through SSH is a useful skill for hosting administrators. The <code>pkgacct<\/code> command creates account backup archives, while <code>restorepkg<\/code> restores accounts from compatible backups. Following the steps in this guide helps you protect important hosting data, verify backup integrity, and prepare for recovery when needed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Always maintain separate backup copies and verify the restoration process before considering a recovery complete. For more cPanel, WHM, and web hosting tutorials, visit <a href=\"https:\/\/pheonixsolutions.com\/blog?utm_source=chatgpt.com\">pheonixsolutions.com<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>1. Which command is used to back up a cPanel account?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following command to create a backup of a cPanel account:<\/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=\"\">\/scripts\/pkgacct username<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>username<\/code> with the actual cPanel account username.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>2. Where is the cPanel account backup file stored?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By default, the backup file is generally created in the <code>\/home<\/code> directory in the format <code>cpmove-username.tar.gz<\/code>. The command output displays the backup location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>3. Which command is used to restore a cPanel account?<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following command to restore a cPanel account from an available backup:<\/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=\"\">\/scripts\/restorepkg username<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>username<\/code> with the actual cPanel account username.<\/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-install-whm-cpanel-on-ubuntu-20-04\/\">How to Install WHM cPanel on Ubuntu 20.04<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-use-the-automount-feature-with-cpanel-backups\/\">How to use the automount feature with cPanel backups<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Need Help with cPanel Backup and Restore?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Need help with cPanel account backups, account restoration, or WHM server administration? Our experts can assist with cPanel account management, backup and recovery, website migration, server troubleshooting, and other hosting requirements. Get in touch with our team <a href=\"https:\/\/pheonixsolutions.com\/contact?utm_source=chatgpt.com\">here<\/a>.<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Post Date: June 07, 2019Last Updated: October 25, 2026 Introduction Backup and Restore cPanel Account operations are essential for protecting [&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_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_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":[1019],"tags":[249,182,263],"class_list":["post-4845","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","tag-backend","tag-backup","tag-cpanel","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1g9","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4845","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=4845"}],"version-history":[{"count":1,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4845\/revisions"}],"predecessor-version":[{"id":12492,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4845\/revisions\/12492"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}