Skip to content

Create a backup: back up files via SSH

Last reviewed

Before updates, migrations or major changes, create a manual backup of your web files as a compressed archive. Via SSH, this works reliably for data of any size.

  • SSH access that is set up.
  • Enough free disk space for the archive (roughly half the project size, usually less thanks to compression).
  1. Connect via SSH and change to your website’s directory:

    Terminal window
    cd ~/httpdocs
  2. Create the archive one level above the web directory, with the date in its name:

    Terminal window
    tar cvzf ../backup-2026-06-11.tgz * .htaccess

    The explicit .htaccess at the end is important: * does not match hidden files (anything starting with a dot).

  3. Wait until the command prompt returns. Depending on the project size, this takes a few minutes.

  4. Check the result:

    Terminal window
    ls -lh ../backup-2026-06-11.tgz
    tar tzf ../backup-2026-06-11.tgz | tail -n 3

    A plausible size plus an error-free listing of the last entries means the archive is complete.

The account does not have enough free space for the archive.

Solution: Delete old backups and files you no longer need, or stream the archive directly to your computer: ssh -i ~/.ssh/YOUR-KEY USER@yourdomain.com "cd ~/httpdocs && tar czf - * .htaccess" > backup-lokal.tgz (adjust the path for your panel).

* does not match files starting with a dot. Besides .htaccess, this affects files such as .env or .user.ini.

Solution: Add hidden files explicitly (tar cvzf ../backup.tgz * .htaccess .env), or back up the entire directory from outside: cd ~ && tar cvzf backup.tgz httpdocs/ (includes everything, dot files too).

A process changed files while the archive was being created. This is typical for live shops (cache, logs, sessions).

Solution: This is usually harmless if only cache or log files are affected. For a consistent state, enable the application’s maintenance mode and create the archive again.

If the archive does not complete or you are not sure which folders belong to your project: Open a ticket in the customer center.

Hosting plans and serversNot a rack::SPEED customer yet? This guide applies to our hosting plans and servers, looked after by engineers instead of a call center, since 2008.