Special Offers: Up to 75% OFF on Hostinger & High-RAM Contabo Cloud VPS available this month.Compare Plans

How to Set Up Samba Private Network File Share on Ubuntu VPS (Windows & Mac Remote Drive)

Marcus Sterling
Marcus SterlingDevOps & Cloud Engineer
October 25, 2026
•
15 min read
•
4.8 / 5.0
Transparency Notice: This article contains affiliate links to hosting providers like Hostinger and Contabo. If you purchase through our links, we may earn a commission at zero extra cost to you. We only recommend products we personally benchmark and test. Read full disclosure.
How to Set Up Samba Private Network File Share on Ubuntu VPS (Windows & Mac Remote Drive)
Best Hardware Value for TechsNo Contract Surcharges + High RAM

Contabo High-Performance Cloud VPS

Massive 4 vCPU cores, 8GB RAM, and 32TB monthly traffic. Ideal for Linux developers.

German Engineering & Data Centers
8 Strategic Global Locations
Fast NVMe Storage Array
Full Root & SSH Console Access
Starts From
$5.50 / mo
Special Affiliate Pricing
Claim Discount Now
Official Partner Link • Verified Safe

The Convenience of Remote Network File Sharing

Managing files through web interfaces or terminal SFTP clients is fine for occasional tasks, but for video editors, graphic designers, and office teams handling large raw assets, mounting remote storage directly as a native letter drive (e.g. Z: in Windows) provides seamless drag-and-drop productivity. Samba implements the standard SMB networking protocol on Linux servers.

Important ISP Security Requirement: WireGuard Tunneling

Most consumer Internet Service Providers (ISPs) block TCP port 445 to prevent WannaCry-style SMB malware propagation across the public Internet. Therefore, Samba should always be routed through your private WireGuard VPN tunnel (10.8.0.1) connecting your computer securely to your Contabo VPS.

Step 1: Installing and Configuring Samba on Ubuntu

sudo apt update && sudo apt install -y samba

# Create storage directory and assign ownership
sudo mkdir -p /srv/shares/storage
sudo chown -R $USER:$USER /srv/shares/storage

Configure the share in /etc/samba/smb.conf:

sudo nano /etc/samba/smb.conf
[CloudStorage]
   comment = Private Cloud Network Drive
   path = /srv/shares/storage
   read only = no
   browsable = yes
   valid users = @smbgroup
   create mask = 0660
   directory mask = 0770
   smb encrypt = mandatory

Step 2: Adding Samba User and Setting Passwords

sudo smbpasswd -a $USER
sudo systemctl restart smbd

On Windows Explorer, click Map Network Drive, enter \\10.8.0.1\CloudStorage, enter your Samba credentials, and enjoy instant access to your remote storage volume.

Editorial Verdict: Pros & Cons

What We Love (Pros)

  • Access terabytes of remote cloud storage as if it were a physical external drive plugged into your PC
  • Native drag-and-drop file support in Windows File Explorer and macOS Finder
  • Enforce user permissions and strong SMB3 encryption over the wire

Drawbacks (Cons)

  • Requires establishing an encrypted VPN tunnel (like WireGuard) because ISPs block port 445 on public Internet
Best Hardware Value for TechsNo Contract Surcharges + High RAM

Deploy Your Contabo Cloud Server

Includes 4 vCPU Cores, 8GB RAM, 50GB NVMe SSD, and 32TB Outbound Traffic.

German Engineering & Data Centers
8 Strategic Global Locations
Fast NVMe Storage Array
Full Root & SSH Console Access
Starts From
$5.50 / mo
Special Affiliate Pricing
Claim Discount Now
Official Partner Link • Verified Safe
#Samba#SMB Share#Network Drive#Ubuntu VPS#Contabo Storage VPS
Marcus Sterling

Written by Marcus Sterling

DevOps & Cloud Engineer

Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.

Recommended Next Reads