Why Choose Seafile?
- High Performance: Optimized delta sync algorithm reduces bandwidth usage and speeds up file transfers significantly compared to alternatives.
- End-to-End Encryption: Client-side encryption ensures your files remain private, even from server administrators.
- Built-in Collaboration: Online file editing, file locking, comments, and activity tracking for team workflows.
- Enterprise Features: LDAP/AD integration, audit logging, antivirus scanning, and granular permissions.
- Cross-Platform Clients: Native desktop and mobile apps for Windows, macOS, Linux, iOS, and Android.
Prerequisites
Server Requirements
| Resource | Recommendation |
|---|---|
| CPU | 2+ vCPU cores (4+ for larger teams) |
| RAM | 4 GB minimum, 8 GB recommended |
| Storage | 50 GB+ SSD (scale based on file storage needs) |
| Operating System | Ubuntu 22.04 LTS or Debian 12 |
| Network | Static IP, ports 80/443 open, domain name configured |
Required Software
- Docker Engine 20.10 or later
- Docker Compose v2.0 or later
- A registered domain name pointing to your VPS IP
- SSL certificate (provided via Let's Encrypt through Caddy)
Recommended Cloud VPS Plans
Cloud VPS 4GB
Cloud VPS 8GB
Cloud VPS 16GB
Storage Tip: For large file storage needs, consider adding Block Storage volumes that can scale independently of your VPS.
Installation
Update System and Install Docker
Connect to your RamNode VPS via SSH and update the system packages:
sudo apt update && sudo apt upgrade -y
sudo apt install -y ca-certificates curl gnupgAdd Docker's official GPG key and repository:
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo $VERSION_CODENAME) stable" \
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullInstall Docker Engine and Docker Compose:
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io \
docker-buildx-plugin docker-compose-plugin
# Add your user to the docker group
sudo usermod -aG docker $USER
newgrp dockerCreate Directory Structure
Create the directories for Seafile data and configuration:
mkdir -p ~/seafile/{seafile-data,seafile-mysql,caddy-data,caddy-config}
cd ~/seafileCreate Environment Configuration
Create an environment file to store sensitive configuration. Replace the placeholder values with your own:
cat > .env << 'EOF'
# Database Configuration
MYSQL_ROOT_PASSWORD=your_secure_root_password_here
DB_ROOT_PASSWD=your_secure_root_password_here
# Seafile Configuration
SEAFILE_ADMIN_EMAIL=admin@yourdomain.com
SEAFILE_ADMIN_PASSWORD=your_admin_password_here
SEAFILE_SERVER_HOSTNAME=seafile.yourdomain.com
# Time Zone
TIME_ZONE=America/Chicago
EOFSecure the environment file:
chmod 600 .envImportant: Use strong, unique passwords for both database and admin accounts. Store these credentials securely.
Create Docker Compose Configuration
Create the docker-compose.yml file with MariaDB, Seafile, Memcached, and Caddy:
cat > docker-compose.yml << 'EOF'
version: '3.8'
services:
db:
image: mariadb:10.11
container_name: seafile-mysql
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_LOG_CONSOLE=true
volumes:
- ./seafile-mysql:/var/lib/mysql
networks:
- seafile-net
memcached:
image: memcached:1.6-alpine
container_name: seafile-memcached
restart: unless-stopped
entrypoint: memcached -m 256
networks:
- seafile-net
seafile:
image: seafileltd/seafile-mc:11.0-latest
container_name: seafile
restart: unless-stopped
depends_on:
- db
- memcached
environment:
- DB_HOST=db
- DB_ROOT_PASSWD=${DB_ROOT_PASSWD}
- SEAFILE_ADMIN_EMAIL=${SEAFILE_ADMIN_EMAIL}
- SEAFILE_ADMIN_PASSWORD=${SEAFILE_ADMIN_PASSWORD}
- SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME}
- TIME_ZONE=${TIME_ZONE}
volumes:
- ./seafile-data:/shared
networks:
- seafile-net
caddy:
image: caddy:2-alpine
container_name: seafile-caddy
restart: unless-stopped
ports:
- '80:80'
- '443:443'
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./caddy-data:/data
- ./caddy-config:/config
networks:
- seafile-net
depends_on:
- seafile
networks:
seafile-net:
driver: bridge
EOFCreate Caddy Configuration
Create the Caddyfile for automatic HTTPS and reverse proxying. Replace seafile.yourdomain.com with your actual domain:
cat > Caddyfile << 'EOF'
seafile.yourdomain.com {
reverse_proxy seafile:80
# WebSocket support for real-time features
@websockets {
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy @websockets seafile:80
# File upload size limit (adjust as needed)
request_body {
max_size 10GB
}
# Security headers
header {
X-Content-Type-Options nosniff
X-Frame-Options SAMEORIGIN
Referrer-Policy strict-origin-when-cross-origin
}
}
EOFConfigure Firewall
Configure UFW to allow necessary traffic:
sudo ufw allow 22/tcp # SSH
sudo ufw allow 80/tcp # HTTP (for Let's Encrypt)
sudo ufw allow 443/tcp # HTTPS
sudo ufw enableLaunch Seafile
Start the Seafile stack:
docker compose up -d
# Monitor the startup process
docker compose logs -fWait approximately 2-3 minutes for initial setup. Once you see "Seafile server started" in the logs, the installation is complete. Press Ctrl+C to exit the log view.
Access Seafile
Open your browser and navigate to your domain (e.g., https://seafile.yourdomain.com). Log in with the admin credentials you configured in the .env file.
Post-Installation Configuration
Essential Settings
- 1. System Settings:Navigate to System Admin → Settings to configure site name, file upload limits, and default quota.
- 2. Email Configuration:Set up SMTP settings for password resets and notifications under System Admin → Settings → Email.
- 3. User Management:Create user accounts and groups, set quotas, and define permissions.
- 4. Library Encryption:Enable client-side encryption for sensitive libraries.
Configure Email Notifications
Edit the Seafile configuration to enable email. Access the container and modify the config:
docker exec -it seafile bash
nano /shared/seafile/conf/seahub_settings.pyAdd your SMTP configuration:
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.yourdomain.com'
EMAIL_HOST_USER = 'notifications@yourdomain.com'
EMAIL_HOST_PASSWORD = 'your_email_password'
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = 'notifications@yourdomain.com'
SERVER_EMAIL = 'notifications@yourdomain.com'Restart Seafile to apply changes:
docker compose restart seafileBackup & Maintenance
Automated Backup Script
Create a backup script to protect your data:
cat > ~/seafile/backup.sh << 'EOF'
#!/bin/bash
BACKUP_DIR="/home/$USER/seafile-backups"
DATE=$(date +%Y%m%d_%H%M%S)
mkdir -p $BACKUP_DIR
# Stop services for consistent backup
cd ~/seafile
docker compose stop seafile
# Backup database
docker exec seafile-mysql mysqldump -u root \
-p"$MYSQL_ROOT_PASSWORD" --all-databases \
> $BACKUP_DIR/db_$DATE.sql
# Backup Seafile data
tar -czf $BACKUP_DIR/seafile-data_$DATE.tar.gz \
-C ~/seafile seafile-data
# Restart services
docker compose start seafile
# Keep only last 7 days of backups
find $BACKUP_DIR -type f -mtime +7 -delete
echo "Backup completed: $DATE"
EOF
chmod +x ~/seafile/backup.shSchedule daily backups with cron:
crontab -e
# Add this line for daily 2 AM backups:
0 2 * * * /home/$USER/seafile/backup.sh >> /var/log/seafile-backup.log 2>&1Updating Seafile
To update Seafile to the latest version:
cd ~/seafile
# Pull latest images
docker compose pull
# Recreate containers with new images
docker compose up -d
# Clean up old images
docker image prune -fTroubleshooting
Container Won't Start
Check container logs for specific errors:
docker compose logs seafile
docker compose logs dbDatabase Connection Issues
Verify MariaDB is running and accessible:
docker exec -it seafile-mysql mysql -u root -p
SHOW DATABASES;SSL Certificate Problems
Check Caddy logs and verify DNS:
docker compose logs caddy
# Verify DNS resolution
dig +short seafile.yourdomain.comUpload Failures for Large Files
Increase the upload limit in Seafile configuration:
docker exec -it seafile bash
nano /shared/seafile/conf/seafile.conf
# Add under [fileserver]:
max_upload_size = 10240 # Size in MBPerformance Optimization
- Memcached: Already included in our setup. Increase memory allocation in docker-compose.yml if needed.
- Database Tuning: For large deployments, add custom MariaDB configuration for better performance.
- Storage: Use RamNode's SSD storage for optimal I/O performance. Consider block storage for large file volumes.
- Monitoring: Use
docker statsto monitor resource usage and scale your VPS accordingly.
Quick Reference Commands
| Action | Command |
|---|---|
| Start all services | docker compose up -d |
| Stop all services | docker compose down |
| View logs | docker compose logs -f |
| Restart Seafile | docker compose restart seafile |
| Access Seafile shell | docker exec -it seafile bash |
| Check container status | docker compose ps |
| Monitor resources | docker stats |
Need Help?
Contact RamNode support at support@ramnode.com
Visit ramnode.com for VPS plans and documentation
Seafile documentation: manual.seafile.com
