Part 2: How to Make a Linux/Server Box with Raspberry Pi (Samba NAS Setup)
The full build video for this server setup — the steps below follow it in the same order.
What you need before starting
- Microcontroller / SBC: Raspberry Pi (with pre-flashed microSD card from Part 1)
- Storage Device: 1TB 2.5-inch Internal Hard Drive (or USB Flash Drive)
- Adapter / Connectivity: SATA-to-USB adapter cable and RJ45 Ethernet cable connected to your local router
- Power Supply: Micro USB / USB-C power adapter
- Client Software: PuTTY SSH client (for Windows) and Windows File Explorer
The full build video for this server setup — the steps below follow it in the same order.
Insert the microSD card and connect hardware
Insert the pre-configured microSD card into the Raspberry Pi card slot. Connect the external storage drive (e.g., 1TB hard drive via SATA-to-USB adapter) to a USB port. Plug the Ethernet cable from your router into the Raspberry Pi ethernet port, then plug in the power supply to boot up the system.
Connect to the Raspberry Pi remotely via PuTTY SSH
Open PuTTY on your Windows PC. Enter your Raspberry Pi's IP address or network hostname (e.g., libsync or raspberrypi) into the Host Name field and click Open. Log in using the default user credentials (pi and your configured password).
Install the Samba file sharing service
Update package repositories and install Samba by running:
Bash
sudo apt update
sudo apt install samba samba-common-bin -y
Set up Samba user authentication
Create a dedicated Samba network access password for the pi user:
Bash
sudo smbpasswd -a pi
Enter and confirm your preferred network share password when prompted.
Configure Samba share directory paths
Open the Samba configuration file in the nano text editor:
Bash
sudo nano /etc/samba/smb.conf
Scroll to the very bottom of the file and define your share block (e.g., mapping the shared folder path to /media/pi/YOUR_DRIVE_NAME):
Ini, TOML
[Main]
path = /media/pi/mySQL
writeable = yes
browseable = yes
public = no
Press Ctrl + X, then type Y and press Enter to save changes.
Restart Samba service
Apply the new configuration settings by restarting the Samba service daemon:
Bash
sudo systemctl restart smbd
Map the network drive in Windows File Explorer
Open File Explorer on your Windows PC, go to Network, or type \\YOUR_HOSTNAME or \\YOUR_PI_IP in the address bar. Right-click the shared folder (e.g., Main), select Map network drive, choose a drive letter (e.g., X:), check Reconnect at sign-in, and click Finish. Enter pi as the username along with the Samba password created in Step 4.
If something does not work
PuTTY connection refused / Host not found: Verify the Raspberry Pi is connected via Ethernet to the same router network and check your router's admin panel to confirm its exact IP address or hostname.
Access denied when opening mapped drive: Ensure you enter the Samba-specific password created with sudo smbpasswd -a pi, not the standard Linux SSH user password.
Storage drive files don't appear in the shared folder: Check the mount path of your external hard drive using lsblk or df -h in terminal, and verify that the path line in /etc/samba/smb.conf matches the exact mount point under /media/pi/.
