Installation Methods
Static Binary
Download the latest release binary for your platform. This method works on any Linux system and requires no container runtime.sd-server-linux-aarch64.tar.gz instead.
Docker Deployment
Docker images are available for both x86_64 and ARM64 architectures. The image includes all media processing dependencies and runs as a non-root user.Docker Compose
For production deployments, use the provided compose file in the repository atapps/server/docker-compose.yml. This includes health checks and restart policies.
System Service Setup
Running the server as a systemd service ensures it starts on boot and restarts on failure. Create a service file at/etc/systemd/system/spacedrive.service:
sudo systemctl status spacedrive.
Configuration
The server accepts configuration via environment variables or command-line flags. Authentication is controlled bySD_AUTH. The format supports multiple users separated by commas: user1:pass1,user2:pass2. Set to disabled to disable authentication, though this is not recommended for network-accessible deployments.
Data directory defaults to /data in Docker or a temporary directory in development. In production, always set DATA_DIR to a persistent location. The server creates library databases, thumbnails, and logs in this directory.
Port configuration defaults to 8080. Change with --port flag or PORT environment variable. The P2P port (7373) is fixed and required for device sync.
Network Access
The server binds to all interfaces by default, making it accessible on your local network. For internet access, place it behind a reverse proxy with TLS termination.Nginx Example
Caddy Example
Caddy handles TLS automatically with Let’s Encrypt:NAS Deployment
Network-attached storage devices are ideal for Spacedrive server. The server indexes existing media while providing remote access.TrueNAS SCALE
Install via the Apps interface using Docker. Map your pools as read-only volumes to prevent accidental modification during indexing.Synology NAS
Use Container Manager to deploy the Docker image. Configure port forwarding and volume mounts through the UI. Ensure the container has read access to your shared folders.Unraid
Add a custom container template with the imageghcr.io/spacedriveapp/spacedrive/server:latest. Map your shares as additional paths in the container configuration.
Storage Considerations
The server creates three types of data in the data directory: Libraries contain SQLite databases with file indexes, tags, and metadata. Each library is a separate.sdlibrary directory. These are small, typically under 100MB even for millions of files.
Sidecars include thumbnails, previews, and extracted text. Size depends on media processing settings. Budget 1-5% of your total media size for thumbnails.
Logs rotate automatically but can grow large during initial indexing. The server keeps the last 10 log files, typically under 100MB total.
Plan for library growth over time. A library indexing 1 million files uses approximately 500MB for the database and 10-50GB for sidecars, depending on media density.
The server never modifies your original files. Indexing is read-only. File operations like copy and move require explicit user action through connected clients.
Security Best Practices
Self-hosted servers face different threats than desktop apps. Follow these guidelines for secure deployment. Always use authentication when the server is network-accessible. HTTP basic auth is sufficient for home networks but consider stronger methods for internet-facing deployments. Enable TLS for any internet access. Let’s Encrypt provides free certificates through Caddy, Nginx, or Traefik. The server itself does not handle TLS, rely on reverse proxies. Limit exposure with firewall rules. Only open port 8080 to trusted networks or VPN connections. The P2P port (7373) requires UDP ingress for device sync but can be restricted to known peers. Run as non-root user. The Docker image and systemd example both use dedicated users with minimal permissions. Never run the server as root. Regular backups of the data directory protect against corruption. The SQLite databases can be backed up while running using the.backup command or by copying the entire data directory when the server is stopped.
Connecting Clients
Desktop and mobile apps can connect to self-hosted servers by configuring the server URL in settings. The URL format ishttp://your-server:8080 or https://spacedrive.example.com if using a reverse proxy. Clients authenticate using credentials set in SD_AUTH.
P2P sync works between the server and other devices without additional configuration. The server appears as a device in your library and participates in sync like any other device.
Monitoring
The server provides a health check endpoint at/health that returns HTTP 200 when operational. Use this for monitoring tools or container orchestration health probes.
Logs are written to stdout and the data directory under logs/. Set RUST_LOG environment variable to debug for detailed output during troubleshooting.
Key metrics to monitor:
Disk usage in the data directory grows with library size. Alert when free space drops below 20% to prevent database corruption.
Memory usage typically ranges from 100-500MB depending on active jobs. Spike during intensive operations like thumbnail generation.
Network bandwidth peaks during initial sync with new devices. Ongoing sync uses minimal bandwidth after the first synchronization.
Troubleshooting
Server won’t start: Check that the data directory exists and is writable by the server user. Verify no other process is using port 8080 withlsof -i :8080. Review logs for specific errors.
Authentication failures:
Ensure SD_AUTH format is correct. Test credentials with curl: curl -u admin:password http://localhost:8080/health. Browser authentication dialogs require exact username and password.
Clients can’t connect:
Verify the server is accessible from the client network. Test with curl http://server-ip:8080/health. Check firewall rules on both server and client networks. Ensure reverse proxy configuration preserves authentication headers.
Media processing fails:
The server requires FFmpeg and libheif for video thumbnails and HEIF images. Docker images include these by default. Binary installations on minimal systems may need manual installation of these libraries.
Sync not working:
UDP port 7373 must be accessible for P2P connections. Check NAT and firewall rules. The server attempts hole-punching for NAT traversal but may fall back to relay servers if direct connection fails.
Performance Tuning
The server handles multiple concurrent operations through the job system. Performance depends on storage speed, available memory, and indexing load. Indexing performance is limited by storage I/O. SSDs provide 10-50x faster indexing than spinning disks. Network storage over gigabit ethernet typically indexes at 50-100MB/s for metadata reads. Thumbnail generation is CPU-bound. Disable thumbnail generation for video files if CPU usage is a concern. Image thumbnails are fast but video processing can use significant resources. Database optimization happens automatically through SQLite’s auto-vacuum and WAL mode. Large libraries benefit from periodicVACUUM operations when the server is idle.
Memory allocation can be limited using systemd or Docker resource constraints. The server operates efficiently with 512MB minimum, though 2GB provides better performance for large libraries.
