Run a file server in any directory on Windows or macOS by executing a single command. Once started, files can be accessed from other devices on the same local network.
Prerequisites
- Install Python
Install QR generator:
- brew install qrencode
Step 1.
Copy serve.sh from the Mac folder and paste it into any temporary folder. Open Terminal in that folder.
Step 2.
sudo mv serve.sh /usr/local/bin/serve
Step 3.
sudo chmod +x /usr/local/bin/serve
Now you can run:
serve
in any directory to make that folder shareable on the local network.
After installation, delete the original serve.sh file from the temporary folder to avoid command conflicts.
Prerequisites
- Install Python
Install QR generator:
- py -m pip install qrcode[pil]
Step 1.
Copy serve.bat and server.py from the Windows folder and paste them into a permanent folder (one that you will not delete).
Step 2.
Search “Environment Variables” → open Edit the system environment variables.
Step 3.
Click Environment Variables → under System variables, find Path → click Edit.
Step 4.
Click New and paste the folder path from Step 1 (where serve.bat and server.py are stored). Click OK.
Now you can run:
serve
from any directory in Command Prompt or PowerShell to make that folder shareable on the local network.
Navigate to any folder in CMD:
cd "your-folder"
serve
A local server will start, and the folder will be accessible to other devices connected to the same Wi-Fi/network.