Secure File Transfer Protocol (SFTP) allows you to transfer files between your local computer and a Windows VPS securely. This guide will walk you through installing, configuring, and securing an SFTP server on your Windows Server VPS using OpenSSH.
📌 Prerequisites
-
A Windows Server VPS (2016, 2019, or 2022) from VolticHost
-
Administrator access
-
Ports 22 open in the firewall
1️⃣ Install OpenSSH on Windows Server
-
Open PowerShell as Administrator.
-
Run the following command to install OpenSSH:
Add-WindowsFeature -Name OpenSSH-Server
-
Once installed, start the OpenSSH service:
Start-Service sshd
-
Enable the service to start on boot:
Set-Service -Name sshd -StartupType Automatic
-
Verify that OpenSSH is running:
Get-Service sshd
✅ OpenSSH is now installed and running!
2️⃣ Configure Windows Firewall for SFTP
-
Open Windows Defender Firewall (
Win + R
, typewf.msc
, press Enter). -
Click Advanced Settings → Inbound Rules → New Rule.
-
Select Port, then click Next.
-
Choose TCP, enter 22, then click Next.
-
Select Allow the connection, then click Next again.
-
Apply to Domain, Private, and Public networks.
-
Name the rule SFTP Port 22 and click Finish.
✅ Your firewall now allows SFTP connections!
3️⃣ Create an SFTP User
-
Open Command Prompt (Admin).
-
Create a new user (replace
sftpuser
with your preferred username):net user sftpuser YourStrongPassword /add
-
Add the user to the "SFTP Users" group (create it if it doesn't exist):
net localgroup "SFTP Users" /add net localgroup "SFTP Users" sftpuser /add
-
Create a folder for SFTP file storage:
mkdir C:\SFTP\sftpuser
-
Set permissions so only the user can access the folder:
icacls C:\SFTP\sftpuser /grant sftpuser:F
✅ Your SFTP user is now set up!
4️⃣ Configure OpenSSH for SFTP Access
-
Open PowerShell as Administrator.
-
Edit the SSH configuration file:
notepad C:\ProgramData\ssh\sshd_config
-
Scroll to the bottom and add the following lines:
Match Group "SFTP Users" ChrootDirectory C:\SFTP ForceCommand internal-sftp AllowTcpForwarding no X11Forwarding no
-
Save and close the file.
-
Restart the SSH service to apply changes:
Restart-Service sshd
✅ Your OpenSSH server is now configured for SFTP!
5️⃣ Connect to Your SFTP Server
Using FileZilla (GUI-Based)
-
Download and install FileZilla from https://filezilla-project.org.
-
Open FileZilla and click File → Site Manager.
-
Click New Site and enter the following details:
-
Host: Your VPS IP
-
Port:
22
-
Protocol: SFTP - SSH File Transfer Protocol
-
Logon Type: Normal
-
Username:
sftpuser
-
Password: Your password
-
-
Click Connect to access your SFTP server.
✅ You can now transfer files securely!
6️⃣ Secure Your SFTP Server (Recommended)
Change the Default SSH Port (Optional for Security)
To prevent unauthorized access, change the SSH port from 22 to a custom port (e.g., 2222):
-
Open PowerShell and edit the SSH config:
notepad C:\ProgramData\ssh\sshd_config
-
Find the line:
#Port 22
-
Change it to:
Port 2222
-
Save the file and restart the SSH service:
Restart-Service sshd
-
Open Windows Firewall and allow the new port (
2222
).
✅ Your SFTP server is now more secure!
🎉 Conclusion
You've successfully set up an SFTP server on a Windows VPS using OpenSSH! You can now securely transfer files between your local machine and your VPS. 🚀
For more assistance, contact VolticHost Support.