Transform your old laptop into a secure, personal cloud storage server
Turn any old Windows, Mac, or Linux laptop into your own private Network Attached Storage (NAS) server. Access your files securely from anywhere in the world using a clean, modern web interface.
Perfect for: Students, families, creators, small businesses, or anyone wanting private cloud storage without monthly fees.
- System Architecutre
- Main file browser interface
- Search functionality
- Storage statistics dashboard
- Tailscale Dashboard
- Easy Setup - Works on Windows, Mac, and Linux
- Access Anywhere - Use from phone, tablet, or any computer
- Secure - End-to-end encrypted access via Tailscale VPN
- Modern UI - Clean, Apple-like interface with Google Sans font
- Full File Management - Browse, upload, download, search, and delete
- Fast Search - Find files instantly by name or type
- Storage Stats - Monitor your disk usage in real-time
- FastAPI Backend - Modern, fast, production-ready API
- API Key Authentication - Secure access control
- Structured Logging - JSON logs for monitoring
- Performance Optimized - Caching, rate limiting, chunked uploads
- RESTful API - Complete API documentation
- Easy Deployment - Run as system service (24/7)
- Old laptop or desktop (Windows 10/11, macOS, or Linux)
- Python 3.11 or higher
- Internet connection for initial setup
- A few minutes of your time
git clone https://github.com/adityaa05/personal-fastNAS.git
cd personal-fastNASWindows:
mkdir C:\nas-storageMac/Linux:
mkdir ~/nas-storage# Create virtual environment
python3 -m venv venv
# Activate it
# On Windows:
venv\Scripts\activate
# On Mac/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtCreate a .env file in the project root:
# Copy the example file
cp .env.example .env
# Edit it with your valuesEdit .env with these settings:
# Storage Configuration
# Windows example: C:\nas-storage
# Mac/Linux example: /home/yourusername/nas-storage
NAS_BASE_DIR=/path/to/your/storage
# Security (IMPORTANT!)
ENABLE_AUTH=true
API_KEY=your-super-secret-key-change-this
# Performance Settings
MAX_UPLOAD_SIZE=104857600
LOG_LEVEL=INFO
ENVIRONMENT=productionGenerate a secure API key (example):
# Using Python
python -c "import secrets; print(secrets.token_hex(32))"
# Using OpenSSL (Mac/Linux)
openssl rand -hex 32Copy the generated key and paste it into your .env file.
# Make sure virtual environment is activated
python main.pyVisit in your browser: http://localhost:8000/app
Access your NAS from anywhere securely using Tailscale VPN (free for personal use).
Download for your platform:
- Windows: https://tailscale.com/download/windows
- Mac: https://tailscale.com/download/mac
- Linux:
curl -fsSL https://tailscale.com/install.sh | sh - Android/iOS: Search "Tailscale" in App Store/Play Store
- Install Tailscale on your NAS laptop (server)
- Install Tailscale on your phone, tablet, other laptops (clients)
- Sign in with the same account on all devices
On your NAS laptop:
tailscale ip -4Example output: 100.86.106.93 — this is your server IP
On any device connected to Tailscale:
- Open browser
- Go to:
http://100.86.106.93:8000/app(use your actual IP) - Click Settings in sidebar
- Enter your Server URL:
http://100.86.106.93:8000 - Enter your API Key (from
.envfile) - Click Save and reload
Done! You can now access your files from anywhere.
- Visit: https://nssm.cc/download
- Download NSSM 2.24
- Extract to
C:\nssm
Create server.py in your project directory:
import uvicorn
import sys
import os
# Add current directory to path
sys.path.insert(0, os.path.dirname(__file__))
if __name__ == "__main__":
uvicorn.run(
"main:app",
host="0.0.0.0", # Listen on all interfaces
port=8000,
workers=2, # Adjust based on CPU cores
log_level="info"
)mkdir logsOpen Command Prompt as Administrator:
cd C:\nssm\win64
nssm install NASServerIn the NSSM GUI configure:
Application Tab:
- Path:
C:\path\to\personal-fastNAS\venv\Scripts\python.exe - Startup directory:
C:\path\to\personal-fastNAS - Arguments:
server.py
Details Tab:
- Display name: Personal NAS Server
- Description: FastAPI NAS Server for file storage and access
- Startup type: Automatic
I/O Tab:
- Output (stdout):
C:\path\to\personal-fastNAS\logs\output.log - Error (stderr):
C:\path\to\personal-fastNAS\logs\error.log
Environment Tab:
- Add environment file: Path to your
.envfile
Click "Install service"
Start the service:
nssm start NASServerOther useful commands:
# Check status
nssm status NASServer
# Stop service
nssm stop NASServer
# Restart service
nssm restart NASServer
# Remove service (if needed)
nssm remove NASServer confirm
# View logs
type logs\output.log
type logs\error.logYou can also manage the service through Windows Services (services.msc)
Create /etc/systemd/system/nas-server.service:
[Unit]
Description=Personal NAS Server
After=network.target
[Service]
Type=simple
User=yourusername
WorkingDirectory=/home/yourusername/personal-fastNAS
Environment="PATH=/home/yourusername/personal-fastNAS/venv/bin"
ExecStart=/home/yourusername/personal-fastNAS/venv/bin/python main.py
Restart=always
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable nas-server
sudo systemctl start nas-serverCreate ~/Library/LaunchAgents/com.personal.nas.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.personal.nas</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/venv/bin/python</string>
<string>/path/to/main.py</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>Load the service:
launchctl load ~/Library/LaunchAgents/com.personal.nas.plist- Click "Files" in sidebar
- Click folders to open them
- Click files to download
- Use breadcrumb navigation to go back
- Click "Upload" in sidebar
- Drag and drop files OR click to browse
- Wait for upload to complete
- Files appear in your current folder
- Click "Search" in sidebar
- Type at least 2 characters
- Press Enter or click "Search"
- Click results to download
- Click "Storage" in sidebar
- View total, used, and free space
- See file and folder counts
| Variable | Description | Example | Required |
|---|---|---|---|
NAS_BASE_DIR |
Storage directory path | /home/user/nas-storage |
Yes |
API_KEY |
Secret authentication key | abc123... |
Yes |
ENABLE_AUTH |
Enable API key auth | true or false |
Yes |
MAX_UPLOAD_SIZE |
Max file size in bytes | 104857600 (100MB) |
No |
LOG_LEVEL |
Logging verbosity | INFO, DEBUG, ERROR |
No |
ENVIRONMENT |
Environment mode | production, development |
No |
By default, these file types are supported:
- Documents:
.txt,.pdf,.doc,.docx - Images:
.jpg,.jpeg,.png,.gif,.webp - Videos:
.mp4,.mkv - Audio:
.mp3 - Archives:
.zip
To add more types, edit ALLOWED_EXTENSIONS in main.py.
- ✅ Use a strong, random API key (32+ characters)
- ✅ Enable authentication (
ENABLE_AUTH=true) - ✅ Use Tailscale for remote access (not port forwarding)
- ✅ Keep Windows/Mac/Linux updated
- ✅ Change API key regularly (every 3-6 months)
- ✅ Backup your
.envfile securely - ✅ Use HTTPS if exposing to internet (advanced)
- ❌ Share your API key with anyone
- ❌ Use simple API keys like "password123"
- ❌ Disable authentication in production
- ❌ Expose port 8000 directly to internet
- ❌ Store
.envfile in version control - ❌ Use the same API key on multiple servers
Problem: Port 8000 already in use
Solution:
# Find what's using port 8000
# Windows:
netstat -ano | findstr :8000
# Mac/Linux:
lsof -i :8000
# Kill the process or change port in main.pyProblem: Connection refused from other devices
Solution:
- Check Tailscale is running:
tailscale status - Verify server is running:
curl http://localhost:8000/health - Check firewall allows port 8000
- Confirm both devices on same Tailscale network
Problem: API key not working
Solution:
- Go to Settings in web interface
- Re-enter your API key from
.envfile - Click "Save API Key"
- Wait for page to reload
- Try again
Problem: API requests take minutes
Solution:
- Reduce
MAX_UPLOAD_SIZEin.env - Clear old logs regularly
- Limit search results
- Consider faster storage (SSD vs HDD)
Access interactive API docs (development only):
# Set in .env:
ENVIRONMENT=development
# Visit:
http://localhost:8000/docs| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Server health check |
GET |
/api/files |
List files in directory |
GET |
/api/stats |
Storage statistics |
GET |
/api/search |
Search files |
POST |
/api/upload |
Upload files |
GET |
/api/download |
Download file |
DELETE |
/api/delete/{path} |
Delete file/folder |
We welcome contributions! Here's how you can help:
- 🐛 Report bugs via GitHub Issues
- 💡 Suggest features or improvements
- 📝 Improve documentation
- 🌍 Translate to other languages
- 🎨 Design UI/UX improvements
- 💻 Submit code via Pull Requests
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/personal-fastNAS.git - Create a branch:
git checkout -b feature/your-feature-name - Make changes and test thoroughly
- Commit:
git commit -m "Add: your feature description" - Push:
git push origin feature/your-feature-name - Open a Pull Request
- Follow PEP 8 for Python code
- Use meaningful variable names
- Add comments for complex logic
- Write docstrings for functions
- Test on Windows, Mac, and Linux if possible
This project is licensed under the MIT License - see the LICENSE file for details.
TL;DR: You can use, modify, and distribute this software freely. No warranty provided.
Built with:
- FastAPI - Modern Python web framework
- Tailscale - Secure VPN solution
- Uvicorn - ASGI server
- Pillow - Image processing
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: patildityaa09@gmail.com
If you find this project useful, please consider giving it a ⭐️ on GitHub!
- ✅ File browsing and management
- ✅ Upload and download
- ✅ Search functionality
- ✅ Tailscale integration
- ✅ API key authentication
- ✅ Storage statistics
- File sharing with expiring links
- Thumbnail preview for images
- Video streaming with player
- Multiple user accounts
- File versioning
- Mobile app (Android/iOS)
- Backup automation
- HTTPS support
- Docker deployment
Vote on features in GitHub Discussions!
If you love this project:
- ⭐ Star the repository
- 🐦 Share on social media
- 💬 Tell your friends
- 🤝 Contribute code or docs
- ☕ Buy me a coffee (if you're feeling generous!)