Warning: If you follow these steps, you do so at your own risk!
It is not recommended you try this yourself unless you don't mind the risk involved, and/or you are familiar enough with command lines, and computer/server configuration processes.
FYI, in the future, I'll create video tutorials for all of these steps.
Step 1: Prepare Your Hardware
Choose and prepare the hardware for your Samba server.
Option A: Build a Server - Assemble a purpose-built computer designed to function as a server (e.g., desktop, Raspberry Pi, or server rack form factor).
Option B: Repurpose an Old PC - Use an existing PC and back up any important files to a portable storage drive before proceeding.
Step 2: Prepare Ubuntu Server Installation Media
Download and set up the installation media for Ubuntu Server based on your hardware.
Option A: Most Computers - Download Ubuntu Server installation media from [ Ubuntu Server ].
Option B: Raspberry Pi - Download the [ Raspberry Pi Imager ] and use it to install Ubuntu Server on a MicroSD card. Review optional settings like SSH during configuration. Recommended: Use a reliable MicroSD card, such as [ this SanDisk one from Amazon ].
Step 3: Install Ubuntu Server
Install Ubuntu Server on your chosen hardware.
Follow the official installation instructions provided on the Ubuntu Server or Raspberry Pi website to install the operating system.
Step 4: Boot into the Server
Start your server and connect to it.
Boot the machine. For convenience, connect remotely from another computer using SSH if enabled during installation.
Step 5: Run the Configurator Script
Download and execute the script to configure your Samba server.
From the Ubuntu Server terminal, run the following command to download and execute the configurator script:
Once the script has completed, make sure you make a note of the samba share addresses it provides, then run the following command to delete the script you just ran (you don't need it anymore):
cd ~ && rm configure_server.sh
If you've made it this far, congratulations on your patience and pain tolerance. Now follow the steps below to map the network drives on your client machines and set up file synchronization.
Step 6: Map Network Drives
After running the script [ See what it does by clicking here ], your Samba server should be ready. You now need to map the shared drives on your client machines (Windows, Linux, or Mac) to access the shared folders.
Windows
Open File Explorer and click "This PC."
Click "Map network drive" in the toolbar (or right-click "This PC" and select "Map network drive").
Choose a drive letter (e.g., Z:).
In the "Folder" field, enter the path to your Samba share, e.g., \\[server ip]\share (replace [server ip] with your server's IP address and share with the shared folder name defined in the script).
Check "Reconnect at sign-in" for persistent mapping.
Click "Finish." Enter your Samba username and password (set during the script configuration) when prompted.
Linux
Open a terminal and install the necessary Samba client tools (if not already installed): sudo apt install cifs-utils (for Debian/Ubuntu-based systems).
Create a mount point: sudo mkdir /mnt/samba.
Mount the Samba share: sudo mount -t cifs -o username=[your-username] //[server ip]/share /mnt/samba (replace [your-username], [server ip], and share as appropriate).
Enter your Samba password when prompted.
To make the mount permanent, edit /etc/fstab and add: //[server ip]/share /mnt/samba cifs username=[your-username],password=[your-password],uid=1000,gid=1000 0 0. Replace placeholders accordingly.
Mac
Open Finder and press Command + K to open the "Connect to Server" dialog.
Enter the Samba share path: smb://[server ip]/share (replace [server ip] and share as appropriate).
Click "Connect." Enter your Samba username and password when prompted.
The share will appear in Finder. To make it persistent, drag the mounted share to the "Favorites" section in Finder's sidebar.
Step 7: Configure File Synchronization
To keep files synchronized between your client machine and the Samba server, use FreeFileSync (available for Windows, Linux, and macOS)
Open FreeFileSync and click the green "+" button to add a folder pair.
For the left folder, select a local folder on your client machine. For the right folder, select the mapped Samba share (e.g., Z:\ on Windows, /mnt/samba on Linux, or the mounted share on macOS).
Choose a synchronization method (e.g., "Two-way" for bidirectional sync or "Mirror" to copy from local to server).
Click "Compare" to analyze differences, then "Synchronize" to start the process.
Save the configuration and schedule automatic syncs using FreeFileSync’s "RealTimeSync" feature if desired.
Your Samba server is now fully operational, with mapped drives and file synchronization set up. Regularly monitor your server for updates and backups to ensure data integrity.