π How to Make a Shared Drive in OpenWRT β Full Guide for Office & Home Networks
Want a centralized, secure, and always-on file sharing solution for your office or home without keeping your PC running 24/7? In this guide, we’ll walk you through how to set up a shared network drive using OpenWRT.
β Why Use OpenWRT for Shared Drive Instead of a Personal PC?
Using your office PC to host a shared folder comes with limitations:
- β Power-hungry and must stay on
- β Risk of data loss when the PC crashes or updates
- β Not always accessible remotely
By contrast, using OpenWRT on your router with a USB drive or external HDD allows:
- β‘ Low power consumption β routers run 24/7 anyway!
- π Centralized and secured access for all users
- π± Cross-platform access (Windows, Android, macOS)
- π Ideal for small offices, remote teams, or NAS replacement
π οΈ Step-by-Step: Install Samba4 on OpenWRT
Samba4 allows Windows-compatible file sharing via the SMB protocol. We will install it via both terminal (SSH) and the LuCI Web Interface.
1. SSH into your OpenWRT router
Use a terminal or SSH tool like PuTTY:

2. Update package lists
opkg update
3. Install required packages
opkg install samba4-server luci-app-samba4
This installs both the Samba4 server backend and the LuCI GUI module for web-based configuration.
βοΈ Configure Samba Share Using LuCI Web Interface
- Visit http://192.168.10.1 (replace with your router’s IP).
- Navigate to: Services β Network Shares
- Click on Enable Samba4, then Save & Apply
- Under Shared Directories, click Add
- Name: SharedFiles (or anything meaningful)
- Path:
/mnt/sda1/shared
(your mounted USB/HDD path) - Allow guests: Optional
- Read-only: Uncheck for read-write access
- Click Save & Apply


- Apply
π€ Add Samba Users in OpenWRT
To create user access control:
- Create a new system user:
bashCopyEditadduser newuser
- Set the password for the user:
bashCopyEditpasswd newuser
- Enable the user for Samba:
bashCopyEditsmbpasswd -a newuser
Now, this user can authenticate when connecting to the share.
π Accessing the Shared Drive
π» On Windows:
- Press
Win + R
, type: CopyEdit\\192.168.1.1\SharedFiles
- Enter the Samba username and password.
- You can map it as a drive:
- Right-click on “This PC” β Map Network Drive
π± On Android:
Use file manager apps like:
Steps:
- Tap Network β LAN
- Enter the router IP and credentials
π On macOS:
- In Finder, press
Cmd + K
- Enter:
smb://192.168.1.1/SharedFiles
- Click Connect, enter credentials
π Bonus Tips
- Use a powered USB hub if connecting HDDs with high power draw
- Set up automount for USB using
block-mount
- Secure access using strong passwords or disable guest access
π Summary
Task | Command or Path |
---|---|
Install Samba4 Server | opkg install samba4-server |
Install LuCI Web Config | opkg install luci-app-samba4 |
Add user to Samba | smbpasswd -a username |
Access from Windows | \\192.168.1.1\ShareName |
Access from Android/macOS | Use smb:// protocol with login |
β Final Thoughts
Setting up a shared drive using OpenWRT is a smart and cost-effective alternative to a full NAS or keeping your computer always on. It’s ideal for collaborative teams, home users, and small offices who want centralized storage without spending big.