Download your Mern stack app Using scp (Secure Copy)
Arshan Nawaz
Posted on May 21, 2024
Step 1: Create Backup on Server
Connect to Your Server:
Use SSH to connect to your server. Replace and with your server's username and IP address.
ssh <remote-user>@<remote-ip>
Step 2: Create a Backup Directory (if not already created):
Create a directory to store your backups. For example, let's create a directory named backups in your home directory.
mkdir -p ~/backups
Step 3: Create the Backup:
Assuming your application files are in /var/www/websiteFolder/, create a backup of the portfolio directory.
tar -czvf ~/backups/app-backup-$(date +%F).tar.gz /var/www/portfolio/
Step 4: Download Backup to Local Machine
Open a New Terminal Window (on your local machine):
Open a new terminal window or tab on your local machine.
Download the Backup:
Use the scp command to download the backup file from the server to your local machine. Replace , , and accordingly.
scp <remote-user>@<remote-ip>:~/backups/app-backup-$(date +%F).tar.gz <local-path>
for Mac
mkdir -p /Users/username/backup
scp <remote-user>@<remote-ip>:~/backups/app-backup-$(date +%F).tar.gz /Users/username/backup
app-backup-$(date +%F).tar.gz is file name. Also you can verify the name.
Step 5: Extract Backup file
Open terminal in /Users/username/backup and run command
tar -xzvf app-backup-2024-05-21.tar.g
app-backup-2024-05-21.tar.g is file name, it can different in your case
Posted on May 21, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.