{"id":610,"date":"2023-10-31T10:05:18","date_gmt":"2023-10-31T10:05:18","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2023\/10\/31\/8535692-how-to-download-a-particular-website-s-backup-via-ssh-in-hostinger\/"},"modified":"2026-05-08T13:01:51","modified_gmt":"2026-05-08T13:01:51","slug":"8535692-how-to-download-a-particular-website-s-backup-via-ssh-in-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/8535692-how-to-download-a-particular-website-s-backup-via-ssh-in-hostinger\/","title":{"rendered":"How to Download a Particular Website&#8217;s Backup via SSH in Hostinger"},"content":{"rendered":"<p class=\"no-margin\">While our <b><a href=\"\/support\/5981435-how-to-download-backups-at-hostinger\" target=\"_blank\" class=\"intercom-content-link\">Backups tool<\/a><\/b> is designed to download files of all the websites within a particular hosting plan at once, you can download a backup of a particular website via SSH.<\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">This method doesn&rsquo;t apply to sites created with <b>Hostinger Website Builder<\/b> &#128161; <\/p>\n<\/div><p class=\"no-margin\">\n<\/p><h2 id=\"h_45b6814434\">Step 1 &ndash; Preparations<\/h2><p class=\"no-margin\">To begin, you&rsquo;ll need two things:<\/p><ol>\n<li>\n<p class=\"no-margin\">Enough <b><a href=\"\/support\/2436138-how-to-check-resources-usage\" target=\"_blank\" class=\"intercom-content-link\">storage<\/a><\/b> for at least your desired website&rsquo;s <b>public_html <\/b>folder size<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b><a href=\"\/support\/1583645-how-to-enable-ssh-access\" target=\"_blank\" class=\"intercom-content-link\">SSH access<\/a><\/b>, which is available with Premium web hosting plans or greater<\/p>\n<\/li>\n<\/ol><p class=\"no-margin\">Make sure you&rsquo;ve enabled SSH access and connect to your hosting plan: <b><a href=\"\/support\/1583245-how-to-connect-to-your-account-via-ssh\" target=\"_blank\" class=\"intercom-content-link\">How to Connect to a Hosting Plan via SSH<\/a><\/b><\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_8e1c4d23fc\">Step 2 &ndash; Navigate to the Correct Location<\/h2><p class=\"no-margin\">Once connected via SSH, you&rsquo;re located in its <b>root directory<\/b>. To double-check it, use the command<b> <\/b><code>ls<\/code><b> <\/b>and hit the <b>Enter <\/b>button. You&rsquo;ll get a result similar to this:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/10\/9eceeb27-c85e-45a0-b0da-3fe6abce1e45.jpg\" alt=\"Terminal showing SSH directory listing with domains and public_html folders highlighted\" data-media-id=\"2763\"><\/div><p class=\"no-margin\">The <b>domains<\/b> folder has all your websites&rsquo; files separated into individual folders (except for builder-based websites). Navigate to the <b>domains<\/b> folder using the <code>cd domains<\/code> command. Once you&rsquo;re there, use the <code>ls<\/code> command again to see the content within the <b>domains <\/b>folder:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/10\/54fbfa92-6b8a-4a95-acac-c730aa909e1e.jpg\" alt=\"Terminal showing .bash_history and several domain names listed, with one highlighted in blue\" data-media-id=\"2764\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">You should see all your websites listed there.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_3886086093\">Step 3 &ndash; Generate a Compressed Folder<\/h2><p class=\"no-margin\">Create a compressed folder of your preference: <\/p><p class=\"no-margin\">\n<\/p><h3 id=\"h_49a6259beb\">Compressing to .TAR.GZ<\/h3><p class=\"no-margin\">Use the command below. Replace <code>folder-name<\/code> with the title of your preferred website&rsquo;s folder, and hit the <b>Enter<\/b> button:<\/p><pre><code>tar -czvf folder-name.tar.gz \/folder-name<\/code><\/pre><p class=\"no-margin\">\n<\/p><h3 id=\"h_bd298cead8\">Compressing to .ZIP<\/h3><p class=\"no-margin\">Use the command below. Replace <code>folder-name<\/code> with the title of your preferred website&rsquo;s folder, and hit the <b>Enter<\/b> button:<\/p><pre><code>&#8203;zip -r folder-name.zip folder-name\/<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Once you do that, you&rsquo;ll see a list of subfolders and files that have been added to your compressed folder. Then, you can use new commands again. Depending on your website&rsquo;s size, it might take a few minutes. <\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">You may use the command <code>ls<\/code> again to check if the new compressed file is now created and listed on your current location.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_00e6010116\">Step 4 &ndash; Get the Name of Your Database (Optional for WordPress)<\/h2><p class=\"no-margin\">If your website is built with WordPress, you might want to double-check the name of your website&rsquo;s database. In that case, navigate to the website&rsquo;s folder:<\/p><pre><code>cd folder-name\/public-html<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">And get its database name with the following command (no need to replace anything here):<\/p><pre><code>wp config get DB_NAME<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Then, copy the output (the title of your site&rsquo;s database) prompted on your screen and save it somewhere for later:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/10\/bdfde603-cd8a-4c52-9b8a-6de8d941ab2b.jpg\" alt=\"Hostinger VPS terminal showing wp config get DB_NAME command output with database name u817052417_ibFX6\" data-media-id=\"2766\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">After checking your database&rsquo;s title, don&rsquo;t forget to navigate back to the <b>domains<\/b> folder with the command:<\/p><pre><code>cd ..\/..<\/code><\/pre><p class=\"no-margin\">\n<\/p><h2 id=\"h_4460b6bc44\">Step 5 &ndash; Export and Compress Database (Optional)<\/h2><p class=\"no-margin\">If you already know the name of your website&rsquo;s database, you may now <b><a href=\"\/support\/4536328-how-to-export-a-database-over-ssh\" target=\"_blank\" class=\"intercom-content-link\">export it via SSH<\/a><\/b>. Once exported, you&rsquo;ll be able to see the <b>.SQL<\/b> file in your location:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/10\/787ae2b7-65f8-4aab-9684-a8eaec37fa91.jpg\" alt=\"Hostinger SSH terminal showing mysqldump command to create website-name-db-backup.sql, with the backup file highlighted\" data-media-id=\"2767\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">You may also compress this specific folder by following <b><a href=\"#h_3886086093\" target=\"_blank\" class=\"intercom-content-link\">step 3<\/a><\/b> above: only replace the <code>folder-name<\/code> with the name of your database (<b>.SQL<\/b>) file. If you use the <b><a href=\"#h_bd298cead8\" target=\"_blank\" class=\"intercom-content-link\">zip command<\/a><\/b>, remove the <code>-r<\/code> part from the command, as it&rsquo;s only used for folder compression. For example:<\/p><pre><code>zip website-name-db-backup.zip website-name-db-backup.sql<\/code><\/pre><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/10\/2a9d1e92-5b5d-466b-8b0c-a6e01415a290.jpg\" alt=\"SSH terminal showing zip command creating website-name-db-backup.zip from website-name-db-backup.sql\" data-media-id=\"2768\"><\/div><p class=\"no-margin\">\n<\/p><h2 id=\"h_5579c0d63a\">Step 6 &ndash; Download the Compressed Files via SSH<\/h2><p class=\"no-margin\">To download the files, open a new terminal tab or disconnect from the current SSH session with the command <code>exit<\/code>:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/10\/48853f19-72e6-41df-b412-d9481ed845da.jpg\" alt=\"Terminal showing logout after exiting an SSH session on a Hostinger server\" data-media-id=\"2769\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Finally, adapt the following command to download the generated files:<\/p><pre><code>scp username@hostname:\/path\/to\/remote\/file \/path\/to\/local\/file<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">In this example, it would be:<\/p><pre><code>scp -P 65002 u817052417@82.180.135.53:\/home\/u817052417\/domains\/drew-dev-br.zip \/home\/andrew.ribeiro\/Downloads<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">And for the database:<\/p><pre><code>scp -P 65002 u817052417@82.180.135.53:\/home\/u817052417\/domains\/website-name-db-backup.zip \/home\/andrew.ribeiro\/Downloads<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">You&rsquo;ll be prompted to enter your password, and the files will be downloaded!<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">After that, we highly recommend you connect to your hosting via SSH again (<b><a href=\"#h_45b6814434\" target=\"_blank\" class=\"intercom-content-link\">step 1<\/a><\/b>) and remove the generated files with the following command (so that they wouldn&rsquo;t consume your hosting plan&rsquo;s resources):<\/p><pre><code>rm<\/code><\/pre><p class=\"no-margin\">\n<\/p><h2 id=\"h_2ab0cb3b63\">Step 7 &ndash; Download the Compressed Files via the File Manager (Optional)<\/h2><p class=\"no-margin\">Go to the <b><a href=\"\/support\/4548688-basic-actions-in-the-file-manager\" target=\"_blank\" class=\"intercom-content-link\">File Manager<\/a><\/b>, and <b>access all the files in your hosting plan<\/b>:<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Navigate to the <b>domains<\/b> folder, select the desired files, and download them:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/10\/342c5be0-a0f8-4412-9cd8-3082a7b48203.jpg\" alt=\"Hostinger file manager with the Download button highlighted for selected backup files\" data-media-id=\"2771\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Once finished, you may delete these files to have more space:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/10\/f93c3e70-d754-4bed-99a3-d1543e3ec3bc.jpg\" alt=\"Hostinger file manager delete icon highlighted in the top toolbar\" data-media-id=\"2770\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">And that&rsquo;s it!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Downloading a backup of a particular website<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[236],"tags":[],"class_list":["post-610","post","type-post","status-publish","format-standard","hentry","category-backups-management"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/8535692-how-to-download-a-particular-website-s-backup-via-ssh-in-hostinger\/","default":1}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=610"}],"version-history":[{"count":1,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/610\/revisions"}],"predecessor-version":[{"id":2774,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/610\/revisions\/2774"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}