Skip to content

Deploying Seafile

Introduction

Seafile is a high-performance, enterprise-grade file synchronization and sharing platform that provides a reliable alternative to commercial cloud storage services. With its focus on performance, reliability, and security, Seafile has been trusted by millions of users worldwide for managing their files privately.

Built with C and Python, Seafile uses a unique data model that splits files into blocks, enabling efficient syncing, deduplication, and storage. The platform offers desktop and mobile sync clients, a feature-rich web interface, and extensive sharing and collaboration capabilities.

Key highlights of Seafile:

  • High Performance: Efficient file syncing with delta sync and block-level deduplication
  • File Versioning: Complete version history with easy restoration of previous versions
  • Library Organization: Organize files into libraries with individual sync and share settings
  • Encrypted Libraries: Client-side encryption for sensitive data
  • File Sharing: Share files and folders via links with password protection and expiration
  • Collaboration: Online file editing, comments, and file locking
  • Multi-Platform Sync: Native clients for Windows, macOS, Linux, iOS, and Android
  • LDAP/AD Integration: Enterprise authentication integration
  • 100% Open Source: Community Edition licensed under AGPL-3.0

This guide walks through deploying Seafile on Klutch.sh using Docker, configuring persistent storage, and setting up secure file synchronization.

Why Deploy Seafile on Klutch.sh

Deploying Seafile on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Seafile without complex server configuration. Push to GitHub, and your cloud storage deploys automatically.

Persistent Storage: Attach persistent volumes for your file libraries, database, and configuration. Your files survive container restarts and redeployments.

HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure file transfers and sync client connections.

Scalable Resources: Allocate CPU and memory based on your storage needs and user count.

Custom Domains: Assign a custom domain for a branded cloud storage experience.

Prerequisites

Before deploying Seafile on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your Seafile configuration
  • Basic familiarity with Docker and containerization concepts
  • (Optional) A custom domain for your Seafile instance

Preparing Your Repository

Create a GitHub repository with your Seafile configuration.

Repository Structure

seafile-deploy/
├── Dockerfile
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM seafileltd/seafile-mc:11
# Environment variables
ENV DB_HOST=${DB_HOST:-db}
ENV DB_ROOT_PASSWD=${DB_ROOT_PASSWD}
ENV SEAFILE_ADMIN_EMAIL=${SEAFILE_ADMIN_EMAIL}
ENV SEAFILE_ADMIN_PASSWORD=${SEAFILE_ADMIN_PASSWORD}
ENV SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME}
ENV SEAFILE_SERVER_LETSENCRYPT=${SEAFILE_SERVER_LETSENCRYPT:-false}
ENV TIME_ZONE=${TIME_ZONE:-Etc/UTC}
# Expose web interface port
EXPOSE 80
# Data volumes are mounted externally
# /shared - main data directory

Environment Variables Reference

VariableRequiredDefaultDescription
DB_HOSTYesdbMySQL/MariaDB database host
DB_ROOT_PASSWDYes-Database root password
SEAFILE_ADMIN_EMAILYes-Admin account email address
SEAFILE_ADMIN_PASSWORDYes-Admin account password
SEAFILE_SERVER_HOSTNAMEYes-Public hostname of your Seafile server
SEAFILE_SERVER_LETSENCRYPTNofalseSet to false when using Klutch.sh’s SSL
TIME_ZONENoEtc/UTCServer timezone
SEAFILE_LOG_TO_STDOUTNofalseLog to stdout for container logging

Deploying Seafile on Klutch.sh

    Set Up Database

    Seafile requires a MySQL/MariaDB database. Deploy a database instance first or use a managed database service.

    Push Your Repository to GitHub

    Initialize and push your repository:

    Terminal window
    git init
    git add Dockerfile .dockerignore
    git commit -m "Initial Seafile deployment configuration"
    git remote add origin https://github.com/yourusername/seafile-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project with a descriptive name like “seafile” or “cloud-storage”.

    Create a New App

    Within your project, create a new app. Connect your GitHub account and select your Seafile repository.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 80

    Set Environment Variables

    Add the following environment variables:

    VariableValue
    DB_HOSTYour database host
    DB_ROOT_PASSWDYour database password
    SEAFILE_ADMIN_EMAILadmin@example.com
    SEAFILE_ADMIN_PASSWORDSecure admin password
    SEAFILE_SERVER_HOSTNAMEyour-app-name.klutch.sh

    Attach Persistent Volumes

    Add the following volumes:

    Mount PathRecommended SizePurpose
    /shared100+ GBAll Seafile data, libraries, and configuration

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will build the container and provision an HTTPS certificate.

    Access Seafile

    Once deployment completes, access your Seafile instance at https://your-app-name.klutch.sh. Log in with your admin credentials.

Initial Configuration

Creating Libraries

  1. Log in to the web interface
  2. Click New Library to create a file library
  3. Choose between regular or encrypted library
  4. Set library name and optional password for encrypted libraries

Installing Sync Clients

Download sync clients from the Seafile website:

Configure the client with your server URL and account credentials.

Sharing Files

  1. Right-click a file or folder
  2. Select Share
  3. Choose sharing options:
    • Internal sharing with users/groups
    • Public download link
    • Password protection
    • Expiration date

Advanced Configuration

Encrypted Libraries

For sensitive data, create encrypted libraries:

  1. Click New Library
  2. Check Encrypt
  3. Set a strong password
  4. Files are encrypted client-side before upload

LDAP Integration

For enterprise deployments, configure LDAP authentication in the Seafile configuration files within the /shared volume.

Troubleshooting

Cannot Connect Sync Client

Symptoms: Desktop or mobile clients fail to connect.

Solutions:

  • Verify SEAFILE_SERVER_HOSTNAME matches your actual URL
  • Ensure HTTPS is working properly
  • Check that the server is running

Files Not Syncing

Symptoms: Changes don’t sync between devices.

Solutions:

  • Check client logs for errors
  • Verify library permissions
  • Ensure adequate storage space

Additional Resources

Conclusion

Deploying Seafile on Klutch.sh gives you a powerful, self-hosted cloud storage solution with enterprise-grade features. With efficient file syncing, versioning, and collaboration capabilities, Seafile provides a complete alternative to commercial cloud storage services while keeping your data under your control.