Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>FTP 解压部署New to Visual Studio Code? Get it now.
FTP 解压部署

FTP 解压部署

陈随易

chensuiyi.me
|
4 installs
| (0) | Free
右键一键压缩→上传→解压到 Linux 服务器(基于 SFTP + unzip)
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

FTP Zip Deploy

Deploy files and folders to remote servers via SFTP with automatic zip compression and extraction.

通过 SFTP 将文件和文件夹部署到远程服务器,支持自动压缩和解压。

Demo


中文文档 | English


English

Introduction

FTP Zip Deploy is a VSCode extension that simplifies the deployment process by compressing your local files into a zip archive, uploading it to a remote server via SFTP, and automatically extracting it. This approach is significantly faster than uploading files one by one, especially for projects with many small files.

Features

  • 📦 Smart Compression: Automatically compress files/folders into zip format before upload
  • 🚀 Fast Deployment: Upload single zip file instead of thousands of individual files
  • 🔧 Server Management: Manage multiple server configurations in the sidebar panel
  • 🎯 Context Menu Integration: Deploy directly from the Explorer context menu
  • 📝 Ignore Files Support: Use .zipignore to exclude files from compression
  • 🔄 Auto Extract: Automatically extract zip file on the remote server after upload
  • 🗑️ Clean Deploy: Clear target directory before extraction to ensure clean deployment

Usage Scenarios

  • Frontend Projects: Deploy React, Vue, Angular, or other frontend build outputs
  • Static Sites: Deploy static websites, documentation, or HTML pages
  • Quick Updates: Rapidly deploy entire project folders to development/staging servers
  • CI/CD Integration: Use in automated deployment workflows
  • Multi-Server Management: Manage and deploy to multiple environments (dev, staging, production)

How to Use

1. Add Server Configuration

  1. Click the FTP icon in the Activity Bar to open the sidebar panel
  2. Click the "Add" button in the panel
  3. Fill in the server information:
    • Host: Server IP address or domain name
    • Port: SSH port (default: 22)
    • Username: SSH username
    • Password: SSH password
    • Remote Path: Target directory on the server (e.g., /var/www/html)
  4. Click "Save" to add the server configuration

2. Deploy Files/Folders

  1. In the Explorer, right-click on any file or folder you want to deploy
  2. Select "FTP Zip Deploy" from the context menu
  3. A list of configured servers will appear
  4. Click on the target server to start deployment

3. Use .zipignore (Optional)

Create a .zipignore file in any directory to exclude specific files or folders from compression:

node_modules/
.git/
*.log
.env

The .zipignore file follows the same pattern syntax as .gitignore.

Deployment Process

  1. 📁 Read .zipignore and collect files to compress
  2. 🗜️ Compress selected files into a temporary zip archive
  3. 📤 Upload zip file to remote server via SFTP
  4. 🗑️ Clear all contents in the target directory on the server
  5. 📦 Extract zip file using the unzip command on the server
  6. ✅ Deployment complete!

Notes

  • Only password-based authentication is supported (SSH key authentication is not supported)
  • The remote server must have the unzip command installed
  • The target directory will be cleared before extraction - use with caution!

中文文档

简介

FTP Zip Deploy 是一个 VSCode 扩展,通过将本地文件压缩为 zip 包、上传到远程服务器并自动解压的方式,简化了部署流程。这种方式比逐个上传文件要快得多,特别是对于包含大量小文件的项目。

功能特性

  • 📦 智能压缩:自动将文件/文件夹压缩为 zip 格式再上传
  • 🚀 快速部署:上传单个 zip 文件而非数千个单独文件
  • 🔧 服务器管理:在侧边栏面板中管理多个服务器配置
  • 🎯 右键菜单集成:直接从资源管理器右键菜单部署
  • 📝 忽略文件支持:使用 .zipignore 排除不需要压缩的文件
  • 🔄 自动解压:上传后自动在远程服务器上解压 zip 文件
  • 🗑️ 清空部署:解压前清空目标目录,确保部署环境干净

使用场景

  • 前端项目部署:部署 React、Vue、Angular 等前端项目的构建产物
  • 静态网站:部署静态网站、文档站点或 HTML 页面
  • 快速更新:快速将整个项目文件夹部署到开发/测试服务器
  • CI/CD 集成:在自动化部署工作流中使用
  • 多服务器管理:管理并部署到多个环境(开发、测试、生产)

使用方法

1. 添加服务器配置

  1. 点击活动栏中的 FTP 图标打开侧边栏面板
  2. 点击面板中的 "添加" 按钮
  3. 填写服务器信息:
    • 主机地址:服务器 IP 地址或域名
    • 端口:SSH 端口(默认:22)
    • 用户名:SSH 登录用户名
    • 密码:SSH 登录密码
    • 远程路径:服务器上的目标目录(例如:/var/www/html)
  4. 点击 "保存" 添加服务器配置

2. 部署文件/文件夹

  1. 在资源管理器中,右键点击要部署的文件或文件夹
  2. 从右键菜单中选择 "FTP 解压部署"
  3. 会弹出已配置的服务器列表
  4. 点击目标服务器开始部署

3. 使用 .zipignore(可选)

在任意目录下创建 .zipignore 文件,排除特定文件或文件夹不被压缩:

node_modules/
.git/
*.log
.env

.zipignore 文件使用与 .gitignore 相同的模式语法。

部署流程

  1. 📁 读取 .zipignore 并收集需要压缩的文件
  2. 🗜️ 将选中的文件压缩为临时 zip 包
  3. 📤 通过 SFTP 上传 zip 文件到远程服务器
  4. 🗑️ 清空服务器上目标目录的所有内容
  5. 📦 在服务器上使用 unzip 命令解压文件
  6. ✅ 部署完成!

注意事项

  • 仅支持密码方式登录(不支持 SSH Key 认证)
  • 远程服务器必须安装 unzip 命令
  • 解压前会清空目标目录 - 请谨慎使用!
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft