Prerequisites
Before downloading files, make sure you have:
- SSH access to your VPS
- wget or curl installed (usually pre-installed)
- URL of the file you want to download
Method 1: Using wget (Most Common)
Connect to your VPS:
ssh hxroot@YOUR_SERVER_IP -p 22
Basic download:
wget https://example.com/file.zip
Save with different name:
wget -O newname.zip https://example.com/file.zip
Download to specific directory:
wget -P /tmp/ https://example.com/file.zip
wget Common Options
- -O filename - Save as different name
- -P directory - Save to specific directory
- -c - Continue/resume partial download
- -b - Download in background
- -q - Quiet mode (no output)
- --limit-rate=200k - Limit download speed
- --user=USER --password=PASS - For authenticated downloads
- --no-check-certificate - Skip SSL certificate check
wget Examples
Resume interrupted download:
wget -c https://example.com/largefile.zip
Download in background:
wget -b https://example.com/largefile.zip
Check log: tail -f wget-log
Limit speed to 500KB/s:
wget --limit-rate=500k https://example.com/file.zip
Download with username/password:
wget --user=myuser --password=mypass https://example.com/protected.zip
Download multiple files from list:
wget -i filelist.txt
Where filelist.txt contains one URL per line.
Mirror entire website:
wget -r -l 5 https://example.com
Method 2: Using curl
Basic download (save as original name):
curl -O https://example.com/file.zip
Save with different name:
curl -o myfile.zip https://example.com/file.zip
Follow redirects:
curl -L -o file.zip https://example.com/download/link
Silent download:
curl -s -O https://example.com/file.zip
Show progress:
curl -# -O https://example.com/largefile.zip
curl Common Options
- -O - Save with remote filename
- -o filename - Save with custom filename
- -L - Follow redirects
- -C - - Resume download
- --limit-rate 200K - Limit speed
- -u user:pass - Authentication
- -k - Skip SSL verification
- -s - Silent mode
Download from Google Drive
# For small files
wget --no-check-certificate "https://docs.google.com/uc?export=download&id=FILE_ID" -O filename
For large files (using gdown):
pip install gdown
gdown https://drive.google.com/uc?id=FILE_ID
Download from GitHub Releases
wget https://github.com/user/repo/releases/download/v1.0/file.tar.gz
Download latest release:
wget https://github.com/user/repo/archive/refs/heads/main.zip
Download Multiple Files in Parallel
Using xargs:
echo "https://file1.zip https://file2.zip" | xargs -n 1 -P 4 wget
Using curl parallel mode:
curl -O https://file1.zip -O https://file2.zip
Download Script with Error Handling
#!/bin/bash
URL="https://example.com/file.zip"
OUTPUT="/tmp/file.zip"
if wget -O "$OUTPUT" "$URL"; then
echo "Download successful: $OUTPUT"
else
echo "Download failed!"
exit 1
fi
Check File Integrity After Download
Download checksum file:
wget https://example.com/file.zip.md5
Verify MD5:
md5sum file.zip
Compare with downloaded .md5 file.
Verify SHA256:
sha256sum file.zip
Install wget/curl if Missing
apt update
apt install wget curl -y
Download Speed Test
wget -O /dev/null http://speedtest.tele2.net/100MB.zip
✅ You can now download files directly to your Hostxpeed VPS using wget and curl.