apps/server/TRUENAS_SETUP.md
Quick reference for deploying Spacedrive Server on TrueNAS SCALE using the GUI.
cd ~/Projects/spacedrive/apps/server
# Build for TrueNAS
./build-for-truenas.sh
# Transfer to TrueNAS (replace with your IP)
scp spacedrive-server-*.tar.gz [email protected]:/tmp/
# SSH into TrueNAS
ssh [email protected]
# Load the image
gunzip -c /tmp/spacedrive-server-*.tar.gz | docker load
# Verify
docker images | grep spacedrive
# Should show: spacedrive-server latest ...
Go to: Apps → Discover Apps → Launch Docker Image
| Field | Value |
|---|---|
| Image Repository | spacedrive-server |
| Image Tag | latest |
| Image Pull Policy | Never ️ (Use local image!) |
| Field | Value |
|---|---|
| Container Name | spacedrive |
| Restart Policy | Unless Stopped |
| Container Port | Protocol | Node Port | Description |
|---|---|---|---|
8080 | TCP | 8080 | Web UI & API |
7373 | TCP | 7373 | P2P Networking |
Access your server at: http://TRUENAS-IP:8080
| Field | Value |
|---|---|
| Type | Host Path (or ixVolume) |
| Host Path | /mnt/your-pool/spacedrive |
| Mount Path | /data |
| Read Only | (needs write access) |
This stores:
.sdlibrary/)Mount your existing media as read-only:
| Field | Value |
|---|---|
| Type | Host Path |
| Host Path | /mnt/your-pool/media |
| Mount Path | /media |
| Read Only |
Repeat for other datasets:
/mnt/your-pool/photos → /photos/mnt/your-pool/documents → /documentsRequired:
| Name | Value | Description |
|---|---|---|
SD_AUTH | admin:CHANGE_THIS_PASSWORD | Authentication (username:password) |
Recommended:
| Name | Value | Description |
|---|---|---|
TZ | America/New_York | Your timezone |
RUST_LOG | info,sd_core=debug | Log level |
Optional:
| Name | Value | Description |
|---|---|---|
PORT | 8080 | HTTP port (if you want to change it) |
SD_P2P | true | Enable P2P (default: true) |
| Field | Value |
|---|---|
| Type | HTTP |
| Port | 8080 |
| Path | /health |
| Initial Delay | 30 seconds |
| Timeout | 10 seconds |
| Period | 30 seconds |
Recommended for NAS stability:
| Resource | Limit | Reservation |
|---|---|---|
| Memory | 2 GB | 512 MB |
| CPU | - | - |
In TrueNAS GUI:
Or via shell:
docker ps | grep spacedrive
In GUI: Click spacedrive → Logs
Or via shell:
docker logs spacedrive
Should see:
Spacedrive Server listening on http://localhost:8080
✓ Daemon started successfully
Open browser: http://YOUR-TRUENAS-IP:8080
Login with credentials from SD_AUTH:
adminWhen you rebuild on your Mac:
cd ~/Projects/spacedrive/apps/server
./build-for-truenas.sh
# Transfer new tar
scp spacedrive-server-*.tar.gz root@TRUENAS-IP:/tmp/
# SSH and load
ssh root@TRUENAS-IP
gunzip -c /tmp/spacedrive-server-*.tar.gz | docker load
Apps → Installed → spacedrive → Stop → Start
Or via shell:
docker restart spacedrive
The container will use the updated spacedrive-server:latest image.
Check logs:
docker logs spacedrive
Common issues:
/data → Check host path exists and is writable8080 to something elseSD_AUTH format is username:passworddocker ps | grep spacedrive0.0.0.0:8080->8080/tcpcurl http://localhost:8080/healthCheck socket:
docker exec spacedrive ls -la /data/daemon/
Should see daemon.sock
Check daemon logs:
docker exec spacedrive cat /data/logs/daemon.log
Make sure you built with --platform linux/amd64:
docker inspect spacedrive-server:latest | grep Architecture
# Should show: "Architecture": "amd64"
If not, rebuild:
./build-for-truenas.sh
On TrueNAS host:
/mnt/your-pool/spacedrive/
├── daemon/
│ └── daemon.sock # Unix socket
├── libraries/
│ └── My Library.sdlibrary/
│ ├── library.db # SQLite database
│ └── sidecars/ # Thumbnails
└── logs/
└── daemon.log
Inside container:
/data/ # Maps to host path above
/media/ # Your media mounts (if configured)
/photos/
/documents/
If port 8080 is taken:
PORT=90009000 → 9000http://TRUENAS-IP:9000Run multiple Spacedrive instances with different data dirs:
Instance 1 (Personal):
spacedrive-personal/mnt/pool/spacedrive-personal8080:8080, 7373:7373Instance 2 (Work):
spacedrive-work/mnt/pool/spacedrive-work8081:8080, 7374:7373INSTANCE=workIf you want HTTPS access, put behind nginx/Caddy:
Caddy example:
spacedrive.yourdomain.com {
reverse_proxy localhost:8080
basicauth {
admin $2a$14$... # hashed password
}
}
️ IMPORTANT:
SD_AUTH=disabled on a network-accessible serveradmin:changemeNetwork access:
8080 → Web UI (needs auth)7373 → P2P (encrypted via QUIC/TLS)What to backup:
/mnt/your-pool/spacedrive/libraries/
This contains your library databases and metadata.
How:
rsync/tar backupNot needed:
daemon.sock (recreated on start)logs/ (optional)View logs:
docker logs -f spacedrive
Shell access:
docker exec -it spacedrive sh
Check daemon status:
curl -u admin:yourpassword http://TRUENAS-IP:8080/health
Should return: OK
┌─────────────────────────────────────────────────────────────┐
│ TrueNAS SCALE: Spacedrive Server │
├─────────────────────────────────────────────────────────────┤
│ │
│ Image: spacedrive-server:latest │
│ Pull: Never (use local image) │
│ │
│ Ports: 8080 (Web UI), 7373 (P2P) │
│ │
│ Volume: /mnt/pool/spacedrive → /data │
│ │
│ Env: SD_AUTH=admin:password (REQUIRED) │
│ TZ=America/New_York │
│ │
│ Access: http://TRUENAS-IP:8080 │
│ │
└─────────────────────────────────────────────────────────────┘